View Single Post
Old 10-12-11, 09:48 AM   #67
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
I really should learn C# someday but C and C++ is good enuff for me right now.
C# is like C in many ways. You'll be able to read a C# source file quite easily.

In the template's section header there's an unknown we had marked where the value is always 0x4. This 0x4 is an alignment value. It specifies the alignment of the file. Being 0x4 then everything is aligned to 4 byte boundaries. You see this in the text embedded in the file. I could never figure out why some text had 1,2, or 3 null characters (0x0) after them until I figured this alignment value out. Now it makes perfect sense

Here are some excerpts from that C# code file dealing with some unknowns we had defined in the info header and section headers (the comments denote what I have found dealing with SH5 GR2 files):

// are comments in C#

here is the file header:
internalByte[] magicstring;
internalint fileliststartoffset; // from start of file
internalint unknown1;
internalint unknown2;
internalint unknown3;

here is the info header (not sure if rootobjecttype is correct in it's definition but the rootobjectoffset is correct):
internalint fileformatrevision;
internalint filesizeinbytes;
internalint crcvalue;
internalint bytesfromoffsettostartofsections; // from offset
internalint numberofsections;
internalint rootobjecttype; // defines which section root object is in ?
internalint rootobjectoffset; // defines offset from start of section above where root object is located ?
internalint unknown1;
internalint unknown2;
internaluint tag;
internalint[] unknown3; // 8 (bytes) of them

Here are the sections (compressed size and uncompressed size may not be in correct order - haven't found any SH5 GR2 files that are compressed):
internalint unknown; // always 0
internalint sectionfileoffset; // from start of file
internalint compressedsize; // compressed size and uncompressed size must be equal
internalint uncompressedsize; // compressed size and uncompressed size must be equal
internalint alignment; // usually alignment is 4 (everything aligned on 4 byte boundaries)
internalint startofdatafileoffset; // offset + sectionfileoffset = location
internalint startofdatafileoffset2; // offset + sectionfileoffset = location
internalint pointersfileoffset; // from start of file
internalint numberofpointers;
internalint pointertounknown; // usually points to end of file
internalint unknown2; // always 0

so in my sections where does this FileSectionFormat fall (is it unknown or unknown2)

So far 6 people have downloaded the source file....no one has any comments/suggestions/ideas?

Last edited by TheDarkWraith; 10-12-11 at 10:20 AM.
TheDarkWraith is offline   Reply With Quote