Skip to main content
1 of 3
sherlock
  • 1.4k
  • 3
  • 23
  • 41

Insert a function call in an ELF executable

I want to patch an ELF executable to insert a function call (the function s2e_rawmon_loadmodule and its dependencies are to be linked statically, preferably) at the beginning. This answer seems to have a nice set of pointers. If I have understood correctly, dynamic instrumentation using PIN/Valgrind/DynamoRIO alters the address space. The addresses of the subsequent instructions get changed which I don't want. For static instrumentation, ERESI project could have been useful. Looks like the project has been abandoned for long. I am not being able to build the tool on Ubuntu 14.04 due to compilation issues.

Can anybody help me out with some workaround?

sherlock
  • 1.4k
  • 3
  • 23
  • 41