Commit Graph
2 Commits
Author SHA1 Message Date
boykopovar fdf9ca7574 fix(sdk): reconcile public headers after rebase 2026-10-24 23:17:47 +03:00
ionut27001 741c96ca89 fix(libc): seed random() and its default state as measured on a PS5
The libSceLibcInternal of a payload process on a PS5 (firmware 12.70) seeds
the additive feedback generator with a good_rand that reads its argument as an
int32, turns 0 into 123459876 and applies x = 16807 * (x % 127773) - 2836 * (x / 127773),
adding 0x7fffffff to a negative result. Its default state is the state after
srandom(1), not a precomputed table.

Replace the good_rand, build the default state by seeding it with 1 and add a
guest test that pins the first values of a fresh process, the values after each
measured seed and the saved state words of every measured initstate size.
2026-10-21 10:26:06 +03:00