mirror of
https://github.com/vxunderground/VX-API
synced 2024-06-20 13:58:33 +00:00
Create CreatePseudoRandomInteger.cpp
This commit is contained in:
parent
e5c314243c
commit
2742321af0
11
Cryptography Related/CreatePseudoRandomInteger.cpp
Normal file
11
Cryptography Related/CreatePseudoRandomInteger.cpp
Normal file
@ -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));
|
||||
}
|
Loading…
Reference in New Issue
Block a user