Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - SNES Reassembler!<_<
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 3213/8210
Originally posted by Darkflight
Hey!

Yes, but this is a Reassembler.

Still, you are correct. You would need a good disassembler for this, but this set fof tools is just for once you have all the jumps figured out.

So... it's just an ordinary SNES assembler then? Once you've disassembled it to that point, it's essentially a re-creation of the game's source code which you could use in any assembler.


I'm no programmer, but for a disassembler, couldn't you set the program to read the different types of jumps and produce the right labels for them?

It's possible to some extent, but it wouldn't be able to make proper labels, just numbers. You'd need a human to go through the code and figure out what does what to make real labels.
FuSoYa
Posts: 148/255
Another issue with total reassembly is that if you rely on fixed location utilities or tools (like LM), you have to be careful when making changes to the code. If the rest of the code/data in the bank gets shifted, it can make the ROM incompatible with your editors.

Which is partly why I don't consider reassembling entire SNES ROMs to be very practical... not for anything I do, anyway. I don't do the bulk of my ASM coding in a hex editor as it is. Sure, I'll use a hex editor if I want to adjust something or put in a quick jump to my own code. But if I need to see the original ROM's code or do a minor edit, I'll run a trace or fire up SPASM. And for doing more moderate to heavy work (or hacks I want documented for future reference), I just open up a text editor and code whatever I want, then run only that code through an assembler.
Sukasa
Posts: 46/1981
Hey!

Yes, but this is a Reassembler.

Still, you are correct. You would need a good disassembler for this, but this set fof tools is just for once you have all the jumps figured out. I'm no programmer, but for a disassembler, couldn't you set the program to read the different types of jumps and produce the right labels for them?

I know there are a lot of bumps in the road, but wasn't it the same with ILBPE? I guess with time people may be able to do that. I don't know myself.
bbitmaster
Posts: 68/103
hyperhacker pretty much summed it up. You need two things before you can produce a working disassembly:
1. Some method of seperating code from data. This could be a tracing algorithm like what's in snowbro's NESrev, or it could be an external file produced by playing the game like FCEUXD's code/data logger

2. Some method of generating labels for every jump, branch, or data read. Most of these can be generated by the assembler itself, untill you run into indirect jumps and pointer tables. Also in the NES's case, you have bankswitching to worry about which mean's there is no way to know what bank might be swapped in when a particular jump is executed. To solve this, I invented something called an Address Label Logger, which logs every jump that leads to other banks, but I imagine that'd only be needed on the NES, since there is no bankswapping in the SNES.

Now I realize we're talking about SNES here, but these two concepts should be exactly the same. You must have code/data seperated, and you must have labels for everything.

So, In short, it can be done, just not perfectly without some human to fill in labels for any pointer tables.
blackhole89
Posts: 546/971
As far as I know there is no real difference between .SMC, .SFC and .FIG, and the extension only depends on which copier software was used and what console the former cartridge was for (SMC=Super MagiCom=US SNES, SFC=Super FamiCom=JAP SNES,FIG=dunno). Then again, I might be wrong. Fact is that far not all .SMC ROMs have a header, neither they must have one, as Evil Peer / Geiger has proven with Temporal Flux and his general crusade against ROM headers.
HyperLamer
Posts: 3181/8210
Well the problem with that is you need to have a 100% disassembly before you can re-assemble it, at least after making any changes. That means no line numbers, it has to follow proper ASM syntax. Also, all jumps, calls, and pointers must be converted to labels instead of actual addresses, or else any changes will break it because they won't point to the right place anymore. Finally you'll need to locate every single piece of data and make sure it's stored as data in the ASM or external files rather than as code. It's a LOT of work.
Sukasa
Posts: 45/1981
Hey!

I heard about all the talk about reassembling ROMs, And I remembered that I had downloaded a set of SNES game creation tools. One of them was a combination of a compiler and a linker that produces .FIG headerless SNES ROM images. It used to produce .SMCs, but because they were identified as .FIGs, the extesion was changed when outputting.

I'll post the program when I get home.

If someone could update the .bat file when I upload the .zip to use a goodSNES-like program to create a header for the ROM and rename it to xxxxxx.SMC,
I think that this set of programs could be used to modify the ASM without using a hex editor, which would make it easier for newbies and veterans alike!
Acmlm's Board - I2 Archive - Super Mario World hacking - SNES Reassembler!<_<


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.004 seconds.