Skip to content

Commit

Permalink
Update format docs a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
WSSDude committed Jul 3, 2023
1 parent 1b241df commit d31a5b7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 39 deletions.
54 changes: 21 additions & 33 deletions docs/HitmanBloodMoney/Formats/SND.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ struct SND_Footer
{
uint32_t offsetToReservedTable1; // table always filled with nulls
uint32_t offsetToStreamsFilename; // always 0x10 as this is always right after basic header
uint32_t offsetToRootGroupEntry; // seems to point to some SND_EntryGroup... maybe some root group? if null it is not present in file
uint32_t offsetToRootGroupEntry; // seems to point to some SND_Entry_Group... maybe some root group? if null it is not present in file
char unkC[0x74 - 0xC];
uint32_t offsetsToTableOfSoundEntries; // all offsets points to SND_EntrySound, if null it is not present in file
uint32_t offsetsToTableOfSetEntries; // all offsets points to SND_EntrySet, if null it is not present in file
uint32_t offsetsToTableOfSequenceEntries; // all offsets points to SND_EntrySequence, if null it is not present in file
uint32_t offsetsToTableOfWaveEntries; // all offsets points to SND_EntryWave, if null it is not present in file
uint32_t offsetsToTableOfDefineEntries; // all offsets points to SND_EntryDefine, if null it is not present in file
uint32_t unk_offsetsToTableOfEntriesWithType_6; // unknown, assume that this is type table for 6 entries, all offsets points to SNDENTRY, if null it is not present in file
uint32_t offsetsToTableOfSoundEntries; // all offsets points to SND_Entry_Sound, if null it is not present in file
uint32_t offsetsToTableOfSetEntries; // all offsets points to SND_Entry_Set, if null it is not present in file
uint32_t offsetsToTableOfSequenceEntries; // all offsets points to SND_Entry_Sequence, if null it is not present in file
uint32_t offsetsToTableOfWaveEntries; // all offsets points to SND_Entry_Wave, if null it is not present in file
uint32_t offsetsToTableOfDefineEntries; // all offsets points to SND_Entry_Define, if null it is not present in file
uint32_t unk88; // unknown, mostly null
uint32_t offsetsToTableOfUnknownOffsets1; // all offsets points to seemingly null bytes, at least always a single row of 16-bytes with 0, had not observed more than 16-bytes yet
char unk90[0x1E0 - 0x90];
};
Expand All @@ -48,8 +48,8 @@ enum SND_EntryType
SOUND = 0x01, // looks like "audio:<ID>#sound"
SET = 0x02, // looks like "audio:<ID>#set"
SEQUENCE = 0x03, // looks like "audio:<ID>#seq"
WAVE = 0x04, // does not have ID used it seems, but can be seen in file as "audio:<ID>#waves"
DEFINE = 0x05, // does not have ID used it seems, but can be seen in file as "audio:<ID>#def"
WAVE = 0x04, // does not have ID used it seems by corresponding entry, but can be seen in file as "audio:<ID>#waves"
DEFINE = 0x05, // looks like "audio:<ID>#def"
GROUP = 0x17, // looks like "audio:<ID>#group"
};

Expand All @@ -67,95 +67,83 @@ struct SND_UNKTYPE1
uint32_t nullsOrReservedOrUnknown[3];
};

struct SND_EntrySound
struct SND_Entry_Sound
{
uint32_t type; // enum SND_EntryType::SOUND
uint32_t unk4; // seems to be 0xCDCDCDCD in test files, check what it does, may be reserved or padding
uint32_t offsetToIdentifier; // aligned on 16 bytes, null-terminated string, seems to always be some kind of string ID aligned like specified
uint16_t unkC; // equals 1 for example
uint16_t unkE; // equals 0xCDCD in test files, check what it does, may be reserved

// TODO - these may or may not belong to the entry, unsure of sizes
uint32_t offsetToUnknown1; // some offset to some 16-byte type
uint32_t offsetToWaveEntry; // offset to wave entry SND_EntryWave, if null then not present in file
uint32_t offsetToUnknown1; // some offset to some 16-byte type, SND_UNKTYPE1
uint32_t offsetToWaveEntry; // offset to wave entry SND_Entry_Wave, if null then not present in file
char unk18[0x30 - 0x18]; // unknown, doesn't seem important for now...
};

