ItsMods

Full Version: [C#] [LIBRARY] SABSFile library (open sound files)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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?)

[Image: Bd3QT.png]
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
  1. using (BinaryReader fs = new BinaryReader(File.OpenRead(filename)))
  2. {
  3. //read header
  4. fs.ReadBytes(20);
  5. entrycount = fs.ReadInt32();
  6. fs.ReadBytes(4); // start offset
  7. fs.ReadBytes(4); // unknown
  8. fs.ReadBytes(4); // hashes?
  9.  
  10. entryoffset = fs.ReadInt32();
  11. fs.BaseStream.Seek(entryoffset, SeekOrigin.Begin);
  12. for (int i = 0; i < entrycount; i++)
  13. {
  14. //create entrys
  15. fs.ReadBytes(4);
  16. SABSEntry sabs = new SABSEntry { Offset = fs.ReadInt32(), Size = fs.ReadInt32(), Parent = this, InternalIndex = i };
  17. fs.ReadBytes(8);
  18. if(sabs.Size != 0)
  19. entries.Add(sabs);
  20. internalentries.Add(sabs);
  21. }
  22. }


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!
Pages: 1 2 3 4