benilla-re systems structs docs

CDataStore

struct · base · 24 bytes

Vtable
0x7ff9e4
Meaning
Holds a packet buffer: a window onto its bytes, the size written and a read cursor
Confidence
verified, proof one
Finding
net/messages#data-store-reads

Finding: Data store reads in net: messages

A data store's buffer (+0x4) holds the bytes from position +0x8 for +0xc bytes; the size is +0x10, the cursor +0x14. Each read of n bytes tests cursor + n > size, as an unsigned add with no overflow guard, then asks vtable slot 2 to move the window when the bytes lie outside it; the plain store (0x417c20) and the network layer's always refuse. Either failure sets the cursor to size + 1, so every later read fails, with no error flag; a fixed-width read leaves its destination unwritten. GetData copies chunks of at most the bytes remaining, the window and the count, at least 1: a count past the size copies what remains, then poisons the cursor.

The derivation is in the doc.

Fields 6

offsetsizetypenamemeaningconfidencefinding
0x00004void *__vfptrPoints at the store's vtable, whose slots 2 and 3 move the windowverified, proof onenet/messages#data-store-reads
0x00044uint8_t *m_bufferPoints at the window's bytes: position p is at m_buffer - m_base + pverified, proof onenet/messages#data-store-reads
0x00084uint32_tm_baseHolds the position of the window's first byteverified, proof onenet/messages#data-store-reads
0x000c4uint32_tm_allocHolds the window's length in bytesverified, proof onenet/messages#data-store-reads
0x00104uint32_tm_sizeHolds the count of bytes writtenverified, proof onenet/messages#data-store-reads
0x00144uint32_tm_readHolds the read cursor, size + 1 once a read has failedverified, proof onenet/messages#data-store-reads