A tool with interactive shell for finding gadgets in executable files. Support ELF and PE file format, multiple architectures and modes: x86, ARM, 32bit, 64 bit. Can also assemble and disassemble instructions.
- capstone
- keystone
- pyelftools
- pefile
create a virtualenv:
virtualenv env
source env/bin/activate # activate the Python virtualenv
Install development dependencies:
pip install -r requirements.txt
Run the interactive shell:
cd src/gadgetfinder
python3 shell.py
In the interactive shell, run:
asm inc eax; add eax,ecx --arch x86 --mode 64
disas ['0xff', '0xc0', '0x1', '0xc8'] --mode 64
asm pop ebp; ret
disas ['0x5d', '0xc3']
load ../../data/prog.file
info
dump
search pop ebp
You can edit configuration in setup.config.
To build:
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
python3 -m build
$ pip install gadgetfinder==1.0.0
Unable to find some gadget