alibaba / dexposed

dexposed enable 'god' mode for single android application.
4.51k stars 1.07k forks source link

ART Hook问题 #54

Open liuguowei0709 opened 8 years ago

liuguowei0709 commented 8 years ago

请教一个问题。 任何一个method在art上都有2个入口,一个解释器,一个本地机器指令。我想hook一个method。 我看了您的源码,art_method->SetEntryPointFromQuickCompiledCode,这样是hook住一个本地机器指令执行的method。 我看您注释掉art_method->SetEntryPointFromInterpreter。 我想问的是,如果是解释执行的话,是不是必须SetEntryPointFromInterpreter才能hook住? 谢谢!!

hwjump commented 8 years ago

You can refer art/runtime/interpreter/interpreter.cc DoInvoke() method.
and there are two implement in SetEntryPointFromInterpreter : "artInterpreterToInterpreterBridge" and "artInterpreterToCompiledCodeBridge", one is just Interpreter execute, and another is CompiledCode execute. And I think this is a nice hook point for Interpreter method! Thank you!

liuguowei0709 commented 8 years ago

谢谢您的解答,还有个疑惑。不知您为什么屏蔽掉SetEntryPointFromInterpreter,不用考虑解释执行的情况吗?如果一个method是解释执行的话,目前这个版本是不是就hook不到了? 谢谢!

ghost commented 7 years ago

是的