benilla-re systems structs docs

SFileOpenFileInArchives

function · storm · orchestration

Address
0x656690 · 889 bytes, up to 0x656a08
Meaning
Resolves a name, derives the file's key and sector count, and builds the file record
Confidence
verified, proof two
Finding
storm/format#decryption

Finding: Decryption in storm: the archive format

A block is decrypted dword by dword. The running value starts as 0xeeeeeeee; for each dword the key stream is added table[0x400 + (key & 0xff)], the dword is XORed with (running + key), running = running·0x21 + plain + 3, and key = ((~key << 0x15) + 0x11111111) | (key >> 0x0b). A file's key is the type 3 hash of its base name: the name after the last : and then after the last \, never /. With 0x20000 the key becomes (key + offset − header position) ^ unpacked size. The sector table uses the key − 1, and sector i the key + i.

The derivation is in the doc.

Callers 5

Callees 14

Calls and jumps by a bare address, from tables/calls.tsv.