News:

11 March 2016 - Forum Rules

Main Menu

N64 decomp

Started by SterrFry, October 01, 2021, 12:07:54 AM

Previous topic - Next topic

SterrFry

I need help with decompiling a rom, all I need to do is extract the data from it, I was told to use z64dump to do so however I cannot find such a tool with that name. I need to extract messagedata from the rom to be able to edit text in a certain game. Can anybody help me?

FAST6191

Is there a particular reason you are being coy about the name of the game? Knowing the name of the game can help if someone has gone before and written down what they found, if there are game specific tools for them or one of the responders feels like taking a crack themselves to give you some ideas about how to tackle it.

As far as I am aware N64 games don't have a filesystem and are instead standard incbin style all jumbled up data and code and whatnot. Whether homebrew (granted it would have been known as PD/public domain at the time) or some commercial dev doing their own thing made one I don't know. This means you are back to classic relative search, tracing, statistical, corruption, inference, RAM loop back searches and whatever else people do for finding things.

Decompiling in the N64 context usually means someone takes the ROM and attempts to turn it back into C code, most famously seen with Mario 64 but plenty of other games have advanced projects* as we speak (plus the whole gigaleak thing), that or aspects of dynamic recompilation/dynarec that many N64 (and later devices needing a bit of a speed boost over classic emulation methods). This is a rather more advanced technique, especially on the N64 whose C compilers, libraries and coding manuals are way less well known than similar vintage PC efforts and decompilation is still at the forefront of computer science. Technically it would yield text locations if you performed it but it is a very backwards way and anybody that could usefully do decompilation** will also be able to do basic tracing.
That said plenty have used decompiling and unpacking as synonyms over the years, myself included, so you are not necessarily wrong in using the term.


*the Zeldas are the big ones, don't know about Goldeneye day to day but it is going, I hope Perfect Dark has one and I did see efforts to do a Kirby game uncovered a hitherto unknown cheat menu.

**if by some miracle you have a list of function names and such a la Diablo https://www.youtube.com/watch?v=5tADL_fmsHQ and possibly the GTA3 and Vice City stuff then you might be able to do the smart computer user/programmer fumbling their way through a logical language technique. Unless you game was ported to many other places to go looking in, was leaked/released or in the gigaleaks (there were quite a few, not to mention if you have that you likely have source code -- technically some code was more beta than release so who knows) you probably don't have this.

As far as z64dump then first result of a search for me
https://github.com/bitskitn/z64dump
"A tool that uses heuristics to locate asset tables in Zelda (N64) rom files and extracts them into sorted directories."
The code is right there so I should probably read it to see what its heuristics are (a lot of text has giveaways as to it being text rather than something else, thus you can use such things to locate text in random regions of ROM or after another hacker has gone in and shuffled things around) but I am going to have to run.

SterrFry

oh no not trying to be coy, the game is Animal Forest for the N64 or DobutsuNoMori as it is commonly referred to. i have an animal crossing text editor that will work for translating the game and it is a passion project for me as i have a custom N64 cart with a real time clock chip on it that actually makes the game function properly on console. but to be able to start editing text i was told by the person who made the text editor that i must unpack the rom and extract the messagedata and messagedatatable from it and then recompile it all after, and he told me that i should z64dump to do that. perhaps it could work since animal crossing and zelda were made on the same engine?

FAST6191

Not impossible but I don't know what engines and such were doing what.

That said did animal forest not appear in one of the gigaleaks? Or was it just assets?
If you have source then compilers for it should be readily available and you can do all manner of things then, possibly including just using it to figure out the formats in question for the baseline ROM.

SterrFry

actually i think it was! i used GEDecompressor to extract binary files from the rom, but now im truly at a loss cause i dont know which .bin files are the messagedata and messagedatatable and when i try to open a .bin file in my text editor it doesnt do anything. its the text deitor made by cuyler36

notrea11y

Quote from: FAST6191 on October 01, 2021, 06:02:24 PM
Not impossible but I don't know what engines and such were doing what.

That said did animal forest not appear in one of the gigaleaks? Or was it just assets?
If you have source then compilers for it should be readily available and you can do all manner of things then, possibly including just using it to figure out the formats in question for the baseline ROM.
Yes, correct, it was:
https://www.youtube.com/watch?v=v-_Ftbgfh54&t=44s