Guide to rebuilding NARC files from scratch.

Discussion in 'NDS - ROM Hacking and Translations' started by FAST6191, Jul 12, 2007.

Jul 12, 2007
  1. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,747
    Country:
    United Kingdom
    I was asked for a guide to rebuilding NARC files and rather than just PM a response I figured someone else might be interested. I will assume you are familiar with hexadecimal and a hex editor although not necessarily with the ARM/DS/GBA method of number handling. Natrium42's narctool does have a build option but manual is always nice to know (especially for when narctool comes across something it does not agree with):
    narctool 0.1-p - by natrium42, modifications by Pipian
    Tool for working with NARC and compressed NARC files (CARC files).

    Usage:
    narctool d
    decompress CARC file into NARC file

    narctool c
    compress NARC file into CARC file

    narctool u
    unpack NARC file into directory

    narctool p
    pack directory into NARC file


    The following post should be considered unfinished as I have to include exceptions (nameless files -> pokemon) and want to add some more on (sub)directories.

    As well as my own personal stuff I have referenced tahaxan NARC file description , pipian's ierukana and narctool's (original and Pipian's modified) source as well, if you find a point needs more clarification might I suggest you have a look there (sometimes I find stuff just needs phrasing differently to be understandable to me).

    Rebuilding from scratch is a tough one, I will be using award.narc (uncompressed with lzsstool from Euro mario karts award.carc) as a demo. The file is all available in bits and pieces from the following post but here is the first 150 "lines"
    CODE00000000 4E41 5243 FEFF 0001 48C8 0200 1000 0300 NARC....H.......
    00000010 4254 4146 3C00 0000 0600 0000 0000 0000 BTAF
     
    Sliter likes this.
  2. JPH

    Banned JPH Banned

    Joined:
    Jul 11, 2006
    Messages:
    6,892
    Country:
    United States
    ...hrm?
     
  3. ksonic1055

    Newcomer ksonic1055 Member

    Joined:
    Jul 10, 2007
    Messages:
    45
    Country:
    United States
    I am having trouble combining all of the files. Also, there are subdirectories that need to be included. And after the files are all together, how will I know where to add all of this stuff you refer to? Ive read this through several times and it is still unclear. Is it possible for a step by step explanation that includes more information? Something like:

    Open cmd and use copy /b to consolidate all files

    open new file with hex editor and go to...and here add... ect


    I think that would help everyone who is just beginning with this stuff to understand what is being done.


    thanks for all your help.
     
  4. ksonic1055

    Newcomer ksonic1055 Member

    Joined:
    Jul 10, 2007
    Messages:
    45
    Country:
    United States
    Never mind. I have gotten all of the files combined to one, however some are supposed to be in different subdirectories. Will this be set up later?

    Ill keep trying to figure out your directions.
     
  5. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,747
    Country:
    United Kingdom
    The subdirectories are purely referenced in the BTNF section (it is the bit that I am adding in as we speak), you need all the files you are to copy /b together in the same directory (well you could add a subdirectory in the copy command but that would be making things more complex than perhaps they should).
     
  6. ksonic1055

    Newcomer ksonic1055 Member

    Joined:
    Jul 10, 2007
    Messages:
    45
    Country:
    United States
    ok perfect then. I have all of them put together. Now i need to add the NARC, BTAF, BTNF, and GMIF sections right?

    Those go before the files right? So how do i bump all of the file data downwards to make room at the top of the file i am creating? (talking about hex editor as u may have guessed)


    thanks
     
  7. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,747
    Country:
    United Kingdom
    You could use copy /b again but most hex editors will have an insert X amount of space or even allow you to paste it in there. Just make sure to press the insert key (with page down and such) if it decides to overwrite in something like hex workshop.

    Some hex editors I use:
    general: hex workshop, x ways forensics and xvi32 and today I added Tiny Hexer to the list

    small: virtual dub inbuilt (not any use for rom hacking really), notepad++ inbuilt (I use this for turning end of lines into standard characters and stuff).

    rom hacking:
    crystaltile2, an exceptional Chinese app. It would be in English but I have not got it to build yet (MS Visual studio 2003 © with MFC is what it needs):
    http://gbatemp.net/index.php?showtopic=53383
    Take your pick of the ones here:
    http://www.romhacking.net/?category=13&Pla...Go&title=&desc=
    Hexposure, translhextion WindHex32 are definitely worth a look (try getting a custom character set on hex workshop an you will see why)
     
  8. ksonic1055

    Newcomer ksonic1055 Member

    Joined:
    Jul 10, 2007
    Messages:
    45
    Country:
    United States
    Just curious here... Are you planning on building a Narc unpacker/packer? That would be a great utility...
     
  9. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,747
    Country:
    United Kingdom
    I do not often build many tools for stuff that I do.
    I could try and use what C I have to improve narctool though.

    You saw crystaltile2 I take it as well, that looks like something could happen.
     
  10. ksonic1055

    Newcomer ksonic1055 Member

    Joined:
    Jul 10, 2007
    Messages:
    45
    Country:
    United States
    If you can fix narctool's unpack to directory, and pack to .narc functions it would be amazing. I have a bunch of directories that i need converted to .narc... the process described above is time consuming...

    Yes i think there will be some jumps in the near future in crystaltile2 soon, but when u said it is a recompile, did u mean it could convert a directory to a narc?
     

Share This Page