Woot! That's great! Keep up the awesome work
Also sorry for ignoring you in your post before that, Forgot to check the thread, will try it out!
Works perfectly! Thank you so much.
Only thing I noticed is that the first ~20 entries in spl_code_post_gfx.all.sabs all seem invalid (perhaps those files are in the sabl files?)
Just make sure to add safety checks and you'll be alright.
Yea, I know, I was just curious on what it might be
So yea, The offsets it's giving me seem to be invalid.
It's either to large or the offset is negative (wtf?)
Code:
Offset: E Size: 14
Offset: 0 Size: 5674800
Offset: 20D5A612 Size: 3A6C613B
Offset: 732E6C6C Size: 736261
Offset: 736F705F Size: 66675F74
Offset: 746F6F72 Size: 6C6C612E
Offset: 0 Size: 43614C66
Offset: B80B0000 Size: 800F002
------- EXTRACTION -------
Failed to extract entry 0xE (Offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0x0 (offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0x20D5A612 (Offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0x732E6C6C (Offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0x736F705F (Offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0x746F6F72 (Offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0x0 (offset and length are outside the bounds of the array or the number is greater than the number of elements from index to the end of the source collection.)
Failed to extract entry 0xB80B0000 (Non-negative number required.
Parameter name: offset)
---------------------------
Complete. 0/8 entries extracted
Yeah, I don't know about that. Do a less than zero of out of bounds check before attempt to extract data.
But, it's all invalid.
Not just some of them, every single one. I already tried larger files and it had the same result.
Am I encoding it wrong or something?
I don't know. I can't tell without seeing any code.
Turns out entryoffset always is 0x0.
Also
CSHARP Code
using (BinaryReader fs
= new BinaryReader
(File.
OpenRead(filename
))) {
//read header
fs.ReadBytes(20);
entrycount = fs.ReadInt32();
fs.ReadBytes(4); // start offset
fs.ReadBytes(4); // unknown
fs.ReadBytes(4); // hashes?
entryoffset = fs.ReadInt32();
fs.BaseStream.Seek(entryoffset, SeekOrigin.Begin);
for (int i = 0; i < entrycount; i++)
{
//create entrys
fs.ReadBytes(4);
SABSEntry sabs
= new SABSEntry
{ Offset
= fs.
ReadInt32(), Size
= fs.
ReadInt32(), Parent
= this, InternalIndex
= i
}; fs.ReadBytes(8);
if(sabs.Size != 0)
entries.Add(sabs);
internalentries.Add(sabs);
}
}
Pretty much what you send me.
I made a mistake, please check the previous page again.
Yea, I noticed, Checked out your struct and solved it already.
Thanks!