Back in March 2014, Garage4Hackers had a live stream with Gynvael Coldwind. His talk was named "Data, data, data! I can't make bricks without clay"
or a few practical notes on reverse-engineering
. You can see the recording on youtube.
Here are my notes that I discovered from 2014.
His website: http://gynvael.coldwind.pl
Read through the manual and try to write your own pseudo-C code to understand it better.
So if there are a lot of jumps with instructions in the middle.
He wrote a GDB script to just go through the jumps and collect all of the instructions in between to simplify the assembly.
Some debuggers have tracing as a separate option. E.g. OllyDBG
http://pelock.com/products/obfuscator
If you are working on an strange platform (e.g. IBM S/390), look at the manual and find the op-codes and go through them and translate them for yourself.
Write a simple script to add instruction descriptions to the disassembled code. So you can have a description of what it does with every instruction and you do not have to go through the manual for each op-code again.
His favorite is "distorm" hosted on https://code.google.com/p/distorm/. You can use it inside Python scripts to disassembler binaries from starting to end addresses.
Talked about useful debug APIs. E.g. CreateRemoteThread.
Twitch went down again.
Scripting, use Python. WinDbg - Olly - IDA - Immunity and GDB support.
SetBP(Address, function_to_call_when_the_address_is_reached)
Twitch died again :(
Use these tools. * Linux: strace and ltrace. * On Windows : Process Monitor.
Example from a CTF.Mixer
: It needed a certain library. So you have to install all dependencies. Use "ldd" to check if you have everything.
LD_LIBRARY_PATH
environmental variable.readelf -l binaryname
will show us which loader is needed for this library.
It loaded the application in GDB but could not debug.
Two solutions:
1. Attach after running, bad idea.
2. Manually enter CC CC at EP by ediuting the hex.
3. Then run it in GDB.
If you have a blackbox with a small-ish input/output space, let it run and look at output to find out what it does.
I asked him for an alternative to IDA pro for x64 binaries. He didn't have any alternatives as he uses IDA Pro.