ROM Hack Decompressing Trauma Center: Under the Knife (romfile.bin) (help needed)

Lucinamarth

Active Member
OP
Newcomer
Joined
Jan 7, 2017
Messages
34
Trophies
0
Age
23
XP
115
Country
I wanted to start working on a graphical mod for the game Trauma Center: Under the Knife (aiming to replace some of its character assets with those from its sequel, as well as its Wii remake Trauma Center: Second Opinion) so I dumped the game's rom (.nds) file and opened it up with a few programs (I've tried Crystaltile2 and Tinke.)

The game's directory looks like this in Crystaltile2:
1650567917706.png

As you can see, the largest file by far is romfile.bin which appears to be a compressed archive containing most of the actual game content.

The main point of my problem is that I don't know what kind of compression has been used on romfile.bin, and my efforts so far to decompress it in order to begin locating the game's assets have been unsuccessful. If you have experience with DS ROM hacking, I would really appreciate any advice.

That's the core of the thread, but I'd also like to share some of what I've found while looking into the issue, in case it helps to narrow things down.

Firstly: this thread from 2020 in which someone asks about the same file:
https://gbatemp.net/threads/how-to-extract-from-trauma-centers-romfile-bin.562966/
(Apologies if my thread seems unnecessary when this one exists, but I didn't think necroposting just to ask "figured it out yet?" would be appropriate forum behaviour)

Secondly: also in 2020, a team developed and released a complete Brazilian Portuguese translation of the game, implying that they were able to successfully decompress and edit the ROM:
https://www.romhacking.net/translations/5774/
The translation is impressively polished, and includes text, graphical and even audio edits which show that the game has been reverse-engineered before.

Thirdly: the game also has a mod (ALSO released in 2020) which adds button controls, further showing that it has been decompressed before:
https://www.romhacking.net/hacks/5565/
I don't have much more to say, but this ROM hack also shows that the game has been modded before.
(It seems like interest in this game peaked in 2020? Probably something to do with the game's plot about an epidemic :huh: )

Finally: some evidence of other games (Ace Attorney Investigations, mostly) using a romfile.bin which needs to be decompressed. This one is tenuous but they might use the same compression; by this point I was desperate:
http://www.romhacking.net/forum/index.php?topic=31882.0
In this thread, a Ukrainian user (needless to say, I hope they're alright) complains of a very similar issue, and having used Tinke unsuccessfully to inspect another game's romfile.bin.

All of this extra information might be unnecessary, but I'll share it anyway because I want to show that I've spent plenty of time researching my issue independently before choosing to bother the forum with it; I wouldn't want to waste all your time before trying on my own first.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,281
Country
United Kingdom
I have not got it in front of me right now to pull apart but most of these archives are not so bad.

I don't see any other files in the same directory worth considering (sometimes archives will have separate listings for various reasons) so it is probably all in the thing.

To that end most of the the first however much of the file will be at least the sizes/locations of the files, hopefully also some file names.
Assuming it does not jump out at you (runs of numbers increasing in size by various amounts is a good sign of something to investigate) what most do in these scenarios is try to find a bunch of sub files -- I imagine a bunch of https://www.romhacking.net/documents/[469]nds_formats.htm are in there somewhere. From there you know the start of the archived files, and ends to go for the next files if you use any internal size values to figure it out, which also means start of next file. Get a little list going of sizes and locations and compare that to any potential candidates for pointers at the start or end (footers are rare but have been seen).
Alternatively if anything has been compressed within it (you won't compress a whole however many megs file that is as you have to then decompress the lot -- the DS having 4 megs of RAM which it needs to do everything but some aspects of graphics, including house the ARM9) then a compression search within it (don't know what I am suggesting right now -- cue's stuff is more for when you get it out, dsdecmp might do something, crystaltile2 is unstable as you like as well as lying lots but can get it done. Most compression searching efforts are more for the GBA, though this should be early enough that it should be mostly BIOS compatible type 10 so who knows) might yield some locations to look at, do also be aware of compression if you are searching for magic stamps (in this case it will start with 10 hex or maybe 11 and have a file size afterwards, and flags for the compression will mess up locations if you are comparing to the link above or similar documents).

Beyond that you can watch the game decode something and fetch it as it will have to go through pointer lists and formulating a read command. Jumping into assembly, much less tracing on the DS, is possibly a bit much but the idea is sound enough -- I would probably find something in RAM, find it in the romfile.bin/ROM as a whole. Set a bread on read for that address and work backwards from there as it generates the B7 command ( http://problemkaputt.de/gbatek.htm#dscartridgeprotocol ) and thus you have your pointer list and how it works.
I have seen games do extra maths to generate pointers -- as I noted in one of your earlier links then these sorts of games are seen from time to time on the DS, another one of those being Touch Detective which did a shift (effectively multiplies a binary number) to get the final result, I discovering that by finding a known format first and figuring out what it corresponded to in the header.

I don't know if Ace Attorney Investigations will be this -- that was a fairly late game compared to this and also from a different company (Atlus vs Capcom). While possible it is some middleware I would bet more heavily on it being the "just need a name" picked the same as calling it .bin for the extension.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Sicklyboy @ Sicklyboy:
    Walk into his office
  • Sicklyboy @ Sicklyboy:
    Take a shit on his desk
    +1
  • Sicklyboy @ Sicklyboy:
    Refuse to elaborate
  • Sicklyboy @ Sicklyboy:
    Leave
  • Sicklyboy @ Sicklyboy:
    I'm fortunate to have had some managers over the years who I've straight up told to go fuck themselves, and not get in trouble for it. Help that I've been on the receiving end of that as well lmao
  • BigOnYa @ BigOnYa:
    Agreed, you can tell him you quit when you see him in court, (For defecation on property, charges)
  • K3Nv2 @ K3Nv2:
    There's a difference in a abusive management rather than one drilling into you for messing up
  • Sicklyboy @ Sicklyboy:
    Told my last boss that I was resigning and he was confused and asked if I was serious 😭🤣
  • K3Nv2 @ K3Nv2:
    My last boss got investigated for racial slurs and guess what happened to him
  • BigOnYa @ BigOnYa:
    I luckily haven't had a boss in over 20 years, (independent contractor) but the people I do work for, it's pretty much like they my bosses, and yea some can be assholes. But there has been many jobs I've walked off and mailed they're checks back to them.
  • K3Nv2 @ K3Nv2:
    Bosses should yell at workers for mess ups they just need to know the difference in abuse and punishment
  • BigOnYa @ BigOnYa:
    I don't abuse or curse at my employess, I feel like waving the gun around gets the point across just fine.
  • K3Nv2 @ K3Nv2:
    A boss is basically a glorified baby sitter
    +1
  • K3Nv2 @ K3Nv2:
    I respect one's that tells someone what to do clearly, warn them when they mess up and actually put work in with a crew
    +1
  • Sicklyboy @ Sicklyboy:
    That's how all of my last managers have been in this job and my last one. Last time I had a manager where I was being micromanaged to hell and back was over a decade ago when I worked retail
  • Sicklyboy @ Sicklyboy:
    My managers nowadays are perfectly fine assigning me a project and just checking in once every week or two
  • K3Nv2 @ K3Nv2:
    I had to micromanage the managers
  • Sicklyboy @ Sicklyboy:
    At my last job I (as an individual contributor, not a manager or supervisor or anything) used to be the one to tell my manager when I was traveling for work "hey I'm gonna be out of office between x and y dates, I got something on the other side of the country I'm gonna go work on"
  • Sicklyboy @ Sicklyboy:
    Which was not the normal dynamic for that role lmao
  • Sicklyboy @ Sicklyboy:
    Don't get to travel for my current job :(
  • K3Nv2 @ K3Nv2:
    Had me started working 10 days in a row with different days off after that I was like no
  • Sicklyboy @ Sicklyboy:
    On the bright side, I also don't even have to leave my house for my current job, so... could be worse
  • K3Nv2 @ K3Nv2:
    Some of the shift workers were so bad it held us up from 10pm to 10am
  • wolffangalchemist @ wolffangalchemist:
    coming to the painful realization backing up my ps2's hdd to swap in a sata ssd, i need a faster more modern way to interface with old ide hard drives than using hdlgmanclient or ftp over network.
  • Sicklyboy @ Sicklyboy:
    NIC is only 10/100 right?
    Sicklyboy @ Sicklyboy: NIC is only 10/100 right?