ROM Hack [Release]A darc tool for Nintendo3DS

LITTOMA

Well-Known Member
OP
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
31
XP
362
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,572
Trophies
3
Age
37
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
7,240
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
56
XP
121
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
31
XP
362
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,572
Trophies
3
Age
37
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
7,240
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,186
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
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, you are still lying
  • BigOnYa @ BigOnYa:
    No I am not. You are part of our community now. We tease sometimes, you and everybody, but that only means we love you. :wub:
    +2
  • SylverReZ @ SylverReZ:
    BigOnYa's right y'know.
    +2
  • SylverReZ @ SylverReZ:
    I understand you not getting the feeling of not understanding sarcasm or jokes at times.
    +1
  • SylverReZ @ SylverReZ:
    Just have a laugh and everyone is happy, like me. :D
    +2
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I do laugh sometimes but Im still depressed
  • SylverReZ @ SylverReZ:
    @Xdqwerty, A lot of teens do feel depressed at that age, when you grow older you'll start to get out of that stage.
  • SylverReZ @ SylverReZ:
    Just make sure you try to balance yourself, find ways to go without the internet and do other things.
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I don't think i'll ever get proper help ever
  • SylverReZ @ SylverReZ:
    That's up to you or your parents to make that decision, not mine.
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I never said it was yours
  • K3Nv2 @ K3Nv2:
    It's more so about taking the internet too seriously you gotta balance personal details off of it more often could do more harm than good
    +3
  • SylverReZ @ SylverReZ:
    I agree.
  • Xdqwerty @ Xdqwerty:
    Ok I have to sleep, it's too late
  • Xdqwerty @ Xdqwerty:
    Good night
    +1
  • SylverReZ @ SylverReZ:
    The internet is different to what it is in real life.
    +1
  • SylverReZ @ SylverReZ:
    You just got to be extremely careful with what you give out.
    +1
  • Xdqwerty @ Xdqwerty:
    I should stop going to sleep this late when being at my dad's house...
  • K3Nv2 @ K3Nv2:
    It's true you can get laid on the internet but don't be like psi and let every transit know your home address
    +1
  • BigOnYa @ BigOnYa:
    Does he happen to have a cable tv box with a key slot on the back of it?
  • K3Nv2 @ K3Nv2:
    Got some of these today yah good good Deutsche Kche Doppel Keks https://www.instacart.com/products/19763204
    +1
  • SylverReZ @ SylverReZ:
    @K3Nv2, I've ordered Maryland Triple Choc cookies, they're actually very good.
    SylverReZ @ SylverReZ: @K3Nv2, I've ordered Maryland Triple Choc cookies, they're actually very good.