Function at 0x4038a0
Capabilities:
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push esi
push edi
xor edi, edi
test byte [0x42089c], 1
mov ebx, eax
jne 0x4038dc
or dword [0x42089c], 1
push 0x418c40
mov dword [0x420898], edi
mov dword [0x420894], edi
mov dword [0x420890], edi
call fcn.004096b5
add esp, 4
xor eax, eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 8], edi
cmp dword [ebx + 0x48], edi
je 0x40393e
mov eax, dword [ebx + 0x30]
mov ecx, dword [ebx + 0x34]
mov edx, dword [ebx + 0x38]
mov dword [ebp - 0x38], eax
mov eax, dword [ebx + 0x3c]
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebx + 0x40]
mov dword [ebp - 0x30], edx
mov edx, dword [ebx + 0x44]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], edx
cmp dword [ebx + 0x2c], edi
je 0x403baf
mov eax, dword [ebx + 0x20]
mov edi, dword [ebx + 0x24]
push eax
mov esi, 0x420890
call fcn.004017d0
mov ecx, dword [ebx + 0x2c]
mov dword [ebp - 8], ecx
jmp 0x403bad
mov dword [ebp - 0x14], edi
push 0x4207a0
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x10], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x4207b8]
cmp dword [esi + 0x10], edi
je 0x4039c4
lea eax, [ebp - 0x20]
mov ecx, esi
call fcn.00402910
mov ecx, dword [eax]
cmp ecx, edi
jne 0x403971
xor edx, edx
jmp 0x403973
mov edx, dword [ecx]
mov ecx, dword [eax + 8]
mov edi, dword [edx + 8]
mov eax, ecx
shr eax, 1
and ecx, 1
cmp edi, eax
ja 0x403986
sub eax, edi
cmp dword [esi + 0x10], 0
mov edx, dword [edx + 4]
mov eax, dword [edx + eax*4]
lea eax, [eax + ecx*8]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], eax
mov ecx, esi
je 0x4039c2
inc dword [esi + 0xc]
lea eax, [esi + 0xc]
mov esi, dword [ecx + 8]
add esi, esi
cmp esi, dword [eax]
ja 0x4039b7
mov dword [eax], 0
xor edi, edi
dec dword [ecx + 0x10]
jne 0x4039c4
mov dword [eax], edi
jmp 0x4039c4
xor edi, edi
push 0x4207a0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 0x10], edi
je 0x403af1
mov esi, dword [ebp - 0xc]
cmp esi, edi
je 0x403af1
add esi, dword [ebp - 8]
cmp dword [0x420890], edi
jne 0x403a49
cmp esi, edi
jg 0x4039fd
mov dword [0x420894], edi
jmp 0x403ab7
push esi
cmp esi, dword [0x420894]
jg 0x403a15
push edi
push edi
call fcn.0040e850
add esp, 0xc
jmp 0x403abd
mov dword [0x420894], edi
mov dword [0x420890], edi
call fcn.00409507
add esp, 4
mov dword [0x420890], eax
cmp eax, edi
je 0x403abd
push esi
push edi
push eax
mov dword [0x420894], esi
call fcn.0040e850
add esp, 0xc
jmp 0x403abd
cmp esi, dword [0x420894]
jle 0x403abd
push esi
call fcn.00409507
mov edi, eax
add esp, 4
test edi, edi
jne 0x403a80
mov eax, dword [0x420890]
test eax, eax
je 0x403a72
push eax
call fcn.00409587
add esp, 4
xor eax, eax
mov dword [0x420894], eax
mov dword [0x420890], eax
jmp 0x403abd
push esi
push 0
push edi
call fcn.0040e850
mov edx, dword [0x420894]
mov eax, dword [0x420890]
push edx
push eax
push edi
call fcn.0040e8d0
mov eax, dword [0x420890]
add esp, 0x18
test eax, eax
je 0x403ab1
push eax
call fcn.00409587
add esp, 4
mov dword [0x420894], esi
mov dword [0x420890], edi
mov ecx, dword [ebp - 0xc]
mov edx, dword [0x420890]
mov edi, dword [ebp - 0x10]
add edx, dword [ebp - 8]
push ecx
push edi
push edx
call fcn.0040e8d0
inc dword [ebp - 0x14]
push edi
mov dword [ebp - 8], esi
call fcn.00409587
add esp, 0x10
xor edi, edi
cmp esi, 0x5000
jb 0x403941
cmp dword [ebp - 8], edi
je 0x403af9
mov dword [ebp + 8], edi
cmp dword [ebx + 0x18], 0
mov edi, dword [0x420578]
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x10], 0
je 0x403b3a
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebx + 0x18]
lea ecx, [ebp - 0x10]
push ecx
push 4
push edx
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
jne 0x403b42
call dword [sym.imp.KERNEL32.dll_GetTickCount]
jmp 0x403b45
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebx + 0x1c]
cmp eax, ecx
jne 0x403b4f
lea eax, [ecx + 1]
cmp dword [ebp - 8], 0
mov ecx, dword [ebp + 8]
mov esi, dword [ebp - 0x14]
mov dword [ebx + 0x1c], eax
mov edx, dword [0x420484]
mov dword [ebx + 0x30], edi
mov edi, dword [ebp - 0x34]
mov dword [ebx + 0x34], edi
mov dword [ebx + 0x38], eax
mov dword [ebx + 0x3c], ecx
mov dword [ebx + 0x40], edx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x24], esi
mov dword [ebx + 0x48], 1
mov dword [ebx + 0x2c], 0
mov dword [ebx + 0x44], esi
je 0x403bad
mov eax, dword [0x420890]
mov edi, dword [0x420894]
lea esi, [ebx + 0x20]
push eax
call fcn.004017d0
mov ecx, dword [ebp - 8]
mov dword [ebx + 0x2c], ecx
xor edi, edi
mov esi, dword [ebp + 0x10]
mov dword [esi], edi
mov edi, dword [ebp + 0xc]
lea edx, [ebp - 0x38]
push esi
push edx
mov ecx, edi
call fcn.00401240
mov esi, dword [esi]
add esp, 8
test esi, esi
je 0x403bf9
mov edi, dword [edi]
test edi, edi
je 0x403bf9
mov eax, 0x420440
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403be0
sub eax, edx
push 0x420440
push esi
mov ecx, eax
call fcn.00402390
add esp, 8
mov esi, dword [ebp - 8]
mov ebx, dword [ebp + 0x18]
mov dword [ebx], 0
test esi, esi
je 0x403c52
mov edi, dword [0x420890]
test edi, edi
je 0x403c52
mov eax, 0x420440
lea edx, [eax + 1]
jmp 0x403c20
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403c20
sub eax, edx
push 0x420440
push esi
mov ecx, eax
call fcn.00402390
mov eax, dword [0x420890]
mov edi, dword [0x420894]
mov esi, dword [ebp + 0x14]
add esp, 8
push eax
call fcn.004017d0
mov ecx, dword [ebp - 8]
mov dword [ebx], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14