要手動調用fupkInvokeMethod
bool DexDumper::fixMethodByDvm(DexSharedData &shared, DexMethod *dexMethod,
ClassDefBuilder* builder, u4 &lastIndex) {
lastIndex = lastIndex + dexMethod->methodIdx;
auto m = builder->getMethodMap(lastIndex);
assert(m != nullptr && "Unable to fix MethodBy Dvm, this should happened");
shared.mCurMethod = dexMethod;
FupkImpl::fupkInvokeMethod(m); /////////////////////////////////////////////////
shared.mCurMethod = nullptr;
return true;
}
/* @F8LEFT
* This method is used to export some data for fupk3 to dump dex file.
* Fupk3 will hook this method and get data from it.
*/
void fupkInvokeMethod(Method* meth) {
// it is no need to init or link class, the code of the method will
// not exec actually, so just ignore it
// anyway, I should make sure this method has code to execute
if (dvmIsMirandaMethod(meth) || dvmIsAbstractMethod(meth)) {
return;
}
dvmInvokeMethod((Object*)0xF88FF88F, meth, NULL, NULL, NULL, true);
}
dvmInvokeMethod又會調用gFupk.ExportMethod
gFupk.ExportMethod在xposed的框架中加載so的過程中被設置爲fupk_ExportMethod
也就是說,調用fixMethodByDvm 就會跳轉到fupk_ExportMethod(void * thread,Method *method)