缥缈止盈
我曾经写过一份关于离散数学的CRNG的报告。为此,我在msvcrt.dll中反汇编了rand():msvcrt.dll:77C271D8 mov ecx, [eax+14h]msvcrt.dll:77C271DB imul ecx, 343FDhmsvcrt.dll:77C271E1 add ecx, 269EC3hmsvcrt.dll:77C271E7 mov [eax+14h], ecx
msvcrt.dll:77C271EA mov eax, ecx
msvcrt.dll:77C271EC shr eax, 10hmsvcrt.dll:77C271EF and eax, 7FFFh所以这是一个LCG,类似(未经测试)...int ms_rand(int& seed){
seed = seed*0x343fd+0x269EC3; // a=214013, b=2531011
return (seed >> 0x10) & 0x7FFF;}