Project which prevents execution across dynamic code sections.
make inst # generates instrumentation file make test # generates open_test, a working example
./instrument [target] # this will output instrumentation code in a file called dyn_sym.s
make wrap # compiles wrapper into a dynamic object (.so)
make run SOURCE=main_executable # run the program with the LD_PRELOAD flag set
- find_syms() identifies all dynamic symbols in binary and dependencies
- generate_asm() generates hook file
- LD_PRELOAD variable set to file containing dynamic symbol hooks
- When a function is hooked, find_dyn_addr() resolves the dynamic symbol
- Code region containing function symbol is marked executable, other code regions are marked read only
- Execution is redirected to dynamic function
- TODO: On return from dynamic call, calling code region is again marked executable