Function at 0x40409b
Capabilities:
Create new key via cryptacquirecontext
Delete file

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x84
mov eax, dword [0x408034]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor edi, edi
xor eax, eax
cmp dword [0x40a298], 2
mov esi, ecx
push 0x28
setne al
mov dword [ebp - 0x80], esi
lea ecx, [ebp - 0x58]
mov dword [ebp - 0x6c], edi
push ecx
add eax, 0x1b89
mov dword [ebp - 0x74], edi
push eax
push dword [0x40a224]
mov ebx, edi
call dword [sym.imp.USER32.dll_LoadStringW]
test eax, eax
je 0x40458f
lea eax, [ebp - 0x6c]
mov ecx, 0x40a298
cmp dword [0x40a1d0], ebx
je 0x4041fc
push eax
push esi
push ecx
push edi
push dword [0x40a24c]
lea eax, [ebp - 0x58]
push dword [0x408040]
push dword [0x40a244]
push eax
push edi
call dword [sym.imp.MSSIGN32.dll_PvkGetCryptProv]
test eax, eax
je 0x4041f4
mov ecx, edi
mov dword [ebp - 0x6c], ecx
test ecx, ecx
jne 0x4045ca
cmp dword [0x40a298], ebx
jne 0x40414a
mov dword [0x40a298], 2
cmp dword [0x40a1d0], ebx
je 0x4044b6
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.ole32.dll_CoCreateGuid]
test eax, eax
jne 0x40458f
mov esi, dword [0x40a224]
push 0x42
call sub.msvcrt.dll_malloc
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x404195
test esi, esi
je 0x40418d
push 0x1b6c
push esi
call fcn.00406261
pop ecx
pop ecx
test ebx, ebx
je 0x40458f
push ebx
lea edx, [ebp - 0x68]
call fcn.00405272
push 8
push dword [0x408040]
lea eax, [ebp - 0x6c]
push dword [0x40a244]
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x40458f
mov ecx, dword [0x40a298]
xor esi, esi
inc esi
cmp ecx, esi
jne 0x40437a
cmp dword [0x408040], 0xd
jne 0x40437a
mov ecx, dword [ebp - 0x6c]
mov edx, esi
call fcn.00405d92
test eax, eax
je 0x4045a8
jmp 0x4043a4
mov ecx, dword [ebp - 0x6c]
jmp 0x404130
cmp dword [0x4080fc], 0x20000
jne 0x40429d
push 0x20
push dword [0x408040]
push dword [0x40a244]
push dword [0x40a24c]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x404233
mov dword [ebp - 0x6c], edi
jmp 0x404138
mov esi, dword [0x40a298]
test esi, esi
jne 0x404240
push 2
pop esi
lea eax, [ebp - 0x70]
push eax
push esi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
jne 0x40427b
cmp dword [0x40a298], ebx
je 0x404266
push edi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x40422b
lea eax, [ebp - 0x70]
xor esi, esi
push eax
inc esi
push esi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
je 0x40428f
push dword [ebp - 0x70]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov ecx, dword [ebp - 0x6c]
mov dword [0x40a298], esi
jmp 0x4042cc
push edi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, edi
jmp 0x4042c9
push eax
push esi
push ecx
push dword [0x40a24c]
lea eax, [ebp - 0x58]
push edi
push dword [0x408040]
push dword [0x40a244]
push eax
push edi
call dword [sym.imp.MSSIGN32.dll_PvkGetCryptProv]
mov ecx, eax
neg ecx
sbb ecx, ecx
not ecx
and ecx, dword [ebp - 0x6c]
mov dword [ebp - 0x6c], ecx
test ecx, ecx
je 0x404138
cmp dword [0x40a1f8], ebx
je 0x404130
lea eax, [ebp - 0x70]
mov dword [ebp - 0x78], edi
push eax
push dword [0x40a298]
mov dword [ebp - 0x7c], 4
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
push edi
test eax, eax
je 0x40425b
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x78]
push eax
push 9
push dword [ebp - 0x70]
call dword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
jne 0x404335
push dword [ebp - 0x70]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push edi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, edi
mov dword [ebp - 0x6c], ecx
jmp 0x404338
mov ecx, dword [ebp - 0x6c]
test ecx, ecx
je 0x404138
mov eax, dword [0x40a268]
cmp eax, dword [ebp - 0x78]
je 0x404130
push 0x1ba2
push dword [0x40a224]
call fcn.00406261
pop ecx
pop ecx
push dword [ebp - 0x70]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push edi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
xor eax, eax
jmp 0x4045cc
lea eax, [ebp - 0x74]
push eax
mov eax, dword [0x40a268]
shl eax, 0x10
or eax, esi
push eax
push ecx
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x40458f
push dword [ebp - 0x74]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push edi
push 0x80
push esi
push edi
push esi
push 0xc0000000
push dword [0x40a24c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4043f4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [0x40a24c]
cmp eax, 0x50
jne 0x4043dd
push 0x1b66
jmp 0x4043e2
push 0x1b67
push dword [0x40a224]
call fcn.00406261
add esp, 0xc
xor esi, esi
jmp 0x40442f
xor esi, esi
cmp dword [0x40a298], 1
jne 0x404416
cmp dword [0x408040], 0xd
jne 0x404416
call fcn.00405bd0
test eax, eax
je 0x404416
mov esi, 0x80
push esi
lea eax, [ebp - 0x58]
push eax
push 0
push dword [0x40a298]
push edi
push dword [ebp - 0x6c]
call dword [sym.imp.MSSIGN32.dll_PvkPrivateKeySave]
mov esi, eax
push 0
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 0x10
push dword [0x408040]
lea eax, [ebp - 0x6c]
push dword [0x40a244]
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
and dword [ebp - 0x6c], 0
and esi, eax
cmp edi, 0xffffffff
je 0x404475
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x40447d
push dword [0x40a24c]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test esi, esi
je 0x40458d
lea eax, [ebp - 0x6c]
xor edi, edi
push eax
push dword [ebp - 0x80]
lea eax, [ebp - 0x58]
push 0x40a298
push edi
push dword [0x40a24c]
push dword [0x408040]
push dword [0x40a244]
push eax
push edi
call dword [sym.imp.MSSIGN32.dll_PvkGetCryptProv]
test eax, eax
jne 0x404577
jmp 0x404568
cmp dword [0x4080fc], 0x20000
push 8
pop eax
jne 0x4044c8
push 0x28
pop eax
push eax
push dword [0x408040]
lea eax, [ebp - 0x6c]
push dword [0x40a244]
push dword [0x40a24c]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x40458f
mov ecx, edi
cmp dword [0x40a1e4], ecx
je 0x4044fa
xor ecx, ecx
inc ecx
mov edx, dword [0x40a298]
cmp edx, 1
jne 0x404522
cmp dword [0x408040], 0xd
jne 0x404522
mov edx, ecx
mov ecx, dword [ebp - 0x6c]
call fcn.00405d92
test eax, eax
je 0x4045a8
jmp 0x404548
lea eax, [ebp - 0x74]
push eax
mov eax, dword [0x40a268]
shl eax, 0x10
or eax, ecx
push eax
push edx
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x40458f
push dword [ebp - 0x74]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
lea eax, [ebp - 0x74]
push eax
push dword [0x40a298]
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
je 0x40456d
push dword [ebp - 0x74]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov ecx, dword [ebp - 0x6c]
jmp 0x40457c
push edi
push dword [ebp - 0x6c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, edi
mov dword [ebp - 0x6c], ecx
test ecx, ecx
jne 0x4045bc
push dword [0x40a24c]
push 0x1b68
jmp 0x40459a
xor edi, edi
push dword [0x40a24c]
push 0x1b69
push dword [0x40a224]
call fcn.00406261
add esp, 0xc
mov ecx, dword [ebp - 0x6c]
test ecx, ecx
je 0x4045bc
push edi
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, edi
mov dword [ebp - 0x6c], ecx
test ebx, ebx
je 0x4045ca
push ebx
call sub.msvcrt.dll_free
pop ecx
mov ecx, dword [ebp - 0x6c]
mov eax, ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00406d00
leave
ret