Jump to content
IGNORED

dissasembleing


Haydn Jones

Recommended Posts

I want to try and hack a rom, but due to a few dead links i cant find a dissasembler

I assume you mean the 2600. If so then Distella is what you're looking for. The new version also works for 7800 games.

If you mean the A8/5200 then Dis6502 is what you need.

or its source code. Any tips?

What game? It may have been fully or partially disassembled.

Link to comment
Share on other sites

I've downloaded Distella and it works fine, my problem is just user error. :) I've put processor 6502 and include vcs (and actually also tried putting the variables directly into the code). Any idea why I can't recompile it correctly? (it does compile, but only displays black in z26).

 

Also, does anyone have the binary (or better yet the .asm) for Ice Hockey? I noticed none (or at least very few) of the Activision games have ROMs, is there a reason for this? C&D perhaps? I know they are still an active company and thought this may have something to do with it.

 

Thanks,

J.D.

Link to comment
Share on other sites

There's a little trick that I use when disassembling games to try to find anything that was done incorrectly...just after disassembling a binary for a game with Distella, I immediately take that disassembly (without making any changes to it), and assemble it with Dasm. Then, I do a file compare under Dos to see if anything differs. For example:

 

distella -pafs pacman.bin > pacman.asm

 

dasm pacman.asm -f3 -opac.bin

 

fc /b pacman.bin pac.bin > changes.txt

 

Dos will report anything that is different between the 2 binaries, and put all of them in the file named changes.txt :) The memory locations of all of the mistakes will be listed to track down the cause better.

 

Can you post your disassembly? It should be easy enough to figure out what went wrong with it.

Link to comment
Share on other sites

That's a neat little trick, thanks. I also saw in the Distella help files where you can "config" the output to include things such as ROM, code, graphics, etc. so they are displayed in comments. Know the commands to make any/all of these happen?

 

As for the disassembly, I don't have WinZip and already have cluttered the forum in the newbie section. If I have further problems, I'll look it up so I can post stuff for you.

 

-J.D.

Link to comment
Share on other sites

It's not a command...but an extra switch thrown into the distella command line (-cfilename = disassemble using a config file). You need to actually SUPPLY the config file tho. What those are is just a text file that holds the addresses that Distella should interpret a certian way...code, data, or gfx. The way that you create them is by letting Distella run an automatic one, and then examine it for any areas that were misinterpreted.

Open up a config file for an example.

 

 

Ice Hockey disassembly:

icehocky.zip

Link to comment
Share on other sites

I've tried it on a few different games including Bowling, Battlezone, and Real Sports Volleyball (all of which original ROMs work fine).

 

Volleyball and Battlezone won't recompile at all. For bowling, the text file ends up showing:

 

Comparing files Bowling.bin and SOURCE3.BIN

FC: Bowling.bin longer than SOURCE3.BIN

 

Interestingly, the newly created source3.bin shows at 0K, and the original is 2K.

 

When I try to run source3.bin through z26 I get what I like to call the "Atari musical bitch-slap scale". Basically the blue bars go to the middle, the scale is played, and z26 exits.

 

If I can't figure it out that's okay, I'm trying to create a game, not hack one anyway. I just thought it would be nice to see some (working) code to play around with.

 

Thanks for the help- Nukey seems to respond to newbies more than anyone else here, although vdub_bobby, Thomas Jentschz (spelling?) and several others have already helped me numerous times too. I think it's really cool you guys take the time to help us out. Maybe someday I'll be able to repay your patience with something cool! :)

 

-JD

Link to comment
Share on other sites

Something is causing it to crash out when disassembling...that would be my guess. Battlezone is an 8k game, so you can't disassemble it as-is (you would need to split the binary file into 2 halves first). That would explain that one, but I dunno about RS Volleyball (4k) and Bowling (2k).

 

What is the EXACT thing that you are typing? Can you post your disassembly of either of those 2 games? Bowling should go something like:

distella -pafs bowling.bin > bowling.asm

Link to comment
Share on other sites

i was typing distella -a bowling.bin > bowling.s instead of what you had. When I switched the -a to -pafs and the .s to .asm it seems to work fine for Vball and Bowling. I don't think the .s/.asm should make much diff, but what does the -pafs vs. -a do?

 

Both games also play fine in z26, btw.

Link to comment
Share on other sites

i was typing distella -a bowling.bin > bowling.s instead of what you had.  When I switched the -a to -pafs and the .s to .asm it seems to work fine for Vball and Bowling.  I don't think the .s/.asm should make much diff, but what does the -pafs vs. -a do?  

 

Both games also play fine in z26, btw.

 

All that -a does is supress the letter A being used as an argument. For example, LSR $address will move the bits to the right in that memory location, while LSR with no argument will move the bits to the right in the Accumulator...one of the 65xx's registers. With the -a switch...

 

      LSR    A

 

will instead appear as...

 

      LSR

 

Cuts down on the amount of typing ;)

 

The switch -p will place the text "processor 6502" into the disassembly. When assembling if you do not state the processor type, Dasm will not assemble it :!: So it's just good practice to -at the very least- use the -p switch. You are gonna need to tell it what processor it's using anyway...might as well get it right away when disassembling.

 

The switch -s will put the number of cycles that each instruction is using right in each line as a comment. The 2600 is extremely sensitive about how long something takes (especially in the display kernal)...so it's handy to have them listed right in each line rather than having to look them up all the time. Just as with -a...this is for your benefit.

 

The switch -f will make Distella print out the address mode for instructions that are treating zero-page addresses (ram) as absolute addresses. With the switch...

       STA    $00C2,X                ;5

 

...will appear as...

       STA.wx $00C2,X                ;5

 

This is a good idea...since if you assembled the first example later, it might be interpreted as...

       STA    $C2,X                  ;3

 

Not the same thing...it takes 1 byte less (messing up the memory locations of all tags that follow), and 2 cycles less time (the 2600 is really picky about time). As with -p, it's just a good idea to use it and save yourself all the hassles of editing later.

 

And as mentioned before, -c lets you specify a config file that Distella should use. The filename of the config file must be entered right after the c.

 

 

All of the switches can be seen by just typing distella by itself.

Link to comment
Share on other sites

BTW you are correct that .s and .asm don't really matter at all. S means "source" and .asm means "assembly", to Distella and Dasm they don't mean anything. All they are interested in is if the filename exists. But since a disassembly of a game is not the same thing as a source code of a game, I usually use .asm instead (source code is THE assembly that created the binary...complete with the programmer's comments and such. Those comments are lost when the game is assembled...and lost forever if the source files no longer exist. All of the games that have been reverse-engineered too are not the source code (but due to efforts by the likes of Debro or Thomas, they can read pretty much like the original source might have...tho you still won't see the original programmer's comments/insights - those are gone forever).

Use .s, .asm, whatever you want ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...