ROM Hack [Release]A darc tool for Nintendo3DS

LITTOMA

Well-Known Member
OP
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
This is a tool for modifying data-archive(darc) files using in Nintendo3DS games.

Usage:
darc.py [options] [object]

PLATFORM:
Python 2.7:https://www.python.org/downloads/release/python-279/
compression only on WindowsXP+ .

options:
  • -u ...... Unpack specified darc
  • -p ...... Pack up specified folder
  • -i ...... Inject file(s) to specified darc
  • -o ...... Set out put name
  • -d ...... Set work directory
You can use '-d' option to contain multiple objects in a directory.

GitHub: https://github.com/LITTOMA/DARCTool

This tool hasn't been tested completely, so it may not work in some cases, please tell me while errors occur.
Thanks Smariter for help!

UPDATE:

By using CUE's lzx tool, this darc tool support compress/decompress darc files now.
You can use these following commands to compress darc files(decompress is automatically):
  • -evb .... VRAM compatible, big-endian (LZ11)
  • -ewb .... WRAM compatbile, big-endian (LZ11)
  • -evl .... VRAM compatible, little-endian (LZ40)
  • -ewl .... WRAM compatbile, little-endian (LZ40)
You should place the lzx.exe in 'C:\Windows\' to make drag&drop unpacking available.

UPDATE 2:

Add inject feature,Modified files can work in game now.

inject usage:
darc.py -i [darc file] [file to inject]
 

ChrisX930

Banned!
Banned
Joined
Sep 3, 2013
Messages
788
Trophies
0
Location
Germany
XP
458
Country
Gambia, The
Thank you man! :D

I've rebuilt a darc-file and I'll try to rebuild the rom with the modified file today.
I just added a file to test this (left: repacked file, right: original file)
581fe1f033.jpg
 
  • Like
Reactions: Margen67

ChrisX930

Banned!
Banned
Joined
Sep 3, 2013
Messages
788
Trophies
0
Location
Germany
XP
458
Country
Gambia, The
Updated the file.
Took the original one, replaced one bclim-file (edited the original one), repacked the darc-file and rebuilt the romfs.
None of the images would be shown ingame, neither the unmodified ones in the repacked file nor the edited ones. :/
I just uploaded both (the original one and the modified one. hopefully you can find the reason.
puu.sh/h1LM6/66340b73fa.rar

There are two files in this rar-archive.
- The untouched darc-file "(original)TitleUpper.arc"
- The repacked darc-file "(repacked)TitleUpper.arc" which contains a modified bclim-file "03.bclim" in "timg"-folder.

Even If I just repack the darc-file, not all images would be shown. Before I replaced the bclim-file, only the 03.bclim-image was shown ingame.

It seems that something doesn't work well
 
  • Like
Reactions: Margen67

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,425
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,782
Country
United States
It appears this tool doesn't handle LZ compressed DARC archives. I had to manually decompress/recompress one when I tried this tool. (Would be nice if this tool had an option to handle this. It currently doesn't even recognize LZ compressed DARC files and the repacked ones it makes have to be recompressed for the application I wanted to use this for)

I attempted to modify a bclim inside the logo.bin file. (it's basically an LZ compressed DARC file). I repacked it correctly, but as soon as I attempt to use it, the app I tried it on would immediately show the "SD Card has been removed" message when I boot it. It may just be a limitation on how logo.bin should be modified. (perhaps there is other files that have to be modified to account for the altered image perhaps).

Could also be an issue with how this program is repacking the DARC or a general issue with how EveryFileExplorer saves new BCLIM files or the BCLIM files it makes are not compatible with logo.bin file configuration.
 
  • Like
Reactions: Margen67

ChrisX930

Banned!
Banned
Joined
Sep 3, 2013
Messages
788
Trophies
0
Location
Germany
XP
458
Country
Gambia, The
It appears this tool doesn't handle LZ compressed DARC archives.
It seems it is not only the compression-method. You could possibly compress/decompress this files with EFE (Tools->Compression).
I've a problem to use the repacked darc-file in Harvest Moon - A New Beginning.

- I unpacked the archive
- I repacked the archive without doing any changes on it
- I rebuilt the romfs with makeromfs
- only one (or two?) of all (6) Images was shown ingame.

There's probably a problem with the pyton code and some code is wrong/missing.
I'm not familiar with Pyton so I can't check the code for errors :/

EDIT:
The repacked file is a little bit smaller than the original one.
My original file has 988'712 bytes
My repacked file has 987'804 bytes
 
  • Like
Reactions: Margen67

Smariter

Active Member
Newcomer
Joined
Dec 23, 2014
Messages
29
Trophies
0
Age
55
XP
111
Country
- I unpacked the archive
- I repacked the archive without doing any changes on it
- I rebuilt the romfs with makeromfs
- only one (or two?) of all (6) Images was shown ingame.

There's probably a problem with the pyton code and some code is wrong/missing.
I'm not familiar with Pyton so I can't check the code for errors :/

EDIT:
The repacked file is a little bit smaller than the original one.
My original file has 988'712 bytes
My repacked file has 987'804 bytes

I think the reason is origin file store with padding, but the repacked one doesn't , so it can't show ingame. Unfortunately, the padding rule still a puzzle...:unsure:
 
  • Like
Reactions: Margen67

LITTOMA

Well-Known Member
OP
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
It appears this tool doesn't handle LZ compressed DARC archives. I had to manually decompress/recompress one when I tried this tool. (Would be nice if this tool had an option to handle this. It currently doesn't even recognize LZ compressed DARC files and the repacked ones it makes have to be recompressed for the application I wanted to use this for)

