码迷,mamicode.com
首页 > 其他好文 > 详细

使用xposed 来解阿里ctf-2014 第三题

时间:2015-01-22 17:28:20      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

只能说,有了xposed以后,对于java代码的hook从此非常简单

直接粘贴代码了,对于xposed 怎么上手,请参考https://github.com/rovo89/XposedBridge/wiki/Development-tutorial

关键是找到addJavascriptInterface这个函数并hook即可,然后找到到底注入的名字以及object对象。

public class Tutorial implements IXposedHookLoadPackage {

???? public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {

???? //XposedBridge.log("Loaded app: " + lpparam.packageName);

???????? if (!lpparam.packageName.equals("com.ali.tg.testapp"))

???? return;

????findAndHookMethod("android.webkit.WebView",lpparam.classLoader,"addJavascriptInterface",Object.class,String.class,new XC_MethodHook(){

????@Override

protected void beforeHookedMethod(MethodHookParam param) throws Throwable {

// this will be called before the clock was updated by the original method

????XposedBridge.log("before addJavascriptInterface:"+param.args[1].toString());

????XposedBridge.log("methods:");

????Object obj=param.args[0];

????Class<?> cls= obj.getClass();

????Method[] ms=cls.getDeclaredMethods();

????for( int i=0;i<ms.length;i++)

????{

????????XposedBridge.log(ms[i].toString());

????}

}

@Override

protected void afterHookedMethod(MethodHookParam param) throws Throwable {

?

}

});

???? ?

???? ?

???? }

}

使用xposed 来解阿里ctf-2014 第三题

标签:

原文地址:http://www.cnblogs.com/baizx/p/4241895.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!