About the inline hook of lsplant #11
-
I heard that LSPosed is based on LSPlant to implement art hook? But only a few apps have this problem, and I have no way to provide logs, because I test the app developed by others.
after that, I tried to use this inlinehook framework instead of bobby hook in lsplant's initInfo, and it opened normally again SandHook::ElfImg art("libart.so");
lsplant::InitInfo initInfo{
.inline_hooker = hooker::InlineHooker,
.inline_unhooker = hooker::InlineUnhooker,
.art_symbol_resolver = [&art](std::string_view symbol) -> void * {
auto *out = reinterpret_cast<void *>(art.getSymbAddress(symbol));
return out;
}
}; void* InlineHooker(void* target, void* hooker) {
_make_rwx(target, _page_size);
void* origin_call;
// if (DobbyHook(target, hooker, &origin_call) == RS_SUCCESS) {
if (registerInlineHook((uint32_t) target, (uint32_t) replace, (uint32_t **) &origin_call) == ELE7EN_OK
&& inlineHook((uint32_t) target) == ELE7EN_OK){
return origin_call;
} else {
return nullptr;
}
} I think I'm really stupid and can't understand what's going on, so I have to ask you @yujincheng08 to help me out, when you are free. thanks a lot🙏! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is because Dobby cannot handle nested hooks. Fire an issue to Dobby instead. |
Beta Was this translation helpful? Give feedback.
This is because Dobby cannot handle nested hooks. Fire an issue to Dobby instead.