function hook_RegisterNatives() { var env=Java.vm.getEnv(); var handlePointer=Memory.readPointer(env.handle); var nativePointer=Memory.readPointer(handlePointer.add(215*4));
Interceptor.attach(nativePointer,{ onEnter:function (args) { send("onEnter 截获传入参数 env:"+args[0]+" clazz:"+args[1]+" functable:"+args[2]+" num:"+args[3]); var methods = args[2]; var methodcount = args[3];
for (var i = 0; i < methodcount; i ++ ) { var idx = i * 12; console.log("name: " + Memory.readCString(Memory.readPointer(methods.add(idx))) + " signature: " + Memory.readCString(Memory.readPointer(methods.add(idx + 4))) + " fnPtr: " + Memory.readPointer(methods.add(idx + 8)) ); } },