ROM Hack Unpacking an archive in a DS rom - .iear

fuzzy_cheez2

Member
OP
Newcomer
Joined
Jun 26, 2011
Messages
8
Trophies
0
XP
117
Country
United States
I'm trying to rip the sprites of a DS game called Sands of Destruction. All the graphics are stored in files with the extension ".iear". I am able to view the graphics in these using TiledGGD, but I read in a tutorial that this file is an archive which contains multiple NCBR and NCLR files. However, the tutorial did not explain how to unpack the archive. I was wondering if anyone could help me learn how to unpack these archives, as I do not know anything about how to do this.

-snip-
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,311
Country
United Kingdom
Seems to be a fairly standard archive format as far as I can tell
Starts with MAIN
F0 = 240 decimal and is the amount of files it contains.
At 10 hex there is JTBL and E0 01 in hex. Not sure what the latter means at this point.
Starting at 20 hex there is a list of file locations and file sizes (no padding that I can see) 32 bits for each (needing a flip naturally)
No file names in this archive that I can see unfortunately. I only used your link and did not check the game proper (sometimes there are files sitting alongside archives with names in but they are not important)
Files packed end to end. Edit- on second thoughts each file seems to have something random for 10 hex after the files and this is messing up some of the programs I try to view them with (crystaltile2 and tinke are having issues with some of the files). I will have to check further.
Unusually for the DS it does seem to end with ENDT and the rest of the 10 hex being 00 padded at 3F7FEO hex.

If you just want to rip it I can help extract that archive
Go to http://crackerscrap.com/ , click projects and get filecutter.
Copy and paste the spoiler at the end of the post into text file and save it with the extension .bat
Stick filecutter, the batch file and your 05.iear file in a directory and double click the batch file. 240 files should spring up with their correct extensions. As I had no file names I just used ascending numbers so I would guess 001.NCLR goes with 002.NANR, 003.NCBR and so forth but I did have a quick look and nothing appeared to be compressed within it and the palette might well hold for most if not all the files

gallery_32303_143_28875.png


