Homebrew [RELEASE] NDSFactory - unpack and repack NDS roms

Luca91

Well-Known Member
OP
Newcomer
Joined
Sep 13, 2019
Messages
67
Trophies
0
Age
32
XP
860
Country
Italy
Hello,
I was interested in getting code execution before the game's own NitroMain(), but my final ARM9 binary was bigger than the original one, and eventually was overlapping with the ARM7 binary.
Instead to try all the funcky ways to compress my code (that anyway is not a viable solution in most of the cases since the padding between ARM9 and ARM7 binaries is extremely small), I decided to write a tool to help me (and maybe other roms hackers/reverse engineers) to unpack and repack nds roms.

So, this is NDSFactory. With this tool you can unpack every sections of nds roms (but be aware that roms with OVERLAYS aren't supported right now!!!) and then repack them back (after editing them if you want).
Using this tool, you can set custom address and size of your edited sections and then it will rebuild a new rom.
Be aware that some general rom layout knowlege is required before using it. For example if the fat_data.bin (the FAT files) address is different, you have to patch your fat.bin using the 3rd tab.

I'd like to post a pic, but sadly I haven't the right post counter :/

If you want to contribute, you are very welcome, there is still a lot of things to do (checks, fat contents decoding, fat rebuilding, overlay support, a nice icon, and ofc bugs to fix!)


GitHub repo: https://github.com/Luca1991/NDSFactory


Thank you, and I'll be watching this thread for any suggestions/questions :)
 
Last edited by Luca91,

CMDreamer

Well-Known Member
Member
Joined
Oct 29, 2014
Messages
1,730
Trophies
1
Age
39
XP
3,600
Country
Mexico
This has so many posibilities!!!

On the wrong hands though... :wtf:

Can the NDS file be checked against an "official hash" to know they have been tampered with?

Thank you for this great tool!!!
 

Luca91

Well-Known Member
OP
Newcomer
Joined
Sep 13, 2019
Messages
67
Trophies
0
Age
32
XP
860
Country
Italy
This has so many posibilities!!!

On the wrong hands though... :wtf:

Can the NDS file be checked against an "official hash" to know they have been tampered with?

Thank you for this great tool!!!

I honestly don't think that this is useful to malware writers, if this is what you are thinking by "wrong hands". For at least three reasons:
1) NDS format is greatly documented (since 2005 IIRC)
2) A malware writer can easily write his/her own tools to unpack and repack nds roms (and also to apply patches to the fat)
3) I haven't done any research, but I think that there might be other tools like this one already released 14 years ago (I decided to write my own for fun)

Of course any nds roms can be checked against its official hash (the hash of a clean/untouched dump), you are welcome to write a function to calc and display the md5 of the final patched rom, and send me a PR on github. I'll be more than happy to merge your work :)


tl;dr: i don't think that malware writers have any advantages using this tool. Also, we have perfectly working emus nowadays: test your software using one of them, before running it on a real console.
 
Last edited by Luca91,

Luca91

Well-Known Member
OP
Newcomer
Joined
Sep 13, 2019
Messages
67
Trophies
0
Age
32
XP
860
Country
Italy
Hi all,
from time to time I update this project. Here is a list of features added in the last couple of months:
- New UI: new scrollable UI for both packer and unpacker view. You can resize the window now and use this app on smaller screens.
- maOS version released
- Tested and working on ARM64 CPU (Raspberry Pi with QTAnywhere)
- Build system changed: switched to CMake
- Various workflow updates: added a CI to autobuild, added build version on each release etc.
- Improved stability (TM)

Planned features:
- Fat files decoding
- Fat_data creation from a set of files
- Support roms with overlay
 

Julie_Pilgrim

Secretly three raccoons in a trench coat
Member
Joined
Sep 2, 2020
Messages
2,647
Trophies
3
Location
(REDACTED)
Website
zoey-on-github.github.io
XP
1,940
Country
United States
Hi all,
from time to time I update this project. Here is a list of features added in the last couple of months:
- New UI: new scrollable UI for both packer and unpacker view. You can resize the window now and use this app on smaller screens.
- maOS version released
- Tested and working on ARM64 CPU (Raspberry Pi with QTAnywhere)
- Build system changed: switched to CMake
- Various workflow updates: added a CI to autobuild, added build version on each release etc.
- Improved stability (TM)

Planned features:
- Fat files decoding
- Fat_data creation from a set of files
- Support roms with overlay
Nice work!
 
  • Like
Reactions: banjo2

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    Yes uremum didn't tell me about her transition and begged me to make it my background
  • K3Nv2 @ K3Nv2:
    I couldn't hurt his or hers feelings
  • TechieSaru tempBOT:
    TechieSaru has joined the room.
  • SylverReZ @ SylverReZ:
    @K3Nv2, Don't ask him where to get lemonade. ;)
  • K3Nv2 @ K3Nv2:
    Psi fondles big red lemons to make lemonaides
    +1
  • K3Nv2 @ K3Nv2:
    Always wanting my lemons he can't have them
  • K3Nv2 @ K3Nv2:
    Jeb stole bigonyas pants
    +1
  • BigOnYa @ BigOnYa:
    Jokes on you, I don't have any on.... "Cause I'm free.... Free ballin'"
  • SylverReZ @ SylverReZ:
    @BigOnYa, Sounds like you and AncientBoi get along together TOO well.
    +1
  • BigOnYa @ BigOnYa:
    Thank God we are 20 states away from each tho. Kenny's almost neighbors with him.
  • K3Nv2 @ K3Nv2:
    I live in kc you dingus
  • BigOnYa @ BigOnYa:
    Ok still closer to him than me, perv boi
  • BigOnYa @ BigOnYa:
    Not to mention you guys share the same last name.
  • K3Nv2 @ K3Nv2:
    I thought you were Mrs.bigboi
    +2
  • BigOnYa @ BigOnYa:
    Nuh twice divorced, I took my maiden name
  • K3Nv2 @ K3Nv2:
    Mrs. bigancientboi?
    +2
  • BigOnYa @ BigOnYa:
    Ms. now, We divorced.
  • K3Nv2 @ K3Nv2:
    I'd keep the Mrs. He's got more years on you
  • BigOnYa @ BigOnYa:
    The end of this game, in the house, is like Texas chainsaw massacre house, is crazy. I just gotta find Chris n kill him.
  • BigOnYa @ BigOnYa:
    Damn it, Chris was not the original werewolf.
  • K3Nv2 @ K3Nv2:
    I didn't think I'd like these dumb xreals but being able to use my phone while having a big screen floating about is pretty cool
    +1
  • duskfall @ duskfall:
    :yaysp:these emojis are great
    duskfall @ duskfall: :yaysp:these emojis are great