Function at 0x40b800
Capabilities:
Generate random numbers via winapi
Hash data using sha1
Hash data using sha1 via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40ed21
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x6c8
mov eax, dword [0x4138d0]
push ebx
push esi
push edi
lea ecx, [esp + 0x48]
mov dword [esp + 0x6cc], eax
mov dword [esp + 0x1c], 0x80
call fcn.0040c090
mov esi, dword [ebp + 8]
xor eax, eax
mov ecx, 0x20
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x1c]
push ecx
lea eax, [esp + 0x4c]
push 2
push esi
mov dword [esp + 0x2c], eax
call fcn.0040c490
add esp, 0xc
test eax, eax
jne 0x40b87c
push eax
push esi
call fcn.0040b640
add esp, 8
jmp 0x40ba37
mov al, byte [esp + 0xb8]
xor ebx, ebx
cmp al, bl
je 0x40b8d4
lea edx, [esp + 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
mov ax, word [esp + 0x3a]
cmp ax, 0x1c
jbe 0x40b8a8
mov ax, 0x1c
mov word [esp + 0x3a], ax
mov cl, byte [esp + 0xb8]
movzx edx, ax
movzx edi, cl
inc edx
cmp edi, edx
je 0x40b8c5
cmp cl, 1
jne 0x40b8d4
cmp ax, 0x1b
jbe 0x40b8d4
push ebx
push esi
call fcn.0040b640
add esp, 8
jmp 0x40ba37
lea eax, [esp + 0xc8]
push eax
push ebx
push esi
call fcn.0040c0b0
add esp, 0xc
mov dword [esp + 0x14], ebx
push 0x20
push 1
push str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
lea ecx, [esp + 0xd4]
push ecx
lea edx, [esp + 0x24]
push edx
mov dword [esp + 0x6f0], ebx
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x40b920
push ebx
push esi
call fcn.0040b640
add esp, 8
jmp 0x40ba23
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x2c8]
push eax
push 0x400
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x24], 0x100
mov dword [esp + 0x18], ebx
mov eax, dword [esp + 0x14]
mov edi, dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
lea edx, [esp + 0x10]
push edx
push ebx
push ebx
push 0x8004
push eax
mov byte [esp + 0x6f0], 2
call edi
test eax, eax
je 0x40b9f8
mov edx, dword [esp + 0x10]
push ebx
push 0x400
lea ecx, [esp + 0x2d0]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40b9f8
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x14c]
push ecx
push ebx
push ebx
push 2
push edx
call dword [sym.imp.ADVAPI32.dll_CryptSignHashA]
test eax, eax
je 0x40b9f8
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x18]
push eax
push 2
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
je 0x40b9f8
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
push ebx
push ebx
push edx
mov edx, dword [esp + 0x1c]
push eax
lea ecx, [esp + 0x158]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CryptVerifySignatureA]
test eax, eax
jne 0x40ba5a
push ebx
lea ecx, [esp + 0x18]
call fcn.0040dbc0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push ebx
push esi
call fcn.0040b640
lea ecx, [esp + 0x20]
add esp, 8
mov byte [esp + 0x6dc], 1
call fcn.0040d950
lea ecx, [esp + 0x10]
mov byte [esp + 0x6dc], bl
call fcn.0040dbb0
lea ecx, [esp + 0x14]
mov dword [esp + 0x6dc], 0xffffffff
call fcn.0040d910
xor eax, eax
mov ecx, dword [esp + 0x6d4]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x6cc]
call fcn.0040e0fe
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x10]
call fcn.0040dbc0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x10]
push eax
push ebx
push ebx
push 0x8004
push ecx
call edi
test eax, eax
je 0x40b9f8
lea edx, [esp + 0x1c]
push edx
call fcn.0040dbf0
add esp, 4
test eax, eax
je 0x40b9f8
mov eax, dword [esp + 0x1c]
push eax
push esi
lea ecx, [esp + 0x3c]
push str._08X_08X
push ecx
call dword [sym.imp.MSVCR71.dll_sprintf]
mov eax, dword [esp + 0x20]
add esp, 0x10
push ebx
push 0x10
lea edx, [esp + 0x3c]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40b9f8
mov eax, dword [esp + 0x18]
mov edi, dword [sym.imp.ADVAPI32.dll_CryptExportKey]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x2cc]
push edx
push ebx
push 6
push ebx
push eax
mov dword [esp + 0x34], 0x400
call edi
test eax, eax
je 0x40b9f8
lea ecx, [esp + 0x18]
call fcn.0040dbc0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x10]
push ebx
push ecx
lea edx, [esp + 0x2d0]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40b9f8
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push ecx
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
je 0x40b9f8
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x2cc]
push ecx
push ebx
push 6
push ebx
push edx
mov dword [esp + 0x40], 0x400
call edi
test eax, eax
je 0x40b9f8
lea ecx, [esp + 0x18]
call fcn.0040dbc0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x10]
push ebx
push eax
lea ecx, [esp + 0x2d0]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x40b9f8
call fcn.0040d9c0
lea ecx, [esp + 0x18]
push ecx
push ebx
push ebx
push eax
push edx
mov edx, dword [esp + 0x28]
push edx
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
je 0x40b9f8
lea ecx, [esp + 0x2c]
push ecx
lea eax, [esp + 0x24c]
push 1
push esi
mov dword [esp + 0x38], 0x80
mov dword [esp + 0x3c], eax
call fcn.0040c490
add esp, 0xc
test eax, eax
push ebx
je 0x40b9f9
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
push ebx
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CryptVerifySignatureA]
test eax, eax
jne 0x40bc17
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40b9f8
lea ecx, [esp + 0x18]
mov byte [esp + 0x6dc], 1
call fcn.0040d950
lea ecx, [esp + 0x10]
mov byte [esp + 0x6dc], bl
call fcn.0040dbb0
lea ecx, [esp + 0x14]
mov dword [esp + 0x6dc], 0xffffffff
call fcn.0040d910
mov eax, 1
jmp 0x40ba39