Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

CR: TOC.bin Shrinking

Technical research related to the structure of Mass Effect game files.

CR: TOC.bin Shrinking

Postby WarrantyVoider » 06 Jan 2014, 19:25

cool, I found a way to shrink my TOC.bin and make it easier to add files:

here the first bytes explained
-int32 magic number
-int32 always zero
-int32 chunk count


well this is the header and is followed by a chunklist, one entry is
-int32 offset to entry from *here*
-int32 entries count


so a TOC file works like this:
Image
from the chunklist you get the offset to the start of the first entry and then read as many entries as specified in the chunk. So usually 3 to 4 entries are grouped to chunks. Now I could write a chunk for each file or one for all. I decided for the latter one, so I only have to update one counter :D

Image

red is the chunk counter, this will stay 1
green is the first offset, as you start reding it from 0xC and it says 0x8 bytes on, you start at 0x14 (after blue)
blue is the count of entries in this chunk, well I took all :D

now each entry works like this:
-int16 bytes till next entry (zero for last one)
-int16 flags
-int32 file size
-byte[20] 20 bytes SHA1 Hash (unused afaik)
-string filepath (zero terminated string)


so maybe I can make an editor for more than just filesize :D

credits: most understanding taken from AKs code in TOCEditorAK and my own trial&error

greetz WV
always backup your files!
mess with the best or die like the rest!
"I tried everything!" - "mkay, please list that..." ; please dont pm me for help, we have a help section

WarrantyVoider has been thanked by:
User avatar
WarrantyVoider
Emeritus
 
Posts: 2270
Joined: 22 Aug 2012, 11:33
Has thanked: 480 time
Have thanks: 626 time

Return to Technical Research

Who is online

Users browsing this forum: No registered users and 1 guest

suspicion-preferred