dexclassLoader.loadClass.overload('java.lang.String').implementation = function(name){
this.[본래 함수()]
Java.enumerateClassLoaders({
onMatch: function(class)
onMatch / onComplete
Java.enumerateClassLoadersSync()[N]
var classLoaderToUse = Java.enumerateClassLoadersSync()[2]; //Get another classloader
Java.classFactory.loader = classLoaderToUse; //Set the classloader to the correct one
var test = Java.classFactory.use("com.aaa.aaa");
test.z.overload('int','int').implementation = function(arg1, arg2){
Interceptor.attach("[Name.so]", "[method Name]")
Interceptor.attach("[Name.so]", "[method Name]"), {
onEnter: function(args) {
Interceptor.attach(addr , {
onEnter: function(args) {
...
}
});
Interceptor.attach(addr,callback)
onEnter(log, args, state) {
log('open()',args[0].readUtf8String());
},
onLeave(log, retval, state) {
}
}
var unlinkPtr = Module.findExportByName([module], [method]);
Module.findExportByName(null,'unlink');
dalvik.system.DexClassLoader
Run-time Dynamic loading이란?
코드를 실행하는 순간에 클래스를 로딩하는 기법.
Java.enumerateLoadedClasses (callbacks)
Java.perform (function () {
// 위에서 찾은 여러 클래스
var key_class = [ "com.facebook.plugin.widget.dkplayer.controller.PlayerVideoController",
"com.iqiyi.plugin.widget.dkplayer.controller.PlayerVideoController",
"com.facebook.plugin.widget.dkplayer.controller.VideoController",
"com.iqiyi.plugin.widget.dkplayer.controller.VideoController"]
Java.enumerateLoadedClasses ({
"onMatch": function (이름, 핸들) {
for (var i = 0; i <key_class.length; i ++) {
if (key_class [i] == 이름) {
console.log (이름);
}
}
},
"onComplete": function () {
console.log ( "성공");
}
});
});
Java.use
Java.choose
Process.enumerateModules
Process.enumerateModues({
onMatch: function(module){
console.log('module name : ' + module.name + " - " + "Base Address: " + module.base.toString());
},
onComplete: function(){}
});
[참고 사이트]