vxug-VXAPI/Cryptography Related/CreatePseudoRandomInteger.cpp

12 lines
245 B
C++
Raw Normal View History

2022-07-15 03:21:13 +00:00
ULONG Next = 2; //seed
INT PseudoRandomIntegerSubroutine(PULONG Context)
{
return ((*Context = *Context * 1103515245 + 12345) % ((ULONG)RAND_MAX + 1));
}
INT CreatePseudoRandomInteger(VOID)
{
return (PseudoRandomIntegerSubroutine(&Next));
}