benilla-re systems structs docs

NTempest::CRandom::uint32

function · random · primitive

Address
0x4531e0 · 211 bytes, up to 0x4532b2
Signature
uint32_t __thiscall (NTempest::CRndSeed *this)
Meaning
Advances a state: steps its four lanes, adds the XOR of four rotated table dwords to the accumulator, returns it
Confidence
verified, proof two
Name from
the community database (idb)
Finding
random#state-advance
Test
random::crandom_uint32_advance, random::prng_difftest, gx::lightning_segment_subdivide_difftest, models::burst_velocity_difftest, models::emit_shape_plane_difftest, models::emit_shape_sphere_difftest, models::emit_shape_spline_difftest, random::seeded_sequence_difftest

Finding: State advance in random

0x4531e0 moves each lane down by a fixed step, adding the lane's modulus back when the result is negative; reads four dwords of the table at the new byte offsets; XORs them after rotating three of them; adds the result to the accumulator; stores both dwords and returns the new accumulator. With T(n) the dword at byte offset n of 0x802700:

lanebytestepmodulusrotate left
3340xbc1
22120xd42
11240xec3
00280xf40

acc += rotl(T(n3),1) ^ rotl(T(n2),2) ^ rotl(T(n1),3) ^ T(n0), all modulo 2³².

The derivation is in the doc.

Callers 32

Callees 0

None by a direct call or jump.

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