ROM Hack .arc File extension

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
I've unpacked Time Hollow and found out that almost everything is packed in .arc-files (archives). I'm wondering if it exists any tools to extract the files from the archive, or if it at least exists somekind of reference/documentation?

Now, before you say "Use NARCTool" I would like to say that this kind of .arc-format isn't the same as the other .arc-format for DS. I've tried to use NARCTool, but without any luck. I've also tried to use some tools made for the GC/Wii .arc-format, but (as I excepted) they didn't work either. Well, if there's no reference/documentation nor tools to extract the archive, please help me find out how to extract this kind of .arc-files. I've already "researched" a little by myself. This is what I've come up with so far:

Reference/Documentation (Not complete and not sure that it's correct):
Code:
OffsetÂÂÂÂÂÂÂÂSize ÂÂÂÂDescription
0x00000000ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂ"Magic ID"ÂÂÂÂÂÂÂÂ// Always "ARCH"
0x00000004ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂNo. of Files
0x00000008ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂName Table Offset
0x0000000cÂÂÂÂ0x4ÂÂÂÂÂÂÂÂINFO-OffsetÂÂÂÂ// Not sure if this is part is called INFO, but that's what I call it for now
0x00000010ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂFILE-OffsetÂÂÂÂ
0x00000014ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂHEADER-size (in bytes)
0x00000020ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂFile size (?)
0x00000024ÂÂÂÂ0x4ÂÂÂÂÂÂÂÂNo. of Files (again?)

And here is a small dump from the program I made to read the .arc-files:
Code:
D00_00_00.arcÂÂÂÂ // Found in data\bg\digging
ARCH
11
32
208
384
432
176
11
// This is NOT in Hex

You can find the .arc-files in Time Hollow. Almost everything is in .arc-archives.

All help is appreciated! Thanks in advance!

[EDIT] Updated the "reference". Please help me complete it!
[EDIT 2] Thanks to Barubary for his help finding out everything about the format!
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Sorry for double posting, but I really want/need help... I want help with finding out if the file data is compressed (which I belive it is) and what kind of compression method that's used (maybe somekind of LZ-compression?). I hope someone can help me. I really want the files in these archives. This is the first time I'm trying to something like this. I mean, understand a file format, make the reference myself and so on. Please, ALL help is appreciated!
 

DarthNemesis

Well-Known Member
Member
Joined
Feb 19, 2008
Messages
1,210
Trophies
0
XP
260
Country
United States
LZ-compressed files can be identified by a starting byte of 0x10 or 0x11 followed by a 3 byte length and a flag byte (the first one should always be 00) before the actual file data begins. If you see a signature at the very start of the file rather than 5 bytes in, it's not likely to be compressed (but if it's an archive, the individual files inside it could still be compressed once you've extracted them).
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Hm... Alright... I think I got that. So the archives are probably not compressed (if I've understood the last part of your post correctly), since the first bytes in the whole archive are ARCH (HEX: 41 52 43 48). Well, I've probably misunderstood what you said, but hopefully the files aren't compressed. (It will be much easier that way, I think)
 

Barubary

Active Member
Newcomer
Joined
Feb 27, 2009
Messages
28
Trophies
0
Website
github.com
XP
143
Country
United States
Indeed, the archives themselves are not compressed, but the files inside are (or otherwise encrypted).


This seems to be the format of the ARCH-files;
Code:
typedef struct {
char[4] magicHeader; // 'ARCH'
u32 numFiles;
u32 nameTableOffset;
u32 fatOffset;
u32 nameIndexOffset;
u32 dataOffset;
} ARCHHeader

typedef struct {
u32 sectionSize;
u32 numNames; // practically always the same as numFiles
char** names; // 'numNames' 0-terminated strings
} NameTable

typedef struct {
u32 fileLength;
u32 unknown1; // flags? seem to be (almost) the same per filetype
u32 fileStart; // relative to dataStart
u16 nameOffset; // offset of name in NameTable. relative to start of NameTable section
u16 unknown2; // ??? constant 1? amount of similar files directly following afterwards perhaps?
} FileAllocation

typedef struct {
FileAllocation[numFiles] fat;
} FileAllocationTable

typedef struct {
u16 index;
u16 nameOffset;
} NameIndexEntry
// from what I've seen, this section has little added value. It seems to bind file numbers with their names, but that's already done in the FAT.
// the 'index'th FileAllocation in the FAT has the same nameOffset as defined here

typedef struct {
NameIndexEntry[numFiles] nit;
} NameIndexTable // (I'm just calling it something that sounds like what the section seems to be)
However, I've no idea of the compression/encryption technique used in the files inside.
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Wow! Thanks a lot Barubary! This will be VERY useful! Thank you! I got stuck at the FILE-part. I could only figure out the HEADER (almost)...

[EDIT] Do you think I can use NARCTool's source when I make the ARCTool? I mean, just use the functions and stuff, but changing the header-file (and the other things that have to be changed). Or is it possibly easier to make the whole thing from scratch? I'm planning to make it in Ruby.
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Sorry for bringing my "old" topic back up, but I just want to ask you (again...) for some help.

I'm working on a utility that'll be able to extraxt and (hopefully) pack .arc-files. What I want help with is the few things that are still unknown about the ARCH-format. As you can see in Barubary's code, there's some things that we don't know what they are for and what they mean. I hope someone can help me find out what these things are and tell me. It may be something that's needed to extract/pack the .arc-files.

Thanks a lot in advance! I really appreciate all your help! Thanks for all the help you've already given me!

[EDIT] I'm almost there! I hope it isn't much left to do before I'm able to extract the .arc-files. I just have to read the data and save it as files.
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Alright, sorry for triple-posting... Really, sorry. I just want to report my progress.

I'm now able to extract the files from the archives, but now I've to find out what kind of compression-method that's used.

Again, I would like to ask for your assistance. I want to know what compression-method that's used, and to help you a bit I'll post some files here for you.

Download link (extracted_files.rar)

I hope you're able to help me. It's the last thing I need to finish the extract-function.
 

Marvin Dalkiri

Member
Newcomer
Joined
Mar 1, 2009
Messages
10
Trophies
0
Website
www.romhacking.trd.br
XP
30
Country
Brazil
Well, I've checked your files, and as far as I know, these aren't any of the DS standard compressions.

However, these could be some sort of flagless LZSS, or something like that.

I'm gonna check again these files later when I get home, and see what I can find uot about them.
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Thanks a lot! Just hearing that you've checked the files are great news for me! I'm also checking them. I comparing the files with other files with the same extensions to see if I can figure something out.

Oh, something I forgot to say earlier. It seems like the 4 first bytes are (almost) always FE 7F. Mabye that can help anything.
 

Gryphon93

Well-Known Member
OP
Member
Joined
Nov 30, 2008
Messages
145
Trophies
0
XP
252
Country
Nice! Thanks for the information, Darth Nemesis. I really appreciate it. As soon as I know what kind of compression method that's used, I'll be able to finish the extract-function and begin to work on the packing-function.
 

Xerawels

New Member
Newbie
Joined
Oct 9, 2009
Messages
1
Trophies
0
XP
33
Country
France
Hey Gryphon ! Do your researches advance ? Me too, I would really like to be able to change the .arc files of Time Hollow !
 

azure0wind

Well-Known Member
Member
Joined
May 24, 2009
Messages
937
Trophies
1
XP
345
Country
Indonesia
Xerawels said:
Hey Gryphon ! Do your researches advance ? Me too, I would really like to be able to change the .arc files of Time Hollow !
off topic
dry.gif

anyway now, what do you want to help with?
rolleyes.gif
 

Februarysn0w

Well-Known Member
Member
Joined
Oct 31, 2014
Messages
1,206
Trophies
0
Age
36
XP
836
Country
Japan
What about ARC files from 3Ds carts like Super street fighter 4 3D edition i decrypt the ROM but i can open the ARC extension for some mods ^^ please help me :wacko:

Try this ARC tool. I successfully unpacked Arc files that come with MH4G (JPN). Just drag and drop your file to "pc-re6-extract.bat" or "pc-re5-extract.bat".
 

Attachments

  • ARCtool.rar
    120.6 KB · Views: 801

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @OctoAori20, Cool. Same here.