layout: post
title: Android Hook框架总结
categories: Android
description: android hook框架总结
keywords: Fiddler
url: https://lichao890427.github.io/ https://github.com/lichao890427/
Android Hook框架总结
Java正常方式调用逻辑:
dvmCallVoidMethod
dvmCallMethod
dvmCallMethodV
dvmInterpret
dvmMterpStd
dvmMterpStdRun
opcode => HANDLE_OPCODE(OP_INVOKE_STATIC)
GOTO_invoke(invokeStatic)
GOTO_invokeMethod
dvmMterp_invokeMethod
GOTO_TARGET(invokeMethod)
Pc=methodToCall->insns/methodToCall->nativeFunc
Java反射方式调用逻辑:
Constructor getDeclaredConstructor = clazz. getDeclaredConstructor()
Method m = clazz.getDeclaredMethod()
m.Invoke() =>
Constructor. newInstance =>
Dalvik_java_lang_reflect_Constructor_constructNative =>
dvmInvokeMethod =>
method->nativeFunc/dvmInterpret insns
Method.invoke =>
Method.invokeNative =>
Dalvik_java_lang_reflect_Method_invokeNative =>
dvmInvokeMethod =>
method->nativeFunc/dvmInterpret
nativeFunc => dvmResolveNativeMethod
dfunc = dvmLookupInternalNativeMethod
dfunc()
GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall, u2 count, u2 regs)
Android Hook方式: