First of all, it may be that I am just not getting how things work. Stultus sum.
I am using a Mac with OSX (10.9), therefore with x86_64 architecture.
I wanted to play around a bit with compilers and decompilers. I grabbed a random application from my computer and decompiled it using Hopper Disassembler.
Well, nice. I now got my assembly code. First thing I noticed was that you can't just "edit" this code from within Hopper. I guess that's because, if I would edit something, the addresses would go wrong altogether - which would damage the application.
From this point, I tried some different things:
- I exported the code ("File > Produce Assembly Text File").
- I extracted nearly the same code with gobjdump.
- I decompiled the executable using otool.
However, the code I received with these techniques is more or less the same. How do I recompile that assembly code so I got my modified executable? Being able to read the assembly code is sure an interesting thing, but a bit useless, no? :/
So, what do I need to do to get compile-able assembler code?! Is this even possible or do I need to patch the existing executable?