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
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x0000 | 4 | void * | __vfptr | Points at the store's vtable, whose slots 2 and 3 move the window | verified, proof one | net/messages#data-store-reads |
0x0004 | 4 | uint8_t * | m_buffer | Points at the window's bytes: position p is at m_buffer - m_base + p | verified, proof one | net/messages#data-store-reads |
0x0008 | 4 | uint32_t | m_base | Holds the position of the window's first byte | verified, proof one | net/messages#data-store-reads |
0x000c | 4 | uint32_t | m_alloc | Holds the window's length in bytes | verified, proof one | net/messages#data-store-reads |
0x0010 | 4 | uint32_t | m_size | Holds the count of bytes written | verified, proof one | net/messages#data-store-reads |
0x0014 | 4 | uint32_t | m_read | Holds the read cursor, size + 1 once a read has failed | verified, proof one | net/messages#data-store-reads |