Function at 0x4020f0
Capabilities:
Create new key via cryptacquirecontext
Generate random numbers via winapi

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x28]
push ebx
mov ebx, dword [esp + 0x24]
push ebp
mov ebp, dword [esp + 0x2c]
push esi
mov esi, dword [esp + 0x28]
mov dword [esp + 0x20], eax
mov al, byte [esp + 0x38]
mov byte [esp + 0xf], al
mov byte [esp + 0x1c], al
push edi
mov edi, ecx
test al, al
jne 0x40215e
cmp byte [edi], al
jne 0x40215e
push 0xf0000000
push 1
push str.Microsoft_Base_Cryptographic_Provider_v1.0
push 0
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
lea eax, [edi + 0xc]
push eax
push 8
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push 0
push dword [esp + 0x20]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 1
push dword [esp + 0x24]
mov ecx, edi
mov byte [edi], 0
push ebp
push ebx
push esi
call fcn.004029a0
mov ebx, eax
mov ah, byte [esp + 0x13]
lea esi, [ebx + 1]
test ah, ah
jne 0x4021ae
mov al, byte [edi + 0xc]
mov byte [ebx], al
mov al, byte [edi + 0xd]
mov byte [esi], al
mov al, byte [edi + 0xe]
mov byte [ebx + 2], al
mov al, byte [edi + 0xf]
mov byte [ebx + 3], al
mov al, byte [edi + 0x10]
mov byte [ebx + 4], al
mov al, byte [edi + 0x11]
mov byte [ebx + 5], al
mov al, byte [edi + 0x12]
mov byte [ebx + 6], al
mov al, byte [edi + 0x13]
mov byte [ebx + 7], al
jmp 0x4021dc
mov al, byte [ebx]
mov byte [edi + 0xc], al
mov al, byte [esi]
mov byte [edi + 0xd], al
mov al, byte [ebx + 2]
mov byte [edi + 0xe], al
mov al, byte [ebx + 3]
mov byte [edi + 0xf], al
mov al, byte [ebx + 4]
mov byte [edi + 0x10], al
mov al, byte [ebx + 5]
mov byte [edi + 0x11], al
mov al, byte [ebx + 6]
mov byte [edi + 0x12], al
mov al, byte [ebx + 7]
mov byte [edi + 0x13], al
mov ecx, dword [ebp]
cmp ecx, 8
jle 0x402322
mov edx, 7
sub edx, ebx
mov dword [esp + 0x20], edx
mov al, byte [esi + 7]
lea ecx, [esi + 8]
mov byte [esp + 0x14], al
mov al, byte [ecx]
mov byte [esp + 0x15], al
mov al, byte [esi + 9]
mov byte [esp + 0x16], al
mov al, byte [esi + 0xa]
mov byte [esp + 0x17], al
mov al, byte [esi + 0xb]
mov byte [esp + 0x18], al
mov al, byte [esi + 0xc]
mov byte [esp + 0x19], al
mov al, byte [esi + 0xd]
mov byte [esp + 0x1a], al
mov al, byte [esi + 0xe]
mov dword [esp + 0x1c], ecx
mov byte [esp + 0x1b], al
test ah, ah
jne 0x402294
mov al, byte [esi - 1]
xor al, byte [esp + 0x14]
mov byte [esi + 7], al
mov al, byte [esi]
xor al, byte [esp + 0x15]
mov byte [ecx], al
mov ecx, edi
mov al, byte [esi + 1]
xor al, byte [esp + 0x16]
mov byte [esi + 9], al
mov al, byte [esi + 2]
xor al, byte [esp + 0x17]
mov byte [esi + 0xa], al
mov al, byte [esi + 3]
xor al, byte [esp + 0x18]
mov byte [esi + 0xb], al
mov al, byte [esi + 4]
xor al, byte [esp + 0x19]
mov byte [esi + 0xc], al
mov al, byte [esi + 5]
xor al, byte [esp + 0x1a]
mov byte [esi + 0xd], al
mov al, byte [esi + 6]
xor al, byte [esp + 0x1b]
mov byte [esi + 0xe], al
lea eax, [esi + edx]
push eax
push ebx
call dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
jmp 0x40230a
lea eax, [esi + edx]
mov ecx, edi
push eax
push ebx
call dword [esp + 0x2c]
mov al, byte [edi + 0xc]
xor byte [esi + 7], al
mov al, byte [edi + 0xd]
mov ah, byte [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov byte [edi + 0xc], ah
mov ah, byte [esp + 0x15]
xor byte [ecx], al
mov al, byte [edi + 0xe]
mov byte [edi + 0xd], ah
xor byte [esi + 9], al
mov al, byte [edi + 0xf]
mov ah, byte [esp + 0x16]
mov byte [edi + 0xe], ah
xor byte [esi + 0xa], al
mov al, byte [edi + 0x10]
mov ah, byte [esp + 0x17]
mov byte [edi + 0xf], ah
xor byte [esi + 0xb], al
mov al, byte [edi + 0x11]
mov ah, byte [esp + 0x18]
mov byte [edi + 0x10], ah
xor byte [esi + 0xc], al
mov ah, byte [esp + 0x19]
mov al, byte [edi + 0x12]
mov byte [edi + 0x11], ah
xor byte [esi + 0xd], al
mov ah, byte [esp + 0x1a]
mov al, byte [edi + 0x13]
mov byte [edi + 0x12], ah
mov ah, byte [esp + 0x1b]
xor byte [esi + 0xe], al
mov byte [edi + 0x13], ah
mov edx, dword [esp + 0x20]
mov esi, ecx
mov ecx, dword [ebp]
lea eax, [esi + edx]
cmp eax, ecx
mov ah, byte [esp + 0x13]
jl 0x4021f3
test ah, ah
je 0x402374
lea eax, [ebx - 1]
add eax, ecx
mov dl, byte [eax]
nop dword [eax]
lea eax, [eax - 1]
lea ecx, [ecx - 1]
cmp byte [eax], dl
je 0x402330
lea eax, [ecx - 8]
push eax
mov dword [ebp], eax
call fcn.00424380
xor ecx, ecx
add esp, 4
mov esi, eax
cmp dword [ebp], ecx
jle 0x40235f
mov al, byte [ebx + ecx + 8]
mov byte [ecx + esi], al
inc ecx
cmp ecx, dword [ebp]
jl 0x402352
push ebx
call fcn.00424389
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x14
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret 0x14