benilla-re systems structs docs

DrawRandomPoolBytes

function · net · primitive

Address
0x5d1cf0 · 192 bytes, up to 0x5d1daf
Signature
void __thiscall (void *this, uint8_t *out, uint32_t count)
Meaning
Copies count bytes from a random pool, refilling its 20-byte block with SHA-1 of seed, last block and seed when spent
Confidence
verified, proof one
Finding
net/login#random-pool
Test
net::sha1_prng_next, net::srp6_client_session

Finding: Random pool in net: login

The pool is a SHA-1 generator of 64 bytes: a 20-byte seed hash, a 20-byte copy of it, a 20-byte output block and a count of unused output bytes. Seeding with s hashes the 12 bytes time(0), s and the C runtime's rand() after srand(s). Drawing takes the unused tail of the block; when it runs out, the block becomes H(seed ‖ block ‖ copy). The pool at 0xc2a428 is seeded at startup with the client clock and is the one SRP6 draws a from.

The derivation is in the doc.

Callers 3

Callees 3

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