A simple tool to dump function binary code from binary elf. Note that it doesn't corp with call. Any function contains call to other function will fail definitely.
- Firstly, put on auto completion.
. ./source_me - Next, compile fun_add.c
gcc ./fun_add.c - View all functions (except internal functions)
./fdump.sh -list ./a.out - Let's dump that fun_add function. fun_add is a function that increases the value which pointed by the first argument by 1.
./fdump.sh -dump ./a.out fun_add - Dump just the hex stuff.
./fdump.sh -dumphex ./a.out fun_add - Dump to C and make it callable.
./fdump.sh -dumpc ./a.out fun_add - Modify the function prototype to let we pass arguments. I've done that for you in example.c . So we just see and compile the example.c .
gcc ./example.c - Test it. Done!
./a.out
./fdump.sh [tab]