Code:
filecutter 05.iear 592 001.NCLR -s 1952
filecutter 05.iear 304 002.NANR -s 2544
filecutter 05.iear 16448 003.NCBR -s 2848
filecutter 05.iear 304 004.NCER -s 19296
filecutter 05.iear 16448 005.NCGR -s 19600
filecutter 05.iear 1104 006.NANR -s 36048
filecutter 05.iear 94272 007.NCBR -s 37152
filecutter 05.iear 1120 008.NCER -s 131424
filecutter 05.iear 208 009.NANR -s 132544
filecutter 05.iear 208 010.NCER -s 132752
filecutter 05.iear 8256 011.NCGR -s 132960
filecutter 05.iear 272 012.NANR -s 141216
filecutter 05.iear 12352 013.NCBR -s 141488
filecutter 05.iear 256 014.NCER -s 153840
filecutter 05.iear 272 015.NANR -s 154096
filecutter 05.iear 16448 016.NCBR -s 154368
filecutter 05.iear 304 017.NCER -s 170816
filecutter 05.iear 16448 018.NCGR -s 171120
filecutter 05.iear 432 019.NANR -s 187568
filecutter 05.iear 24640 020.NCBR -s 188000
filecutter 05.iear 400 021.NCER -s 212640
filecutter 05.iear 176 022.NANR -s 213040
filecutter 05.iear 176 023.NCER -s 213216
filecutter 05.iear 4160 024.NCGR -s 213392
filecutter 05.iear 480 025.NANR -s 217552
filecutter 05.iear 36928 026.NCBR -s 218032
filecutter 05.iear 480 027.NCER -s 254960
filecutter 05.iear 384 028.NANR -s 255440
filecutter 05.iear 32832 029.NCBR -s 255824
filecutter 05.iear 432 030.NCER -s 288656
filecutter 05.iear 432 031.NANR -s 289088
filecutter 05.iear 49216 032.NCBR -s 289520
filecutter 05.iear 592 033.NCER -s 338736
filecutter 05.iear 368 034.NANR -s 339328
filecutter 05.iear 45120 035.NCBR -s 339696
filecutter 05.iear 544 036.NCER -s 384816
filecutter 05.iear 5104 037.NANR -s 385360
filecutter 05.iear 192576 038.NCBR -s 390464
filecutter 05.iear 2128 039.NCER -s 583040
filecutter 05.iear 880 040.NANR -s 585168
filecutter 05.iear 61504 041.NCBR -s 586048
filecutter 05.iear 720 042.NCER -s 647552
filecutter 05.iear 61504 043.NCGR -s 648272
filecutter 05.iear 992 044.NANR -s 709776
filecutter 05.iear 102464 045.NCBR -s 710768
filecutter 05.iear 1120 046.NCER -s 813232
filecutter 05.iear 288 047.NANR -s 814352
filecutter 05.iear 28736 048.NCBR -s 814640
filecutter 05.iear 416 049.NCER -s 843376
filecutter 05.iear 28736 050.NCGR -s 843792
filecutter 05.iear 336 051.NANR -s 872528
filecutter 05.iear 28736 052.NCBR -s 872864
filecutter 05.iear 416 053.NCER -s 901600
filecutter 05.iear 1104 054.NANR -s 902016
filecutter 05.iear 960 055.NCER -s 903120
filecutter 05.iear 86080 056.NCGR -s 904080
filecutter 05.iear 1632 057.NANR -s 990160
filecutter 05.iear 57408 058.NCBR -s 991792
filecutter 05.iear 656 059.NCER -s 1049200
filecutter 05.iear 3744 060.NANR -s 1049856
filecutter 05.iear 90432 061.NCBR -s 1053600
filecutter 05.iear 1008 062.NCER -s 1144032
filecutter 05.iear 2784 063.NANR -s 1145040
filecutter 05.iear 90432 064.NCBR -s 1147824
filecutter 05.iear 1008 065.NCER -s 1238256
filecutter 05.iear 4240 066.NANR -s 1239264
filecutter 05.iear 90432 067.NCBR -s 1243504
filecutter 05.iear 1024 068.NCER -s 1333936
filecutter 05.iear 1168 069.NANR -s 1334960
filecutter 05.iear 32832 070.NCBR -s 1336128
filecutter 05.iear 464 071.NCER -s 1368960
filecutter 05.iear 1168 072.NANR -s 1369424
filecutter 05.iear 33088 073.NCBR -s 1370592
filecutter 05.iear 480 074.NCER -s 1403680
filecutter 05.iear 1600 075.NANR -s 1404160
filecutter 05.iear 33088 076.NCBR -s 1405760
filecutter 05.iear 480 077.NCER -s 1438848
filecutter 05.iear 272 078.NANR -s 1439328
filecutter 05.iear 20544 079.NCBR -s 1439600
filecutter 05.iear 320 080.NCER -s 1460144
filecutter 05.iear 82800 081.NANR -s 1460464
filecutter 05.iear 61760 082.NCBR -s 1543264
filecutter 05.iear 1472 083.NCER -s 1605024
filecutter 05.iear 240 084.NANR -s 1606496
filecutter 05.iear 16448 085.NCBR -s 1606736
filecutter 05.iear 288 086.NCER -s 1623184
filecutter 05.iear 8256 087.NCGR -s 1623472
filecutter 05.iear 224 088.NANR -s 1631728
filecutter 05.iear 16448 089.NCBR -s 1631952
filecutter 05.iear 288 090.NCER -s 1648400
filecutter 05.iear 528 091.NCLR -s 1648688
filecutter 05.iear 176 092.NANR -s 1649216
filecutter 05.iear 320 093.NCBR -s 1649392
filecutter 05.iear 160 094.NCER -s 1649712
filecutter 05.iear 592 095.NCLR -s 1649872
filecutter 05.iear 304 096.NANR -s 1650464
filecutter 05.iear 16448 097.NCBR -s 1650768
filecutter 05.iear 304 098.NCER -s 1667216
filecutter 05.iear 16448 099.NCGR -s 1667520
filecutter 05.iear 1072 100.NANR -s 1683968
filecutter 05.iear 94272 101.NCBR -s 1685040
filecutter 05.iear 1120 102.NCER -s 1779312
filecutter 05.iear 208 103.NANR -s 1780432
filecutter 05.iear 208 104.NCER -s 1780640
filecutter 05.iear 8256 105.NCGR -s 1780848
filecutter 05.iear 272 106.NANR -s 1789104
filecutter 05.iear 12352 107.NCBR -s 1789376
filecutter 05.iear 256 108.NCER -s 1801728
filecutter 05.iear 272 109.NANR -s 1801984
filecutter 05.iear 16448 110.NCBR -s 1802256
filecutter 05.iear 304 111.NCER -s 1818704
filecutter 05.iear 16448 112.NCGR -s 1819008
filecutter 05.iear 432 113.NANR -s 1835456
filecutter 05.iear 24640 114.NCBR -s 1835888
filecutter 05.iear 400 115.NCER -s 1860528
filecutter 05.iear 176 116.NANR -s 1860928
filecutter 05.iear 176 117.NCER -s 1861104
filecutter 05.iear 4160 118.NCGR -s 1861280
filecutter 05.iear 608 119.NANR -s 1865440
filecutter 05.iear 49216 120.NCBR -s 1866048
filecutter 05.iear 592 121.NCER -s 1915264
filecutter 05.iear 368 122.NANR -s 1915856
filecutter 05.iear 32832 123.NCBR -s 1916224
filecutter 05.iear 432 124.NCER -s 1949056
filecutter 05.iear 352 125.NANR -s 1949488
filecutter 05.iear 41024 126.NCBR -s 1949840
filecutter 05.iear 512 127.NCER -s 1990864
filecutter 05.iear 496 128.NANR -s 1991376
filecutter 05.iear 65600 129.NCBR -s 1991872
filecutter 05.iear 736 130.NCER -s 2057472
filecutter 05.iear 7648 131.NANR -s 2058208
filecutter 05.iear 188480 132.NCBR -s 2065856
filecutter 05.iear 2096 133.NCER -s 2254336
filecutter 05.iear 608 134.NANR -s 2256432
filecutter 05.iear 73792 135.NCBR -s 2257040
filecutter 05.iear 832 136.NCER -s 2330832
filecutter 05.iear 73792 137.NCGR -s 2331664
filecutter 05.iear 944 138.NANR -s 2405456
filecutter 05.iear 106560 139.NCBR -s 2406400
filecutter 05.iear 1168 140.NCER -s 2512960
filecutter 05.iear 304 141.NANR -s 2514128
filecutter 05.iear 20544 142.NCBR -s 2514432
filecutter 05.iear 336 143.NCER -s 2534976
filecutter 05.iear 20544 144.NCGR -s 2535312
filecutter 05.iear 272 145.NANR -s 2555856
filecutter 05.iear 16448 146.NCBR -s 2556128
filecutter 05.iear 304 147.NCER -s 2572576
filecutter 05.iear 800 148.NANR -s 2572880
filecutter 05.iear 992 149.NCER -s 2573680
filecutter 05.iear 90176 150.NCGR -s 2574672
filecutter 05.iear 2608 151.NANR -s 2664848
filecutter 05.iear 86080 152.NCBR -s 2667456
filecutter 05.iear 960 153.NCER -s 2753536
filecutter 05.iear 1120 154.NANR -s 2754496
filecutter 05.iear 41280 155.NCBR -s 2755616
filecutter 05.iear 544 156.NCER -s 2796896
filecutter 05.iear 14416 157.NANR -s 2797440
filecutter 05.iear 113856 158.NCBR -s 2811856
filecutter 05.iear 2752 159.NCER -s 2925712
filecutter 05.iear 1312 160.NANR -s 2928464
filecutter 05.iear 61504 161.NCBR -s 2929776
filecutter 05.iear 736 162.NCER -s 2991280
filecutter 05.iear 1712 163.NANR -s 2992016
filecutter 05.iear 45120 164.NCBR -s 2993728
filecutter 05.iear 576 165.NCER -s 3038848
filecutter 05.iear 176 166.NANR -s 3039424
filecutter 05.iear 64 167.NCBR -s 3039600
filecutter 05.iear 160 168.NCER -s 3039664
filecutter 05.iear 176 169.NANR -s 3039824
filecutter 05.iear 64 170.NCBR -s 3040000
filecutter 05.iear 160 171.NCER -s 3040064
filecutter 05.iear 82800 172.NANR -s 3040224
filecutter 05.iear 61760 173.NCBR -s 3123024
filecutter 05.iear 1472 174.NCER -s 3184784
filecutter 05.iear 224 175.NANR -s 3186256
filecutter 05.iear 16448 176.NCBR -s 3186480
filecutter 05.iear 288 177.NCER -s 3202928
filecutter 05.iear 8256 178.NCGR -s 3203216
filecutter 05.iear 224 179.NANR -s 3211472
filecutter 05.iear 16448 180.NCBR -s 3211696
filecutter 05.iear 288 181.NCER -s 3228144
filecutter 05.iear 528 182.NCLR -s 3228432
filecutter 05.iear 176 183.NANR -s 3228960
filecutter 05.iear 320 184.NCBR -s 3229136
filecutter 05.iear 160 185.NCER -s 3229456
filecutter 05.iear 576 186.NCLR -s 3229616
filecutter 05.iear 304 187.NANR -s 3230192
filecutter 05.iear 16448 188.NCBR -s 3230496
filecutter 05.iear 304 189.NCER -s 3246944
filecutter 05.iear 16448 190.NCGR -s 3247248
filecutter 05.iear 1104 191.NANR -s 3263696
filecutter 05.iear 94272 192.NCBR -s 3264800
filecutter 05.iear 1120 193.NCER -s 3359072
filecutter 05.iear 208 194.NANR -s 3360192
filecutter 05.iear 208 195.NCER -s 3360400
filecutter 05.iear 8256 196.NCGR -s 3360608
filecutter 05.iear 272 197.NANR -s 3368864
filecutter 05.iear 12352 198.NCBR -s 3369136
filecutter 05.iear 256 199.NCER -s 3381488
filecutter 05.iear 272 200.NANR -s 3381744
filecutter 05.iear 16448 201.NCBR -s 3382016
filecutter 05.iear 304 202.NCER -s 3398464
filecutter 05.iear 16448 203.NCGR -s 3398768
filecutter 05.iear 432 204.NANR -s 3415216
filecutter 05.iear 24640 205.NCBR -s 3415648
filecutter 05.iear 400 206.NCER -s 3440288
filecutter 05.iear 176 207.NANR -s 3440688
filecutter 05.iear 176 208.NCER -s 3440864
filecutter 05.iear 4160 209.NCGR -s 3441040
filecutter 05.iear 576 210.NANR -s 3445200
filecutter 05.iear 45120 211.NCBR -s 3445776
filecutter 05.iear 544 212.NCER -s 3490896
filecutter 05.iear 352 213.NANR -s 3491440
filecutter 05.iear 32832 214.NCBR -s 3491792
filecutter 05.iear 432 215.NCER -s 3524624
filecutter 05.iear 384 216.NANR -s 3525056
filecutter 05.iear 41024 217.NCBR -s 3525440
filecutter 05.iear 512 218.NCER -s 3566464
filecutter 05.iear 384 219.NANR -s 3566976
filecutter 05.iear 28736 220.NCBR -s 3567360
filecutter 05.iear 400 221.NCER -s 3596096
filecutter 05.iear 6256 222.NANR -s 3596496
filecutter 05.iear 196672 223.NCBR -s 3602752
filecutter 05.iear 2176 224.NCER -s 3799424
filecutter 05.iear 784 225.NANR -s 3801600
filecutter 05.iear 77888 226.NCBR -s 3802384
filecutter 05.iear 864 227.NCER -s 3880272
filecutter 05.iear 77888 228.NCGR -s 3881136
filecutter 05.iear 1152 229.NANR -s 3959024
filecutter 05.iear 114752 230.NCBR -s 3960176
filecutter 05.iear 1232 231.NCER -s 4074928
filecutter 05.iear 272 232.NANR -s 4076160
filecutter 05.iear 24640 233.NCBR -s 4076432
filecutter 05.iear 368 234.NCER -s 4101072
filecutter 05.iear 24640 235.NCGR -s 4101440
filecutter 05.iear 368 236.NANR -s 4126080
filecutter 05.iear 32832 237.NCBR -s 4126448
filecutter 05.iear 448 238.NCER -s 4159280
filecutter 05.iear 896 239.NANR -s 4159728
filecutter 05.iear 880 240.NCER -s 4160624
 

