From a8e6464dd7fa7c1e1e9806b1b0f25cffdea7b2d0 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 12 Jul 2024 11:53:47 +0200 Subject: [PATCH] Add File Type - Wwise Event --- File Type - Wwise Event.-.md | 145 +++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 File Type - Wwise Event.-.md diff --git a/File Type - Wwise Event.-.md b/File Type - Wwise Event.-.md new file mode 100644 index 0000000..958da56 --- /dev/null +++ b/File Type - Wwise Event.-.md @@ -0,0 +1,145 @@ +```101editor +//------------------------------------------------ +//--- 010 Editor v12.0.1 Binary Template +// +// File: dt_wwise_event.bt +// Authors: Lucas Schwiderski +// Version: +// Purpose: +// Category: Darktide +// File Mask: *.wwise_event +// ID Bytes: +// History: +//------------------------------------------------ + +// Definitions for Wwise Bank are taken from the repository. +// Copyright Alexander Lombardi + +/*********************************************************************** +Typedef's Section: +***********************************************************************/ +typedef struct(uint32 dataLen) +{ + local uint32 i, numFiles = dataLen / 12; // 12 = 3 * uint32 entries. + for(i = 0; i < numFiles; i++) + { + struct d_entry + { + uint32 fileId ; + uint32 dOffset ; + uint32 dSize ; + } a_wem_file; + } +} data_DIDX; + +typedef struct(data_DIDX &DIDX_dataObj) +{ + local uint32 i; + local const uint64 pos = FTell(); + + for(i = 0; i < DIDX_dataObj.numFiles; i++) + { + FSeek(pos + DIDX_dataObj.a_wem_file[i].dOffset); + struct d_entry_data(data_DIDX &DIDX_dataObj) + { + byte rawdata[DIDX_dataObj.a_wem_file[i].dSize] ; + } aFileData (DIDX_dataObj); + } + FSeek(pos + parentof(this).secLen); +} data_DATA; + +typedef struct { + byte object_type; + uint32 object_length; + uint32 id ; + byte data[object_length-4]; +} data_HIRC_object; + +typedef struct { + uint32 object_count; + data_HIRC_object objects[object_count] ; +} data_HIRC; + +typedef struct +{ + char secName[4]; + + if(Strcmp(secName, "ffff") != 0) { + uint32 secLen ; + if(secLen > 0) + { + if(Strcmp(secName, "DIDX") == 0) + { + data_DIDX data(secLen); + parentof(this).flag_DIDX_defined = TRUE; + parentof(this).idxOf_DIDX_sec = parentof(this).i; + } + else if(Strcmp(secName, "DATA") == 0 && parentof(this).flag_DIDX_defined) + data_DATA data(parentof(this).aSection[parentof(this).idxOf_DIDX_sec].data); + else if(Strcmp(secName, "HIRC") == 0) + data_HIRC data; + else + byte data[secLen]; + }; + }; +} section ; + +/*********************************************************************** +File Definition: +***********************************************************************/ + +uint32 version ; +Assert(version == 0x1b); +uint32 length; + +// A section of values that don't belong the actual Wwise bank +struct { + uint32 unknown1; + // Does not match the file name + // TODO: Check if this corresponds to some other file/bundle in the game + uint64 hash ; + uint32 unknown2; + Assert(unknown2 == 0x40); + uint32 unknown3; + Assert(unknown3 == 0x0); + + // The following hash-like values will probably define some of these values: + // - name of the event + // - Wwise bus the event runs on + + // Corresponds to the `id` value of a HIRC object of type "event" later on in the file + uint32 unknown4 ; + // Only shows one of a few values: + // - 0x41c80000 + // - 0xffff7f7f + uint32 unknown5 ; + + uint32 unknown6 ; + // At least in one instance, this was identical with `unknown6` + uint32 unknown7 ; + + uint32 unknown8; + uint32 unknown9; + uint32 unknown10; + uint32 unknown11; +} header ; + +struct bnk +{ + local byte flag_DIDX_defined = FALSE; // Used later to ensure DATA section is defined and declared after DIDX. + local int32 i; // i is used later to find the index of the DIDX section. + local int32 idxOf_DIDX_sec = -1; // Will get set to i's value when DIDX gets parsed. + + for(i = 0; !FEof(); i++) + section aSection; +} wwise_bank ; + + +/*********************************************************************** +Function definitions: +***********************************************************************/ +string getSecName(section &aSec) +{ + return aSec.secName; +} +``` \ No newline at end of file