unresolvedsymbol / mcpelauncher-core

The shared code between the client and server launchers
0 stars 0 forks source link

Original address for hook is not offset by base addr #1

Open unresolvedsymbol opened 3 years ago

unresolvedsymbol commented 3 years ago

At the end of HookManager::LibInfo::applyHooks, original is set but is apparently relative to the base address the library was loaded at unlike how HookManager used to act on the non-ng branch. The hooker should not be required to slide orig to call the function pointer.

unresolvedsymbol commented 3 years ago

dlsym(handle, sym) gets the correct value but the one set by applyHooks is off by somewhere around 0x7f7700000000

unresolvedsymbol commented 3 years ago

Forgot to mention adding LibInfo::base (from linker::get_library_base) is off by some amount. For now the only solution I have is to find the offset by doing pointer math and sliding all the original fptrs in my mod.