vxug-VXAPI/Cryptography Related/CreatePseudoRandomInteger.cpp
2022-07-14 22:21:13 -05:00

12 lines
245 B
C++

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