- IDA 7.1
- Python 2.7
- pip
- virtualenv
sudo apt-get install nasm clang
mkvirtualenv <name>
git clone <this repo>
patcherex/install_deps.sh
pip install -e patcherex
ln -s $(readlink -f patcherex/ida_plugin/patcherex_ida_main.py) <IDA DIR>/ida-7.1/plugins/patcherex_ida_main.py
ln -s $(readlink -f patcherex/ida_plugin/patcherex_ida) <IDA DIR>/ida-7.1/plugins/patcherex_ida
You are likely better off exploring than reading a long winded explanation, but here are the basics:
- Press Ctrl-Shift-N to add a new patch
- Press Ctrl-Shift-P to open the Patcherex window (for viewing / editing patches)
- Press Ctrl-Shift-R to run patcherex and generate a new binary
- From assembly, reference symbols as such:
{symbol_name}
. Keep in mind that this literally pastes the address in. If you have further questions about how this is implemented, please ping @paul.
IF YOU ARE WORKING ON A PIE BINARY, SEE FAQ #3.
- Inserting assembly where CFGFast can generate blocks (if this doesn't work, ask Fish :P)
- Adding ro/rw data
- Removing instructions
- Compiling C
- Reassembler
- ARM support
"Add code" places the code in a new segment with no jump to it, while "Insert assembly" generates a detours jumpout. This is done to support C compilation (insertion of C directly is hard (tm)).
CFG didn't generate a block there. Ping @paul for help if you can't work around it.
Use call {pie_thunk}
. This will clobber {rax, [rsp]} in order to return a pointer to the base of the binary
in rax. From there, you can just add other symbols to it to get real pointers.
No.
No.