PDA

View Full Version : Want to learn how to dissassemble games


Keeks
02 November 2008, 19:07
Hi there,

I want to learn to disassemble games. Not for any great purpose, just to see how they tick and to do something during the cold wet months of winter.

I do know a bit of 68k assembly.

What I don't know is where to start.

I am assuming that the first place to look is the bootblock, but how do I look here and what should I be looking for?

bippym
03 November 2008, 04:34
Hmmm.. It's not a quick and simple thing to try and explain :(

Personally I use WinUAE and action replay 3. I load the bootblock to an address (say $50000) and then I disassemble it with d $5001c or similar (the exact number escapes me).

I then see what the bootblock is doing, and if you are lucky it's reserving some memory, then loading the game-loader to an address and then jumping to it!

If you are unlucky.. well you'll see ;)

Next you change the bootblock to loop on itself instead of JMP loader, correct checksum, write it back to disk and reboot!

Now when you enter the replay you can disassemble the JMP address and figure out what the loader is doing. Again if you are very lucky it's a single file game and like with bootblock you modify the loader to flash screen or something once loaded and then you can disassemble the game :)

Hope this is okay, i've simplified it greatly as I have just finished work and it's 3.30am :(

Keeks
03 November 2008, 18:02
Cheers for that.

But still not sure How to do it.

How do you load the Bootblock to an address such as you say $50000? Thats what I'm looking to do. If I could see what the bootblock is doing then I might be able to figure out the rest myself, but I don't know anything about bootblocks.

Thanks

Keeks

Photon
03 November 2008, 21:34
The single most important thing to remember is to follow each jump in the bootblock as the cpu would. Do not even look at code below a jump before you have ruled out that the branch is taken. :) Then, look for "move something, offset(a1)" and calls to "offset(a6)" as a1 and a6 have the structure pointer to the trackdisk device and execbase, respectively. If you see this combo it is usually loading something with trackdisk.device. By learning the trackdisk structure (structure.doc by Kodiak), you know which sectors are loaded, and to where. Then you can load those sectors to the same place and disassemble from there (IF the loaded stuff is jumped to, otherwise not, see above :))

Learned this proper when I had to have a look at a game lately ;)

Codetapper
04 November 2008, 20:31
Far easier is to rip the bootblock with a utility like grab (grab Game.adf bootblock.bin first 1024) then just use the tool resource to disassemble it. No mucking around with memory allocations and you can comment and save your work as you go - which is good for a newbie that might need a few passes to work out what's going on.

Keeks
04 November 2008, 20:47
Thanks for the replies. Much appreciated.

Where would I find the utility grab. I'm assuming it is CLI based utility?

Thanks again for the help

xaind
06 November 2008, 04:32
Not sure where you can find grab. There's a vaguely-similar utility on aminet called GrabInFile. You don't need it though, resource (v6.06) comes with a "Disassemble BOOT sector" macro that pulls the data straight off the disk.

Keeks
06 November 2008, 18:10
Cool guys.

Thanks for the help. Should have enough info now to get me started.

Thanks again