Create CreatePseudoRandomInteger.cpp

This commit is contained in:
vxunderground 2022-07-14 22:21:13 -05:00 committed by GitHub
parent e5c314243c
commit 2742321af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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