mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-03 12:57:27 +00:00
In a payload process on a PS5 (firmware 12.70), jrand48 and mrand48 return the high 32 bits of the new 48-bit state zero-extended to the 64-bit long, as FreeBSD 11.0 does, so a result with bit 31 set comes back between 0x80000000 and 0xFFFFFFFF. Here they sign-extended it, as FreeBSD 11.1 and later do with an (int32_t) cast. lrand48 and nrand48 already matched the payload process. The tests now pin its results for three seeds and the first six mrand48 values after srand48(1), compare with the host as 32-bit values, and the debt entry records the measurement. AI-assisted: yes Co-Authored-By: Claude Opus 5.5 <[email protected]>