167,6 → 167,21 |
int i; |
unsigned char *p; |
|
/* Do a small self-test to test if the stdlib implementation works as expected, i.e. that it only |
* depends on the seed set by srand() and on nothing else. |
*/ |
srand(0xdc43df3c); |
int selftest1 = rand(); |
int selftest2 = rand(); |
int selftest3 = rand(); |
|
srand(0xdc43df3c); |
if ((rand() != selftest1) || (rand() != selftest2) || (rand() != selftest3)) { |
// This should never happen |
simplealert("Stdcall rand() implementation does not work as expected. Obfuscation operation will be cancelled."); |
return; // apply no obfuscation |
} |
|
/* Very simplistic. meant to hide from casual observation/loading only. |
* Results are platform dependent, but this should not matter. */ |
srand(0xdc43df3c); |