struct SND_EntrySet
struct SND_Entry_Set
{
uint32_t type; // enum SND_EntryType::SET
uint32_t unk4; // seems to be 0xCDCDCDCD in test files, check what it does, may be reserved or padding
uint32_t offsetToIdentifier; // aligned on 16 bytes, null-terminated string, seems to always be some kind of string ID aligned like specified
uint16_t unkC; // equals 2 for example
uint16_t unkE; // equals 0xCDCD in test files, check what it does, may be reserved

// TODO - these may or may not belong to the entry, unsure of sizes
uint32_t unk10; // maybe offset or size, was 0x40 in test case
uint32_t offsetToTableOfSoundEntries; // offset to table of offsets to SND_EntrySound entries, if null then not present in file, if entry in table is null then that is the table end, 16-byte aligned, probably any size possible, took 32 bytes in test case
uint32_t offsetToTableOfSoundEntries; // offset to table of offsets to SND_Entry_Sound entries, if null then not present in file, if entry in table is null then that is the table end, 16-byte aligned, probably any size possible, took 32 bytes in test case
uint16_t unk18; // was 6 in example, same as number of entries in table...
uint16_t unk1A; // was 6 in example, same as number of entries in table...
uint32_t unk1C; // was 0 in example
uint32_t unk20; // was 2 in example
char unk24[0x30 - 0x24]; // unknown, doesn't seem important for now... seem like nulls anyway
};

struct SND_EntrySequence
struct SND_Entry_Sequence
{
uint32_t type; // enum SND_EntryType::SEQUENCE
uint32_t unk4; // seems to be 0xCDCDCDCD in test files, check what it does, may be reserved or padding
uint32_t offsetToIdentifier; // aligned on 16 bytes, null-terminated string, seems to always be some kind of string ID aligned like specified
uint16_t unkC; // equals 1 for example
uint16_t unkE; // equals 0xCDCD in test files, check what it does, may be reserved

// TODO - these may or may not belong to the entry, unsure of sizes
uint32_t unk10; // maybe offset or size, was 0x30 in test case
uint32_t offsetToSetEntry; // offset to wave entry SND_EntrySet, if null then not present in file
uint32_t offsetToSetEntry; // offset to wave entry SND_Entry_Set, if null then not present in file
uint16_t unk18; // was 2 in example
uint16_t unk1A; // was 2 in example
uint16_t unk1C; // was 0x64 in example
uint16_t unk1E; // was 0xCDCD in example
};

struct SND_EntryWave
struct SND_Entry_Wave
{
uint32_t type; // enum SND_EntryType::WAVE
uint32_t waveFileNameLength; // length of wave file name contained in the following offset, without null-terminator
uint32_t waveFileNameOffset; // offset to null-terminated wave file name, aligned on 16-bytes
uint32_t unkC; // maybe reserved, seens to be 0, check

// TODO - these may or may not belong to the entry, unsure of sizes
uint32_t unk10; // maybe reserved, seens to be 0, check
uint32_t offsetToSetEntryID; // offset to ID of sound set, in form "audio:<ID>#set"
uint32_t unk_timestamp32bit; // may be timestamp time_t in 32-bit format, check
uint32_t unk_nullMaybeReserved; // unknown, seems to be null
};

struct SND_EntryDefine
struct SND_Entry_Define
{
uint32_t type; // enum SND_EntryType::DEFINE
uint32_t unk4; // seems to be 0xCDCDCDCD in test files, check what it does, may be reserved or padding
uint32_t offsetToIdentifier; // aligned on 16 bytes, null-terminated string, seems to always be some kind of string ID aligned like specified
uint16_t unkC; // equals 0 for example
uint16_t unkE; // equals 0xCDCD in test files, check what it does, may be reserved

// TODO - these may or may not belong to the entry, unsure of sizes
uint32_t unk10; // maybe offset, was 0 in test case
uint32_t offsetToUnknown; // all offsets points to seemingly null bytes, at least always a single row of 16-bytes with 0, had not observed more than 16-bytes yet, possibly same offset as some which can be found in SND_Footer::offsetsToTableOfUnknownOffsets1 table
uint16_t unk18; // was 16 in example
uint16_t unk1A; // was 16 in example
uint32_t unk1C; // was 0 in example
};

