advanced-microcode-patching / shiva

A custom ELF linker/loader for installing ET_REL binary patches at runtime
Other
146 stars 13 forks source link

Insert trampoline into original function, to handle function pointers #11

Open elfmaster opened 1 year ago

elfmaster commented 1 year ago

When we re-link a function to a new version of that function in a patch, i.e. the executable has function foo() and our patch module has a new function foo(). All call/bl instructions to foo() will be relinked to the new foo() within the patch, however this doesn't handle function pointers which will still use the original function. This can be remedied with a simple trampoline inserted into the o_func prologue.