Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make static linked ELF file to load LD_PRELOAD .so

I have static linked binary (ELF file) it doesn't have dynamic segment, .dymsym sections and it doesn't perform LD_PRELOAD command and etc. How could i create fake dummy dynamic segment to activate dynamic loader and perform LD_PRELOAD command?

like image 331
Kracken Avatar asked Aug 03 '16 14:08

Kracken


1 Answers

How could i create fake dummy dynamic segment to activate dynamic loader and perform LD_PRELOAD command?

You can't.

Even if you could, getting LD_PRELOAD to preload something would still be useless: usually you want to interpose some symbols in your LD_PRELOADed library, but that requires these symbols to be unresolved in the main binary, or at least exported in its dynamic symbol table. A statically linked executable doesn't have any unresolved symbols, nor a dynamic symbol table by definition.

like image 124
Employed Russian Avatar answered Nov 04 '22 20:11

Employed Russian