Function at 0x4a1d20
Capabilities:
Generate random numbers via winapi

Disassembly:
sub esp, 0x1c
mov al, byte [esp + 0x28]
test al, al
push esi
push edi
mov dword [esp + 8], 0
je 0x4a1dd4
mov eax, dword [0x6b7bdc]
test eax, eax
jne 0x4a1db8
push 0xf0000000
push 1
push 0
push 0
push 0x6b7bdc
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x4a1db8
mov eax, dword [esp + 8]
test eax, eax
je 0x4a1e86
mov ecx, dword [eax]
and ecx, 0xff
cmp ecx, 0x80
mov esi, eax
jae 0x4a1e86
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
and eax, 0xff
cmp eax, 0x7f
jne 0x4a1e75
mov edx, dword [esi]
and edx, 0xff
cmp edx, 0x80
jae 0x4a1e70
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
and eax, 0xff
jmp 0x4a1e75
mov edx, dword [0x6b7bdc]
lea ecx, [esp + 0xc]
push ecx
push 8
push edx
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
neg eax
sbb eax, eax
neg eax
jmp 0x4a1ddf
lea eax, [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
test eax, eax
je 0x4a1d5c
call fcn.00489814
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
push eax
mov eax, dword [esp + 0x30]
push ecx
push edx
push eax
lea ecx, [esp + 0x18]
push str._d__I64d__d
push ecx
call fcn.00403a60
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x24]
push eax
call fcn.004a16a0
mov edi, eax
add esp, 0x20
test edi, edi
je 0x4a1ead
mov eax, dword [esp + 8]
test eax, eax
je 0x4a1ea5
mov ecx, dword [eax]
and ecx, 0xff
cmp ecx, 0x80
mov esi, eax
jae 0x4a1ea5
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
and eax, 0xff
cmp eax, 0x7f
jne 0x4a1e94
mov edx, dword [esi]
and edx, 0xff
cmp edx, 0x80
jae 0x4a1e8f
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
and eax, 0xff
jmp 0x4a1e94
mov eax, 0xff
test eax, eax
jne 0x4a1e86
mov eax, dword [esp + 8]
push eax
call fcn.00499410
add esp, 4
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x1c
ret
mov eax, 0xff
test eax, eax
jne 0x4a1ea5
mov eax, dword [esp + 8]
push eax
call fcn.00499410
add esp, 4
mov eax, edi
pop edi
pop esi
add esp, 0x1c
ret
mov esi, dword [esp + 0x28]
lea ecx, [esp + 0x14]
push esi
push ecx
call fcn.004a1b90
mov eax, dword [esi]
add esp, 8
test eax, eax
je 0x4a1f33
mov eax, dword [eax]
shr eax, 8
test eax, eax
je 0x4a1f33
mov eax, dword [esp + 8]
test eax, eax
je 0x4a1f2b
mov edx, dword [eax]
and edx, 0xff
cmp edx, 0x80
mov esi, eax
jae 0x4a1f2b
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
and eax, 0xff
cmp eax, 0x7f
jne 0x4a1f1a
mov eax, dword [esi]
and eax, 0xff
cmp eax, 0x80
jae 0x4a1f15
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
and eax, 0xff
jmp 0x4a1f1a
mov eax, 0xff
test eax, eax
jne 0x4a1f2b
mov ecx, dword [esp + 8]
push ecx
call fcn.00499410
add esp, 4
pop edi
xor eax, eax
pop esi
add esp, 0x1c
ret
mov eax, dword [esp + 8]
test eax, eax
je 0x4a1f90
mov edx, dword [eax]
and edx, 0xff
cmp edx, 0x80
mov esi, eax
jae 0x4a1f90
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
and eax, 0xff
cmp eax, 0x7f
jne 0x4a1f7f
mov eax, dword [esi]
and eax, 0xff
cmp eax, 0x80
jae 0x4a1f7a
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
and eax, 0xff
jmp 0x4a1f7f
mov eax, 0xff
test eax, eax
jne 0x4a1f90
mov ecx, dword [esp + 8]
push ecx
call fcn.00499410
add esp, 4
pop edi
mov eax, 4
pop esi
add esp, 0x1c
ret