Re: Mafia 3 - .SDS
Posted: Wed Oct 12, 2016 3:12 am
hey man do you have a compiled version? it wont compile for me for some reason in visual studioCarLuver69 wrote:Posting my research here in case anyone can put it to good use. I'll probably make my own tools eventually, but I don't have an ETA on that
Thanks to aluigi for his Mafia .SDS (PS3) script, it helped point me in the right direction.
NOTE: I'm probably wrong on a lot of this, so please feel free to make corrections. I'm most likely off on the chunkCount being used to determine how many SDSChunkData's there are.
Code: Select all
struct SDSFile { int magic; // 0x534453 ('SDS\0') int version; // 0x14 (v20 / v1.4?) enum SDSType : int { PC = 0x4350, /* These are ASSUMED, I only have the PC version */ PS4 = 0x345350, XB1 = 0x314258, } type; int unk_0C; // 0x5DE53FDE int dataInfoOffset; int dataOffset; int unk_18; // always zero? int unk_1C; // offset / size of something? int unk_20; // always zero? int unk_24; // offset / size of something? int unk_28; // always zero? int unk_2C; // 1 int unk_30; // always zero? int unk_34; // always zero? int unk_38; // always zero? int unk_3C; // always zero? int chunkCount; // how many data chunks? (educated guess) int reserved; // checksum, hash, or key of some sort? /* @ dataInfoOffset */ struct SDSDataInfo { int count; // how many data types there are struct SDSDataType { int typeIndex; // local index to reference this type int strLen; char typeName[strLen]; // no null-terminator int reserved; // possibly a guard? (always zero?) } dataTypes[count]; } dataInfo; /* @ dataOffset */ struct SDSData { int magic; // 0x6C7A4555 ('UEzl') int unk_04; // 0x10000? (never seems to change) char unk_05; // 4? struct SDSChunkData { int dataSize; // size of SDSChunkData char dataType; // reference to SDSDataInfo.dataType struct SDSChunkData { int memorySize; // size in memory? (e.g. uncompressed size) int bufferOffset; // offset to start of data int memorySize_2; // SDSData.unk_04 again? short unk_0A; // number of something? (this format is confusing) short unk_0C; // 0x80F? short bufferSize; // this might be an int, but unlikely /* <<< Data padding >>> */ /* @ bufferOffset */ char buffer[bufferSize]; } data; } chunks[chunkCount]; }; };