struct SND_EntryGroup
struct SND_Entry_Group
{
uint32_t type; // enum SND_EntryType::GROUP
uint32_t unk4; // (seems to be 0xCDCDCDCD in test files, check what it does, may be reserved or padding)
uint32_t offsetToIdentifier; // (aligned on 16 bytes, null-terminated string, seems to always be some kind of string ID aligned like specified)
uint16_t unkC; // equals 0 for example
uint16_t unkE; // equals 0xCDCD in test files, check what it does, may be reserved

// TODO - these may or may not belong to the entry, unsure of sizes
uint32_t unk10; // was 0 in example
uint32_t offsetToTableOfChildGroupEntries; // offset to table of offsets to other SND_EntryGroup entries, if null then not present in file, unsure if some fixed size or alignemnt, assume 16-byte alignemnt, maybe fixed size of 0xA0, may contain NULLs (no childs either)
char unk18[0x70 - 0x18]; // unknown, doesn't seem important for now... possibly 0x30 instead of 0x70 as in SNDENTRY_SOUND, but not known...
uint32_t offsetToTableOfChildGroupEntries; // offset to table of offsets to other SND_Entry_Group entries, if null then not present in file, unsure if some fixed size or alignemnt, assume 16-byte alignemnt, maybe fixed size of 0xA0, may contain NULLs (no childs either)
char unk18[0x70 - 0x18]; // unknown, doesn't seem important for now... possibly 0x30 instead of 0x70 as in SND_Entry_Sound, but not known...
};
5 changes: 2 additions & 3 deletions docs/HitmanBloodMoney/Formats/STR.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ struct STR_Header {
struct STR_Footer {
};

// LIP chunk which may be at the start of some sound files data, it is aligned on 0x100 boundary
// LIP chunk which may be at the start of some sound files data, it is always in a block of 0x1000 ending with bunch of zeroes, unknown purpose
struct STR_LIPChunk
{
uint32_t id; // compares to first 4 chars from "LIP "
uint32_t dataSize;
// follows dataSize, note that structure is aligned on 0x100 (same as header)
char unk4[0x1000 - 0x4]; // unknown contents, ends with 0, always a block of this size if it is present
};
6 changes: 3 additions & 3 deletions docs/HitmanBloodMoney/Formats/WHD+WAV.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ union WHD_Record
uint32_t dataOffset;
uint32_t samplesCount;
uint32_t blockAlign; // something weird for OGG!
uint32_t fmtExtra; // 0xCDCDCDCD for PCMs, 2041 for ADPCM, 0x004F3E93 for OGG...
uint32_t fmtExtra; // 0xCDCDCDCD for PCMs, 0x07F9 for ADPCM, 0x004F3E93 for OGG...
uint32_t nullBytes[4];
};

Expand All @@ -57,7 +57,7 @@ union WHD_Record
uint32_t dataOffset;
uint32_t samplesCount;
uint32_t blockAlign; // something weird for OGG!
uint32_t fmtExtra; // 0xCDCDCDCD for PCMs, 2041 for ADPCM, 0x004F3E93 for OGG...
uint32_t fmtExtra; // 0xCDCDCDCD for PCMs, 0x07F9 for ADPCM, 0x004F3E93 for OGG...
uint32_t nullBytes[4];
};

Expand All @@ -75,7 +75,7 @@ union WHD_Record
uint32_t dataOffset; // may start with "LIP " (0x2050494C) chunk, ignore lip->dataSize bytes aligned on 0x100 boundary
uint32_t samplesCount;
uint32_t unk18;
uint32_t fmtExtra; // 0xCDCDCDCD for PCMs, 2041 for ADPCM, 0x004F3E93 for OGG...
uint32_t fmtExtra; // 0xCDCDCDCD for PCMs, 0x07F9 for ADPCM, 0x004F3E93 for OGG...
uint32_t unk2C;
uint32_t nullBytes[3];
};
Expand Down

0 comments on commit d31a5b7

Please sign in to comment.