benilla-re systems structs docs

SFileObject

struct · storm · 96 bytes

Meaning
Holds an open Storm file: its kind, C runtime file, names, .bz inflate state and lock
Confidence
verified, proof two
Finding
storm/bz#the-file-object

Finding: The file object in storm: compressed loose files

0x647290(kind) builds the object: the kind at +0x00, the lock at +0x24, and 0 in every field but +0x14, +0x20 and +0x44 to +0x50, which keep what the allocation held. A kind-1 open fills the FILE * (+0x04), the path and name copies (+0x0c, +0x10), the inflated size (+0x14), the input buffer (+0x18), the zlib stream (+0x1c), the position (+0x20) and 16 header bytes (+0x44, flagged at +0x54). Other kinds use +0x08, +0x3c and +0x40; +0x58 and +0x5c serve overlapped reads. 0x6472d0 ends the inflate and frees the stream, the copies and the buffer, and deletes the lock; it does not close the FILE *, which only SFile::Close does first.

The derivation is in the doc.

Fields 16

offsetsizetypenamemeaningconfidencefinding
0x00004uint32_tm_kindHolds the loose-file index kind the open resolvedverified, proof twostorm/bz#the-file-object
0x00044void *m_fileHolds the C runtime FILE of a loose or .bz fileverified, proof twostorm/bz#the-file-object
0x00084void *m_archiveBlockHolds kind 2's 8-byte block, whose +0x04 is the archive opened for the fileverified, proof onestorm/bz#the-file-object
0x000c4char *m_pathHolds a copy of the full path, without a final .bzverified, proof twostorm/bz#the-file-object
0x00104char *m_nameHolds a copy of the name the open was givenverified, proof twostorm/bz#the-file-object
0x00144uint32_tm_bzSizeHolds the inflated size from a .bz headerverified, proof twostorm/bz#the-file-object
0x00184uint8_t *m_bzInputHolds the 0x1000-byte input buffer of a .bz fileverified, proof twostorm/bz#the-file-object
0x001c4void *m_bzStreamHolds the 0x38-byte zlib stream of a .bz fileverified, proof twostorm/bz#the-file-object
0x00204uint32_tm_bzPositionHolds the bytes successful reads delivered since the .bz stream beganverified, proof twostorm/bz#the-file-object
0x002424uint8_t[24]m_lockHolds the critical section reads and seeks takeverified, proof twostorm/bz#the-file-object
0x003c4void *m_archiveFileHolds the archive file record of kinds 2 and 3verified, proof onestorm/bz#the-file-object
0x00404void *m_zipFileHolds the SZip.cpp handle of a kind-4 fileverified, proof onestorm/bz#the-file-object
0x004416uint8_t[16]m_extraBytesHolds 16 bytes: a .bz header's, which no live code reads, or what 0x655210 fills for kinds 2 and 3verified, proof twostorm/bz#the-file-object
0x00544uint32_tm_extraBytesSetHolds 1 when +0x44 is filledverified, proof twostorm/bz#the-file-object
0x00584uint32_tm_closeAfterReadHolds 1 when SFile::Load hands the file to an overlapped read, whose worker then closes itverified, proof onestorm/bz#the-file-object
0x005c4uint32_tm_pendingReadsCounts the overlapped reads queued and not yet runverified, proof onestorm/bz#the-file-object