advanced-microcode-patching / shiva

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

Symbol interposition support for .rodata variables that encode the value into a mov instruction #3

Open elfmaster opened 1 year ago

elfmaster commented 1 year ago

We currently support symbol interposition for .rodata if we are patching something like this:

const char my_name[] = "elfmaster";

Because it will compile into two or three instructions that reference the string stored in .rodata by symbol name my_name Shiva has the ability to relink this code.

In the even that the program we are patching defines a constant 4 byte integer

const int ro_val = 5;

Will often be compiled into a mov w1, #0x5 which we cannot re-link without relocation data. In the future when the Shiva prelinker is able to generate enough relocation data we can handle this type of patch.

See modules/patches/rodata_interposing for an example on patching rodata strings.

elfmaster commented 1 year ago

This isn't yet an urgent matter, but will eventually need some work.