Register - Login
Views: 99795549
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 05:28:46 AM
Jul - General Game/ROM Hacking - NDS Rom Decompression/Recompression New poll - New thread - New reply
Next newer thread | Next older thread
origamiguy
User
Level: 11


Posts: 7/18
EXP: 5156
For next: 829

Since: 11-08-09


Since last post: 11.4 years
Last activity: 61 days

Posted on 11-08-09 03:25:00 PM Link | Quote
I am looking for some code snippets for NDS rom decompression/recompression/extraction/insertion, preferably in C# although i can do some VB as well.

Any help would be greatly appreciated (Treeki, i'm looking at you....).

____________________
NASA spent $12 billion making pens that work upside down and in zero gravity. The Russians used pencils.
messiaen
Catgirl
Level: 68


Posts: 691/1085
EXP: 2596319
For next: 132481

Since: 11-20-07


Since last post: 8.1 years
Last activity: 7.2 years

Posted on 11-08-09 07:44:16 PM Link | Quote
NSMB editor source.
origamiguy
User
Level: 11


Posts: 8/18
EXP: 5156
For next: 829

Since: 11-08-09


Since last post: 11.4 years
Last activity: 61 days

Posted on 11-08-09 08:56:17 PM Link | Quote
a few questions:
Is it possible to create a .nds file from a filesystem on a computer?
How does a .nds file define the folder structure and the offsets to each file?
Where are the Icon, Name, and Developer details stored?


____________________
NASA spent $12 billion making pens that work upside down and in zero gravity. The Russians used pencils.
dirbaio
For future reference, "Responsible disclosure" isn't "acting like a douche about an exploit and demanding compensation".
Level: NaN


Posts: 159/-1288
EXP: NaN
For next: 0

Since: 07-28-09

From: Spain

Since last post: 10.8 years
Last activity: 9.9 years

Posted on 11-09-09 06:32:37 PM Link | Quote
http://nocash.emubase.de/gbatek.htm

(under ds cartridges/encription/firmware)

Look at the NDS Cartridge header. It specifies offsets for the binaries and the file system tables.
Look at NitroROM file system to see how the file system works.
origamiguy
User
Level: 11


Posts: 9/18
EXP: 5156
For next: 829

Since: 11-08-09


Since last post: 11.4 years
Last activity: 61 days

Posted on 11-09-09 10:41:41 PM Link | Quote

Wow.
Thanks!

____________________
NASA spent $12 billion making pens that work upside down and in zero gravity. The Russians used pencils.
dirbaio
For future reference, "Responsible disclosure" isn't "acting like a douche about an exploit and demanding compensation".
Level: NaN


Posts: 160/-1288
EXP: NaN
For next: 0

Since: 07-28-09

From: Spain

Since last post: 10.8 years
Last activity: 9.9 years

Posted on 11-10-09 07:09:11 PM Link | Quote
hmm i forgot to tell you this:

Files in the filesystem have a name but also an ID. Some games use the name to load files and others use the ID (like NSMB). There are tools that let you decompress the whole filesystem and then compress it back, but they dont keep the original file ids, so the games that load the file ids wont work with that method.

And another thing: Some games use LZ77 compression to compress files, usually graphics or 3d data... You can have a loook at the source of NSMBEditor for code to compress/decompress it, i think in FileSystem.cs

good luck
origamiguy
User
Level: 11


Posts: 10/18
EXP: 5156
For next: 829

Since: 11-08-09


Since last post: 11.4 years
Last activity: 61 days

Posted on 11-10-09 08:09:46 PM (last edited by origamiguy at 11-10-09 05:13 PM) Link | Quote
Originally posted by dirbaio
Files in the filesystem have a name but also an ID. .... There are tools that let you decompress the whole filesystem and then compress it back, but they dont keep the original file ids...


I have made note of this, my program will create a "project" file, which keeps track of every file and the associated ID number.

I have written code to extract the ENTIRE file-system to a location on the hard-drive.
I also wrote code to extract the game's icon completely by myself, simply by reading that (incredibly useful) documentation and poking around in a hex editor.

Also, some advice to anyone doing this kind of thing:
If you're gonna use hex and decimal in the same program, make sure you don't get them confused. I accidentally read 20 bytes when I actually wanted 32 (20 in hex, notated as 0x20 or 20h), and broke the whole program.

[/rant]

____________________
NASA spent $12 billion making pens that work upside down and in zero gravity. The Russians used pencils.
Next newer thread | Next older thread
Jul - General Game/ROM Hacking - NDS Rom Decompression/Recompression New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

29 database queries, 3 query cache hits.
Query execution time: 0.075310 seconds
Script execution time: 0.010400 seconds
Total render time: 0.085710 seconds