PseudoRandom

more
This commit is contained in:
vxunderground 2021-11-12 12:26:01 -06:00
parent 9cf0aa532a
commit 9d92d6ef39
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
ULONG Next = 2;
INT PseudoRandomIntegerSubroutine(PULONG Context)
{
return ((*Context = *Context * 1103515245 + 12345) % ((ULONG)RAND_MAX + 1));
}
INT PseudoRandomInteger(VOID)
{
return (PseudoRandomIntegerSubroutine(&Next));
}