Some questions to the developers

210 views
Skip to first unread message

cesar....@gmail.com

unread,
Feb 8, 2014, 5:34:01 PM2/8/14
to syndicate...@googlegroups.com
Hello,

I was doing some research on reverse engineering and I found about this project. What you guys have done is just amazing, congratulations!

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?
- Is the source code of the swdisasm public available?
- Would you do things differently if you were starting from scratch? Any advices for a beginner? 

Thank you,
Cesar Canassa

Unavowed

unread,
Feb 12, 2014, 7:49:13 AM2/12/14
to syndicate...@googlegroups.com, cesar....@gmail.com
On Sat, 8 Feb 2014 14:34:01 -0800 (PST) cesar....@gmail.com wrote:
> I was doing some research on reverse engineering and I found about
> this project. What you guys have done is just amazing,
> congratulations!

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
memory.

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
misinterpreted code/data.

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?

Cheers,
--
Unavowed

Cesar Canassa

unread,
Feb 14, 2014, 10:42:32 AM2/14/14
to Unavowed, syndicate...@googlegroups.com
Hello Unavowed,

Thanks for the response are great explanation! I think all my doubts were addressed. 

> No, but that's only because no-one has asked so far, if you like I'll
> send it to you.
I would love to see swdisasm source code if you could send it to me. 

Which games are you thinking about working on?
I am thinking about Betrayal at Krondor 


Best regards,
Canassa

Unavowed

unread,
Feb 20, 2014, 6:02:03 AM2/20/14
to syndicate...@googlegroups.com, cesar....@gmail.com
On Fri, 14 Feb 2014 13:42:32 -0200 Cesar Canassa wrote:
> > No, but that's only because no-one has asked so far, if you like
> > I'll send it to you.
> I would love to see swdisasm source code if you could send it to me.

It's now available for download at:
http://swars.vexillium.org/files/swdisasm-1.0.tar.bz2

> > Which games are you thinking about working on?
> I am thinking about Betrayal at
> Krondor<http://en.wikipedia.org/wiki/Betrayal_at_Krondor>

Nice choice, I really liked that game, still need to complete it one
day. If you ever manage to faithfully play back the original MIDI
music, come back to us and let us know how, the swars port still lacks
that feature.

Good luck with your efforts!
--
Unavowed
Reply all
Reply to author
Forward
0 new messages