Function at 0x401543
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using aes via winapi
Encrypt or decrypt via wincrypt

Disassembly:
push 0x88
mov eax, 0x43385c
call fcn.0041458d
mov dword [ebp - 0x90], edx
mov esi, ecx
mov dword [ebp - 0x2c], esi
mov edi, dword [ebp + 0xc]
xor ecx, ecx
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x20], 0xa6af1a38
mov dword [ebp - 0x1c], 0x8fcd8faf
mov dword [ebp - 0x18], 0xea29210f
mov dword [ebp - 0x14], 0x9eba47e1
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], 0xf
mov byte [ebp - 0x44], cl
mov dword [ebp - 4], ecx
lea eax, [ebp - 0x28]
push ecx
push 0x18
push str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
push ecx
push eax
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x70], 0x208
mov dword [ebp - 0x6c], 0x6610
mov dword [ebp - 0x68], 0x20
mov dword [ebp - 0x64], 0xd434b2c5
mov dword [ebp - 0x60], 0x9b1eefac
mov dword [ebp - 0x5c], 0x962965b7
mov dword [ebp - 0x58], 0x5a4d9f2
mov dword [ebp - 0x54], 0xe327853
mov dword [ebp - 0x50], 0xa1dd3a5a
mov dword [ebp - 0x4c], 0x5e0cf3bc
mov dword [ebp - 0x48], 0x5e6ec908
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40164f
call ebx
mov dword [edi], eax
call ebx
cmp eax, 0x80090016
jne 0x40162e
push 8
push 0x18
push str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
push 0
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x40164c
call ebx
mov dword [edi], eax
lea eax, [ebp - 0x44]
mov ecx, esi
push eax
call fcn.004017c1
mov eax, dword [ebp - 0x30]
cmp eax, 0x10
jb 0x401776
inc eax
push eax
jmp 0x40176c
and dword [edi], 0
lea eax, [ebp - 0x24]
push eax
push 0
push 0
push 0x2c
lea eax, [ebp - 0x70]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x40167b
call ebx
mov dword [edi], eax
push 0
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x40162e
push 0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 1
push eax
push 4
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
jne 0x4016a6
call ebx
push dword [ebp - 0x24]
mov dword [edi], eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x40166e
push 0
lea eax, [ebp - 0x20]
push eax
push 1
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x401697
mov eax, dword [ebp + 8]
mov dword [ebp - 0x8c], eax
lea eax, [ebp - 0x8c]
push eax
push dword [ebp - 0x90]
push 0
push 1
push 0
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x40173f
mov ecx, dword [ebp - 0x90]
mov eax, dword [ebp - 0x8c]
push ecx
mov byte [ecx + eax], 0
lea ecx, [ebp - 0x88]
call fcn.00401783
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x88]
cmp dword [ebp - 0x74], 8
mov eax, dword [ebp - 0x78]
cmovae ecx, dword [ebp - 0x88]
lea eax, [ecx + eax*2]
lea ecx, [ebp - 0x88]
cmovae ecx, dword [ebp - 0x88]
push eax
push ecx
lea ecx, [ebp - 0x44]
call fcn.00401848
lea ecx, [ebp - 0x88]
call fcn.004017f4
jmp 0x401743
call ebx
mov dword [edi], eax
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push 0
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
lea eax, [ebp - 0x44]
mov ecx, esi
push eax
call fcn.004017c1
mov ecx, dword [ebp - 0x30]
cmp ecx, 0x10
jb 0x401776
inc ecx
push ecx
push dword [ebp - 0x44]
call fcn.0040196a
pop ecx
pop ecx
mov eax, esi
call fcn.0041453c
ret