Binary rewriting tool for HARM
rwtool
is implemented in python3. Make sure python3 and python3-venv is installed. rwtool
depends on capstone and keystone to disassemble and reassamble the target binary.
-
Run
setup.sh
to install all dependencies./setup.sh
-
Activate the virtual environment
. harm/bin/activate
-
Please make sure the binary:
- Must be compiled as ARM thumb-2 code for Cortex-M seris MCUs
- Not stripped and reserve the relocation table.
-
Use
rwtool
to instrument the target binary:cd $HARM_HOME # $HARM_HOME has been defined in the virtual environment rwtool -i path/to/target_binary.elf -e <entry point> -o path/to/refined_binary.bin
path/to/target_binary.elf
: path of the target binary to be instrumented<entry_point>
: the address of the target binary to be flashedpath/to/refined_binary.bin
: output path of the refined binary.