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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x40f008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x20], eax
mov al, byte [ebp + 0x18]
mov dword [ebp - 0x28], ebx
mov byte [ebp - 9], al
mov byte [ebp - 0x1c], al
push edi
mov edi, ecx
test al, al
jne 0x4018d4
cmp byte [edi], al
jne 0x4018d4
push 0xf0000000
push 1
push str.Microsoft_Base_Cryptographic_Provider_v1.0
push 0
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
lea eax, [edi + 0xc]
push eax
push 8
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push 0
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push ecx
push dword [ebp - 0x1c]
mov byte [edi], 0
push ebx
push dword [ebp - 0x2c]
push esi
call fcn.004017c0
mov dl, byte [ebp - 9]
mov ebx, eax
lea esi, [ebx + 1]
test dl, dl
jne 0x401929
movzx eax, byte [edi + 0xc]
mov byte [ebx], al
movzx eax, byte [edi + 0xd]
mov byte [esi], al
movzx eax, byte [edi + 0xe]
mov byte [ebx + 2], al
movzx eax, byte [edi + 0xf]
mov byte [ebx + 3], al
movzx eax, byte [edi + 0x10]
mov byte [ebx + 4], al
movzx eax, byte [edi + 0x11]
mov byte [ebx + 5], al
movzx eax, byte [edi + 0x12]
mov byte [ebx + 6], al
movzx eax, byte [edi + 0x13]
mov byte [ebx + 7], al
jmp 0x40195f
movzx eax, byte [ebx]
mov byte [edi + 0xc], al
movzx eax, byte [esi]
mov byte [edi + 0xd], al
movzx eax, byte [ebx + 2]
mov byte [edi + 0xe], al
movzx eax, byte [ebx + 3]
mov byte [edi + 0xf], al
movzx eax, byte [ebx + 4]
mov byte [edi + 0x10], al
movzx eax, byte [ebx + 5]
mov byte [edi + 0x11], al
movzx eax, byte [ebx + 6]
mov byte [edi + 0x12], al
movzx eax, byte [ebx + 7]
mov byte [edi + 0x13], al
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
cmp ecx, 8
jle 0x401af1
mov cl, byte [ebp - 0x1d]
mov eax, 7
mov byte [ebp - 0x18], cl
sub eax, ebx
mov cl, byte [ebp - 0x1e]
mov byte [ebp - 0x17], cl
mov cl, byte [ebp - 0x1f]
mov byte [ebp - 0x16], cl
mov cl, byte [ebp - 0x20]
mov byte [ebp - 0x15], cl
mov cl, byte [ebp - 0x21]
mov byte [ebp - 0x14], cl
mov cl, byte [ebp - 0x22]
mov byte [ebp - 0x13], cl
mov cl, byte [ebp - 0x23]
mov byte [ebp - 0x12], cl
mov cl, byte [ebp - 0x24]
mov dword [ebp - 8], eax
mov byte [ebp - 0x11], cl
mov dl, byte [esi + 8]
lea ecx, [esi + 8]
mov dh, byte [esi + 7]
mov byte [ebp - 0xa], dl
mov dl, byte [esi + 9]
mov byte [ebp - 0xb], dl
mov dl, byte [esi + 0xa]
mov byte [ebp - 0xc], dl
mov dl, byte [esi + 0xb]
mov byte [ebp - 0xd], dl
mov dl, byte [esi + 0xc]
mov byte [ebp - 0xe], dl
mov dl, byte [esi + 0xd]
mov byte [ebp - 0xf], dl
mov dl, byte [esi + 0xe]
mov byte [ebp - 0x10], dl
mov dl, byte [ebp - 9]
mov dword [ebp - 0x1c], ecx
test dl, dl
jne 0x401a33
movzx eax, byte [esi - 1]
xor al, dh
mov byte [esi + 7], al
movzx eax, byte [esi]
xor al, byte [ebp - 0xa]
mov byte [ecx], al
movzx eax, byte [esi + 1]
xor al, byte [ebp - 0xb]
mov byte [esi + 9], al
movzx eax, byte [esi + 2]
xor al, byte [ebp - 0xc]
mov byte [esi + 0xa], al
movzx eax, byte [esi + 3]
xor al, byte [ebp - 0xd]
mov byte [esi + 0xb], al
movzx eax, byte [esi + 4]
xor al, byte [ebp - 0xe]
mov byte [esi + 0xc], al
movzx eax, byte [esi + 5]
xor al, byte [ebp - 0xf]
mov byte [esi + 0xd], al
movzx eax, byte [esi + 6]
xor al, byte [ebp - 0x10]
mov byte [esi + 0xe], al
mov eax, dword [ebp - 8]
jmp 0x401a60
mov cl, byte [ebp - 0xa]
mov byte [ebp - 0x12], cl
mov cl, byte [ebp - 0xb]
mov byte [ebp - 0x13], cl
mov cl, byte [ebp - 0xc]
mov byte [ebp - 0x14], cl
mov cl, byte [ebp - 0xd]
mov byte [ebp - 0x15], cl
mov cl, byte [ebp - 0xe]
mov byte [ebp - 0x16], cl
mov cl, byte [ebp - 0xf]
mov byte [ebp - 0x17], cl
mov cl, byte [ebp - 0x10]
mov byte [ebp - 0x11], dh
mov byte [ebp - 0x18], cl
add eax, esi
mov ecx, edi
push eax
push ebx
call dword [ebp - 0x20]
mov dl, byte [ebp - 9]
mov ecx, dword [ebp - 0x1c]
test dl, dl
je 0x401ada
movzx eax, byte [edi + 0xc]
xor byte [esi + 7], al
mov al, byte [ebp - 0x11]
mov byte [edi + 0xc], al
movzx eax, byte [edi + 0xd]
xor byte [ecx], al
mov al, byte [ebp - 0x12]
mov byte [edi + 0xd], al
movzx eax, byte [edi + 0xe]
xor byte [esi + 9], al
mov al, byte [ebp - 0x13]
mov byte [edi + 0xe], al
movzx eax, byte [edi + 0xf]
xor byte [esi + 0xa], al
mov al, byte [ebp - 0x14]
mov byte [edi + 0xf], al
movzx eax, byte [edi + 0x10]
xor byte [esi + 0xb], al
mov al, byte [ebp - 0x15]
mov byte [edi + 0x10], al
movzx eax, byte [edi + 0x11]
xor byte [esi + 0xc], al
mov al, byte [ebp - 0x16]
mov byte [edi + 0x11], al
movzx eax, byte [edi + 0x12]
xor byte [esi + 0xd], al
mov al, byte [ebp - 0x17]
mov byte [edi + 0x12], al
movzx eax, byte [edi + 0x13]
xor byte [esi + 0xe], al
mov al, byte [ebp - 0x18]
mov byte [edi + 0x13], al
mov eax, dword [ebp - 0x28]
mov esi, ecx
mov ecx, dword [eax]
mov eax, dword [ebp - 8]
add eax, esi
cmp eax, ecx
mov eax, dword [ebp - 8]
jl 0x4019a7
test dl, dl
je 0x401b4d
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 0x401b00
mov esi, dword [ebp - 0x28]
lea eax, [ecx - 8]
push eax
mov dword [esi], eax
call fcn.0040904b
xor ecx, ecx
add esp, 4
mov edi, eax
cmp dword [esi], ecx
jle 0x401b2f
mov al, byte [ebx + ecx + 8]
mov byte [ecx + edi], al
inc ecx
cmp ecx, dword [esi]
jl 0x401b23
push ebx
call fcn.00409008
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00408ff7
mov esp, ebp
pop ebp
ret 0x14
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00408ff7
mov esp, ebp
pop ebp
ret 0x14