Skip to content

MKX Audio

thethiny edited this page Jun 21, 2026 · 1 revision

MKX Audio (FMOD)

MKX uses FMOD for audio. Sound packages (SND_*.xxx) contain FMOD exports with encrypted FSB audio banks.

Export Types in SND Packages

Export Class Purpose
FmodDesignerProject Root container — UE3 properties including event list and bIsEncrypted flag
FmodEventFile UE3 properties + FEV/FSB file table
FmodSourceData Raw binary data (FEV event bank or encrypted FSB sound bank)
FmodEvent Metadata — group name, event index, priority

FmodSourceData Layout

After the None FName terminator (8 bytes), FmodSourceData contains FUntypedBulkData:

Field Size Type
Flags 4 u32
ElementCount 4 u32
SizeOnDisk 4 u32
Offset 4 u32
Unk1 4 u32
Unk2 4 u32

Total header: 24 bytes. Inline data follows immediately.

FmodSourceData exports come in pairs per sound bank:

  1. FEV (event definitions) — unencrypted XML-like binary describing events, categories, reverb
  2. FSB (sound bank) — encrypted audio data containing the actual waveforms

FSB Encryption

Discovery

The bIsEncrypted flag lives in the FmodDesignerProject's properties at byte offset +200, bit 2. When set, FSB data is encrypted with a type 1 cipher.

The encryption key was found by examining the game's GFMOD_Encryption_Key global:

Key: 996164B5FC0F402983F61F220BB51DC6

This is a 32-byte ASCII string used as a cycling XOR key.

Algorithm

The FSB type 1 cipher applies two operations per byte:

def fsb_decrypt(data, key):
    result = bytearray(len(data))
    for i in range(len(data)):
        reversed_byte = reverse_bits(data[i])  # Reverse bit order within byte
        result[i] = reversed_byte ^ key[i % len(key)]
    return result

Bit reversal: Each byte's 8 bits are reversed (MSB ↔ LSB). For example, 0b11001010 becomes 0b01010011.

XOR: The reversed byte is XORed with the key character at position i % key_length.

Validation

All 3 FSB banks in SND_UI_InGame.xxx decrypt and validate:

  • Magic: FSB5
  • Version: 1
  • Codec: Vorbis
  • Sample rates and channel counts are valid
  • Audio data plays correctly

Implementation

Located in mk_utils/formats/fsb.py:

  • _reverse_bits(byte) — 8-bit reversal via lookup or shifting
  • fsb_decrypt(data, key) — applies bit-reverse + XOR with cycling key
  • Key sourced from GFMOD_Encryption_Key property in the FmodDesignerProject export

FmodEventFile

Contains a file table mapping event names to FEV/FSB data. Custom serialization format (not standard UE3 properties). The FEV and FSB binary data is referenced by offset into the FmodSourceData exports.

Status: FEV/FSB file table parsing is not yet implemented — currently we extract the raw FmodSourceData and decrypt FSB separately.

Audio Pipeline (Future)

Planned but not yet implemented:

  1. Parse FmodEventFile to map event names → FEV/FSB pairs
  2. Decrypt FSB with the type 1 cipher
  3. Extract individual audio samples from FSB5 banks
  4. Audio preview/playback in the browser

IJ2/MK11 Audio

IJ2 and MK11 use NRSAudioBank/NRSAudioEvent instead of FMOD. These are a different audio system — not yet reverse engineered.

Clone this wiki locally