fuzzy_cheez2

Member
OP
Newcomer
Joined
Jun 26, 2011
Messages
8
Trophies
0
XP
117
Country
United States
Sorry for being a moron about posting that link.

Anyways, thanks a lot for the help. I'm assuming I can't use the same batch file to extract the rest of the archives in the game data, so let me try and understand what you did here. In the batch, is the number before the file name the size of the file, and the number after it the location? I guess you used the values at the beginning to determine what the size and location of each file, but how did you determine the extension? If you go to that location in the hex, will the extension be there? And what do you mean when you say it "needs a flip"?

Sorry for asking all these questions but I'm really new to this.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,311
Country
United Kingdom
First yes that batch file is only for that and from what I saw it was mainly that character and one with a straight sword.

Back to the matter at hand yeah I should have elaborated upon all that. What follows looks long but it really is not.

When you first open the file it will look something like

gallery_32303_143_18626.png


You can get stuff done but 10 clicks will make it nicer to look at
I grouped everything by 32 bit set each line to 8 bytes wide and flipped it.

Byte flipping.... ARM processors and more or less anything that is not x86/x64 will use little endian byte ordering where the lowest value bytes will be first and everything else comes later for a given length (in this case 32 bits). Flipping it which all good hex editors will do ( http://gbatemp.net/topic/326873-rom-hacking-hex-editors-mid-2012-discussion/ should net you something and http://sourceforge.net/projects/hexplorer/ appears to do it in the "edit - operations" option and tiny hexer also does well if you press edit - convert and use the big endian little endian options over 32 bits) makes it human readable.
Left column location, right column size (or what I at least thought was size).
gallery_32303_143_13122.png


Export as text (ICY has troubles here so you might want to find something else) and stick it in a spreadsheet

One conversion to decimal later and in this case I had all the numbers I would need to feed filecutter (occasionally you might have to add something or take it away or do some other maths but today is nice) which meant everything else was so much copy and paste and use of the fill command. If we had the file names from somewhere else this would be where they get dumped in before being copied out to a text editor to make the batch file (tabs will still work but I like to replace them with spaces but that is trivial on any half decent text editor).

The extensions. As I am only working with a batch file and filecutter I opted for the cheating method rather than programming something properly.
The nice thing about SDK formats (I saw it and you mentioned it as well) is the first 4 bytes are the magic stamp which is just ASCII text and so the extension we tend to give these files/know them by. Luckily there were no extras today so a quick skip to the batch file up above and replace all the lengths with 4 but leave the start locations.
Run it and you have 240 files named hopefully in order from the file itself that is just the extensions of the files they would normally be.
New line is just 0d0a in hex so I made a file with that in it (and named it nl).
Copy /b 001.file+nl+002.file+nl..........+nl+240.ext extensions.txt
You should have the file names still from the batch file earlier so it is easy to make this command with another search and replace (I probably used a hex editor for that as text editors are sometimes reluctant to replace new line characters). The only might be that copy /b is limited to about 1000 files I think (might be 512) in which case you would build the first half, the second half and merge those files together.
Run that and you have a text file with the extensions in order.

Go back to the spreadsheet and stick the extension in. Generate a new batch file containing the proper sizes, names for the time being (now with extensions) and the start location.

Run that and 240 files with their proper extensions should appear. At this point conventional parsing of SDK formats happens (I stuck them in donor file so crystlatile2 could play with them but you are not restricted to that (Oil of Vitriol, tinke, lowlines tools......)). Had they not all been SDK formats or formats with ASCII magic stamps (occasionally you get developers leave thumb.db or something inside them) it might have been slightly more troublesome in that I might have had to delete that line and go manual for the file but that is easy enough if it is just a handful of them.
 

Barubary

Active Member
Newcomer
Joined
Feb 27, 2009
Messages
28
Trophies
0
Website
github.com
XP
143
Country
United States
Alternatively, if you want to get the files in a hurry, just use this program to unpack .iear files. (you can use the command line, but just opening it as a Java program works as well)

(I'm assuming that the format hasn't changed from when it was used in the Luminous Arc games though)
 
  • Like
Reactions: 1 person

fuzzy_cheez2

Member
OP
Newcomer
Joined
Jun 26, 2011
Messages
8
Trophies
0
XP
117
Country
United States
Thanks for that program, it works very well. To be honest, I was struggling with the other method and the files seemed to be coming out wrong - the palettes were all scrambled.

The only thing that's weird is that if I try to drop an NCGR or NCBR file into TiledGGD, I get the following error message:

System.BadImageFormatException: Could not load file or assembly 'LuaInterface, Version=2.0.0.16708, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Any idea what that might be? If you can't help, that's fine. I can still look at graphics by loading up the entire .iear archive in the program, and the palette files work just fine, which was my biggest concern.
 

Barubary

Active Member
Newcomer
Joined
Feb 27, 2009
Messages
28
Trophies
0
Website
github.com
XP
143
Country
United States
I've seen the error before, but I've yet to diagnose why it happens.

You can use this program to view the contents of a NANR/NCER/NCBR(or NCGR)/NCLR file set instead. :)
(or Tinke, if it supports loading separate files)
 
  • Like
Reactions: 1 person

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=hke2YUirpf4 +1