Function at 0x46d032
Capabilities:
Create new key via cryptacquirecontext
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x188
push ebx
push ebp
xor eax, eax
xor ebp, ebp
inc eax
mov dword [esp + 8], ebp
push esi
mov esi, edx
mov dword [esp + 0xb8], eax
mov dword [esp + 0xc0], eax
mov ebx, ecx
mov dword [esp + 0xc8], eax
mov dword [esp + 0xd0], eax
lea eax, [esp + 0xb8]
push edi
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x24]
push 0x70
mov dword [esp + 0xb4], eax
lea eax, [esp + 0x12c]
push ebp
push eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], ebp
mov dword [esp + 0xcc], ebp
mov dword [esp + 0xd4], ebp
mov dword [esp + 0xdc], ebp
mov dword [esp + 0xe4], ebp
mov dword [esp + 0x20], ebp
mov dword [esp + 0xc0], ebp
mov dword [esp + 0xc4], ebp
call fcn.0049ee30
add esp, 0xc
mov dword [esp + 0x24], ebp
lea eax, [esp + 0x40]
push 0x70
push ebp
push eax
call fcn.0049ee30
add esp, 0xc
mov dword [esp + 0x40], 2
cmp dword [esi + 0x20], ebp
lea eax, [esp + 0x128]
mov dword [esp + 0xac], eax
lea ecx, [esp + 0xe8]
mov eax, str.1.2.840.113549.1.1.5
mov dword [esp + 0xa8], 3
cmovne eax, dword [esi + 0x20]
mov edx, str.2.5.4.3
push dword [esi + 8]
mov dword [esp + 0x50], eax
call fcn.0046cbc5
pop ecx
test eax, eax
je 0x46d138
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0xe8]
mov dword [esp + eax*8 + 0xc0], ecx
inc eax
mov dword [esp + 0x14], eax
push dword [esi + 0xc]
mov edx, str.2.5.4.11
lea ecx, [esp + 0xfc]
call fcn.0046cbc5
pop ecx
test eax, eax
je 0x46d168
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0xf8]
mov dword [esp + eax*8 + 0xc0], ecx
inc eax
mov dword [esp + 0x14], eax
push dword [esi + 0x10]
mov edx, str.2.5.4.10
lea ecx, [esp + 0x10c]
call fcn.0046cbc5
pop ecx
test eax, eax
je 0x46d198
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x108]
mov dword [esp + eax*8 + 0xc0], ecx
inc eax
mov dword [esp + 0x14], eax
push dword [esi + 0x14]
mov edx, str.2.5.4.6
lea ecx, [esp + 0x11c]
call fcn.0046cbc5
pop ecx
test eax, eax
je 0x46d1c8
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x118]
mov dword [esp + eax*8 + 0xc0], ecx
inc eax
mov dword [esp + 0x14], eax
push ecx
push dword [esp + 0x1a0]
lea edx, [esp + 0x70]
push esi
lea ecx, [esp + 0x6c]
call fcn.0046ce30
add esp, 0xc
lea eax, [esp + 0x70]
lea edx, [esp + 0x14]
push eax
push 7
pop ecx
call fcn.0046c8c3
pop ecx
test eax, eax
je 0x46d709
lea ecx, [esp + 0x70]
call fcn.0046cde4
mov ebp, dword [sym.imp.KERNEL32.dll_LocalFree]
mov edi, eax
test edi, edi
je 0x46d220
push edi
push str._s.cert__subject___:__s_n
call fcn.00409cda
pop ecx
pop ecx
push edi
call ebp
mov ecx, dword [esi + 0x18]
lea edx, [esp + 0x44]
call fcn.0046ccda
test eax, eax
je 0x46d6f2
push str._s.cert__serial____:
call fcn.00409cda
mov edx, dword [esp + 0x48]
pop ecx
mov ecx, dword [esp + 0x48]
push 0
call fcn.0040f762
mov dword [esp], 0x4c75d0
call fcn.00409cda
movzx eax, word [esi + 0x1c]
lea edx, [esp + 0xe0]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0xb0]
pop ecx
lea ecx, [esp + 0x34]
mov dword [esp + 0xdc], 2
mov dword [esp + 0xe0], ecx
mov ecx, str.2.5.29.15
mov dword [eax], ecx
mov dword [eax + 4], 1
add eax, 8
push eax
mov dword [esp + 0xe8], 5
call fcn.0046c8c3
pop ecx
test eax, eax
je 0x46d6db
mov edx, dword [esp + 0xac]
mov ecx, str.2.5.29.19
mov dword [edx + 0x10], ecx
mov eax, dword [esp + 0xb0]
mov dword [edx + 0x14], eax
lea eax, [edx + 0x18]
push eax
lea edx, [esp + 0xb4]
call fcn.0046c8c3
pop ecx
test eax, eax
je 0x46d6bd
mov eax, dword [esi + 0x28]
mov edi, dword [esp + 0xa8]
test eax, eax
je 0x46d315
shl edi, 4
mov esi, eax
add edi, dword [esp + 0xac]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0xa8]
mov esi, dword [esp + 0x20]
inc edi
mov dword [esp + 0xa8], edi
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x46d33f
shl edi, 4
mov esi, eax
add edi, dword [esp + 0xac]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0xa8]
mov esi, dword [esp + 0x20]
inc edi
mov dword [esp + 0xa8], edi
mov esi, dword [esi + 0x30]
test esi, esi
je 0x46d35b
shl edi, 4
add edi, dword [esp + 0xac]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
inc dword [esp + 0xa8]
push dword [esp + 0x4c]
push str._s.cert__algorithm_:__S
call fcn.00409cda
pop ecx
pop ecx
push SysReAllocString
push dword [esp + 0x50]
push 1
call dword [sym.imp.CRYPT32.dll_CryptFindOIDInfo]
test eax, eax
je 0x46d38f
push dword [eax + 8]
push 0x4dc958
call fcn.00409cda
pop ecx
pop ecx
push str._n_s.cert__validity__:
call fcn.00409cda
pop ecx
lea ecx, [esp + 0x60]
call fcn.0040f884
push 0x4ea424
call fcn.00409cda
pop ecx
lea ecx, [esp + 0x68]
call fcn.0040f884
push 0x4c75d0
call fcn.00409cda
pop ecx
push dword [ebx + 4]
push str._s.key___provider__:__s_n
call fcn.00409cda
pop ecx
pop ecx
call fcn.0040f914
mov dword [ebx], eax
test eax, eax
je 0x46d69f
push eax
push str._s.key___container_:__s_n
call fcn.00409cda
mov edi, dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
lea esi, [ebx + 0x28]
pop ecx
pop ecx
push 0xf0000040
push dword [ebx + 8]
push dword [ebx + 4]
push 0
push esi
call edi
test eax, eax
je 0x46d44d
lea eax, [esp + 0x38]
push eax
push ecx
push 0
push ecx
mov ecx, dword [esi]
push 3
pop edx
call fcn.004044e7
add esp, 0x10
test eax, eax
je 0x46d443
mov eax, dword [esp + 0x38]
and eax, 1
mov dword [esp + 0x1c], eax
je 0x46d443
mov edx, dword [ebx + 0x1c]
mov ecx, dword [esi]
and dword [ebx + 0xc], 0xffffffbf
and dword [ebx + 0x20], 0xfffffffe
call fcn.0046cc7b
push 0
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [ebx + 0xc]
or eax, 8
push eax
push dword [ebx + 8]
push dword [ebx + 4]
push dword [ebx]
push esi
call edi
test eax, eax
je 0x46d682
cmp dword [esp + 0x1c], 0
je 0x46d478
mov edx, dword [ebx + 0x1c]
mov ecx, dword [esi]
call fcn.0046cc7b
movzx eax, word [ebx + 0x24]
push eax
push str._s.key___gen___4hu_:
call fcn.00409cda
pop ecx
pop ecx
lea eax, [esp + 0x30]
push eax
movzx eax, word [ebx + 0x24]
shl eax, 0x10
or eax, dword [ebx + 0x20]
push eax
push dword [ebx + 0x18]
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x46d65c
push 0x4ea464
call fcn.00409cda
mov edx, dword [ebx + 0x18]
pop ecx
mov ecx, dword [esi]
call fcn.0046cbf9
mov edx, eax
test edx, edx
je 0x46d650
push 6
pop ecx
mov esi, edx
lea edi, [esp + 0x78]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0xac]
lea ecx, [ecx + 0x20]
call fcn.0046ca4b
test eax, eax
je 0x46d642
mov ecx, dword [esp + 0x19c]
lea eax, [esp + 0x58]
push eax
mov eax, dword [esp + 0xac]
shl eax, 4
add eax, dword [esp + 0xb0]
push eax
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x38]
push eax
call fcn.0046cf37
add esp, 0x14
test eax, eax
je 0x46d566
mov eax, dword [esp + 0xa8]
mov ecx, eax
shl ecx, 4
add ecx, dword [esp + 0xac]
inc eax
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x58]
mov dword [esp + 0xa8], eax
call fcn.0046cde4
mov esi, eax
test esi, esi
je 0x46d576
push esi
push str.__i.cert__subject__:__s_n
call fcn.00409cda
pop ecx
pop ecx
push esi
call ebp
jmp 0x46d576
mov eax, dword [esp + 0x70]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 0x5c], eax
push str._s.cert__signature_:
call fcn.00409cda
mov edx, dword [esp + 0x30]
pop ecx
mov ecx, dword [esp + 0x28]
test ecx, ecx
jne 0x46d5fc
mov edx, dword [ebx + 0x18]
lea esi, [ebx + 0x28]
mov ecx, dword [esi]
push dword [esp + 0x1a8]
mov edi, dword [esp + 0x1a8]
lea eax, [esp + 0x50]
push edi
push eax
lea eax, [esp + 0x4c]
push eax
push ecx
call fcn.0046cd42
add esp, 0x14
mov dword [esp + 0x10], eax
test eax, eax
je 0x46d614
push 0x4ea464
call fcn.00409cda
cmp dword [esp + 0x20], 0
pop ecx
je 0x46d614
push str._s.key___cert.assoc:
call fcn.00409cda
pop ecx
push 0
push dword [edi]
push 0x1a
push dword [esp + 0x3c]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x46d601
push 0x4ea464
call fcn.00409cda
jmp 0x46d613
lea esi, [ebx + 0x28]
jmp 0x46d595
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_generateCertificate___CryptSetKeyParam_KP_CERTIFICATE___0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
mov eax, dword [esp + 0x24]
test eax, eax
je 0x46d621
push dword [eax + 0xc]
call ebp
push dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x40]
call fcn.0046ceb7
mov eax, dword [esp + 0xb0]
pop ecx
add eax, 0x2c
push eax
call ebp
jmp 0x46d650
push str.ERROR_generateCertificate___Unable_to_create_SKI_n
call fcn.00409cda
pop ecx
lea esi, [ebx + 0x28]
push dword [esp + 0x30]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x46d66f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_generateCertificate___CryptGenKey__0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
mov edi, dword [esp + 0x10]
test edi, edi
jne 0x46d6ae
push edi
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x46d699
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_generateCertificate___CryptAcquireContext_CRYPT_NEWKEYSET___0x_08x__n
call fcn.00409cda
mov edi, dword [esp + 0x18]
pop ecx
pop ecx
push dword [ebx]
call ebp
jmp 0x46d6ae
push str.ERROR_generateCertificate___Unable_to_generate_a_container_name_n
call fcn.00409cda
mov edi, dword [esp + 0x14]
pop ecx
mov eax, dword [esp + 0xac]
add eax, 0x1c
push eax
call ebp
jmp 0x46d6cc
push str.ERROR_generateCertificate___Unable_to_create_BC2_n
call fcn.00409cda
mov edi, dword [esp + 0x14]
pop ecx
mov eax, dword [esp + 0xac]
add eax, 0xc
push eax
call ebp
jmp 0x46d6ea
push str.ERROR_generateCertificate___Unable_to_create_KU_n
call fcn.00409cda
mov edi, dword [esp + 0x14]
pop ecx
push dword [esp + 0x48]
call ebp
jmp 0x46d701
push str.ERROR_generateCertificate___Unable_to_create_SN_n
call fcn.00409cda
mov edi, dword [esp + 0x14]
pop ecx
push dword [esp + 0x74]
call ebp
jmp 0x46d716
push str.ERROR_generateCertificate___Unable_to_create_Subject_n
call fcn.00409cda
pop ecx
mov edi, ebp
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x188
ret