I attempted to modify a bclim inside the logo.bin file. (it's basically an LZ compressed DARC file). I repacked it correctly, but as soon as I attempt to use it, the app I tried it on would immediately show the "SD Card has been removed" message when I boot it. It may just be a limitation on how logo.bin should be modified. (perhaps there is other files that have to be modified to account for the altered image perhaps).

Could also be an issue with how this program is repacking the DARC or a general issue with how EveryFileExplorer saves new BCLIM files or the BCLIM files it makes are not compatible with logo.bin file configuration.

You should modify the logo's file header and hash store in the exefs header, read the document about ExeFS on 3DBrew for help.
 
  • Like
Reactions: Margen67

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,425
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,782
Country
United States
I would assume the hash in the ExeFS is built for me when I go to rebuild the rom? The exefs.bin file is never fed directly into makerom. It just builds a new one with the banner, icon, and code bin files when building a new rom.

Editing the exefs already in a built rom is a nogo unless it's not encrypted?. The logo.bin I import as a command with my makerom. I know the way I have it setup works because the stock logo.bin file works.

But the part where you said I need to alter the logo.bin header. That I was not aware I had to do. I can look into that next time I attempt a custom logo.
 
  • Like
Reactions: Margen67

ChrisX930

Banned!
Banned
Joined
Sep 3, 2013
Messages
788
Trophies
0
Location
Germany
XP
458
Country
Gambia, The
Okay, He sent me a modified darc-file for HM3D today.
It worked so he fixed the padding problem.

The weird thing is: He still doesn't updated his github...
that means, I can't create darc-files by myself x_x

Here's a Proof that the modified darc-file he sent me works ingame:
11150428_940871859277212_2911492801628774424_n.jpg

I uploaded a modified bclim-file here on gbatemp some days ago.
I removed the "A New Beginning" in the Logo for testing purposes
 

Helmax

Well-Known Member
Member
Joined
Feb 17, 2011
Messages
242
Trophies
1
XP
2,166
Country
United States
Looks like the github repo is updated, I pulled down the latest and there is an executable distribution of the python logic. I ran that to inject several files which then successfully unpacked, unlike last time.
Using the repack option (-p), he warns us it is not fully tested or working yet.

So I used the new option (-i) to inject [file] into [darc], and then afterwards unpacked to see if the modified files were there. They went into the rgiht places as well (subdirectories).
Building a new ROMFS right now adn testing my .3DS to see if it works correctly.
My goal here was a FONT swap, since my game has 6 font sizes, i wanted to use all the smallest font across to board to maximize word space (in english coming from japanese).

I'll let you guys know how it works out. Either way, lots of props to LITTOMA
 

ChrisX930

Banned!
Banned
Joined
Sep 3, 2013
Messages
788
Trophies
0
Location
Germany
XP
458
Country
Gambia, The
Looks like the github repo is updated, I pulled down the latest and there is an executable distribution of the python logic. I ran that to inject several files which then successfully unpacked, unlike last time.
Using the repack option (-p), he warns us it is not fully tested or working yet.

So I used the new option (-i) to inject [file] into [darc], and then afterwards unpacked to see if the modified files were there. They went into the rgiht places as well (subdirectories).
Building a new ROMFS right now adn testing my .3DS to see if it works correctly.
My goal here was a FONT swap, since my game has 6 font sizes, i wanted to use all the smallest font across to board to maximize word space (in english coming from japanese).

I'll let you guys know how it works out. Either way, lots of props to LITTOMA

Worked well for me, injected files into a darc-archive for HM3D. It works :)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Sonic Angel Knight @ Sonic Angel Knight: :ninja: