SFile::OpenEx
function · storm · orchestration
- Address
0x6477c0· 1498 bytes, up to0x647d99- Meaning
- Opens a name by its resolved kind; a .bz file is checked for BZ00 and set up to inflate
- Confidence
- verified, proof two
- Name from
- the community database (idb)
- Finding
- storm/bz#opening-a-bz-file
- Test
storm::bz_open_header_difftest
Finding: Opening a .bz file in storm: compressed loose files
For kind 1, SFile::OpenEx opens the full path with mode rb; a null FILE * frees the object and returns
0. It copies the path, cut at its last . when the rest is .bz in any case, and the name, then reads 24
bytes without checking the count. Unless the dword at header offset 4 is BZ00 it frees the object and
returns 0, leaving the file open. Otherwise it keeps the size and the 16 bytes, sets the position to 0,
allocates the 0x1000-byte input and the 0x38-byte stream, calls inflateInit_(stream, "1.1.3", 0x38)
without testing it, and returns 3.
| offset | bytes | content |
|---|---|---|
| 0 | 4 | the inflated size, little-endian; SFile::GetFileSize answers it |
| 4 | 4 | BZ00 |
| 8 | 16 | kept at +0x44; no live code reads them for a .bz file |
| 24 | to the end | a zlib stream: a 2-byte header, deflate data, an Adler-32 |
The derivation is in the doc.
Callers 10
- TextureCreateFromFile gx
- TextureCreateFromBlp gx
- TgaOpen image
- BlpOpen image
- SFile::Open storm
- SFile::Load storm
- M2CacheGetShared models
- ReadMovieAvi ui
- SoundFileCacheOpen os
- 0x7a8ab0 os
Callees 21
- SMemAlloc storm
- SMemFree storm
- ConstructFileObject storm
- DestroyFileObject storm
- OpenLocalFile storm
- SFileResolveOpen storm
- SStrChrR storm
- SStrChrRCopy storm
- SStrCmpI storm
- SStrCopy storm
- SStrDupA storm
- SStrPack storm
- 0x653780 storm
- 0x655210 storm
- SFileOpenArchive storm
- SFileOpenFileInArchives storm
- 0x668510 storm
- 0x668610 storm
- 0x668750 storm
- inflateInit_ zlib
- 0x740c97 crt
Calls and jumps by a bare address, from tables/calls.tsv.