elfmaster / dt_infect

ELF Shared library injector using DT_NEEDED precedence infection. Acts as a permanent LD_PRELOAD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I use dt_infect to work on .so file?

sczhengyabin opened this issue · comments

Example case:

  • excutable: a.out
  • linked .so file: libmath.so
  • function in .so file that called by excutable: int add(int, int)
  • target: Using function interposition to print the arguments of add.

I tried with dt_inject. Put a new int add(int, int) function in libevil.so in the same manner as the example.
Then tried:

./inject libevil.so libmath.so

Outputs says "Successfully injected".
However when I tried to run a.out, the loader came with the error:
ELF load command address/offset not properly aligned.