On Sat, 8 Feb 2014 14:34:01 -0800 (PST) cesar....@gmail.com
> I was doing some research on reverse engineering and I found about
> this project. What you guys have done is just amazing,
Thanks, it's always gratifying to hear kind words from users.
> I have some experience with C and assembly and I would like to do
> same with other games, so I have some questions:
> - You guys wrote your own disassembler because no existing
> disassembler meet your requirements. Is this still true? no other
> disassembler is good enough?
> - If I decide to go with the same route do I have to write my own
> disassembler too?
To disassemble into a recompilable form you need a disassembler which
will translate addresses into labels and distinguish data from code. I
don't think this is a problem easily solvable in general, but given that
compilers produce output structured in a certain way, in some cases it
can be tackled largely automatically. The job is made a lot easier if
the executable is relocatable and has in its headers the offsets to all
addresses which need to be updated when loading the executable to
I'm guessing that you could probably use something off-the-shelf like
IDA, maybe with some scripting, to do it for you. In any case, you
will likely need to do some manual intervention to correct
I wasn't aware of a free software disassembler that could meet these
requirements, I didn't want to use proprietary software and I didn't
mind the experience so I just wrote swdisasm, it's basically just LE
executable loading, code tracing and an instruction parser based on
libopcodes from binutils.
> - Is the source code of the swdisasm public available?
No, but that's only because no-one has asked so far, if you like I'll
send it to you.
> - Would you do things differently if you were starting from scratch?
I think we did pretty well, but perhaps nowadays it would be more worth
it to decompile into portable C code (like OpenTTD did originally, I
believe) and end up with an executable portable to other architectures
rather than limiting it to x86.
> Any advices for a beginner?
Yeah, set aside loads of free time and find some way to make sure you
stay motivated. Find documentation, headers, library sources,
compilers, etc. for the game and platform you're working on if you can
and don't give up!
Which games are you thinking about working on?