Function at 0x10020050
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using aes via winapi

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100acc5e
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x98
mov eax, dword [0x100d800c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x88], eax
mov edi, dword [ebx + 8]
add eax, 0x14
push 0xf0000040
push 0x18
push str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
push 0
push eax
mov dword [ebp - 0x8c], eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x10020356
xorps xmm0, xmm0
movlpd qword [ebp - 0x28], xmm0
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], 0
push 8
push str.Microsoft_Primitive_Provider
mov dword [ebp - 4], 1
lea eax, [ebp - 0x24]
mov esi, dword [edi + 4]
mov ecx, esi
push str.SHA512
push eax
call dword [0x100b42b0]
call esi
test eax, eax
js 0x10020372
push ecx
xorps xmm0, xmm0
mov dword [ebp - 0x18], 0
push 0x20
lea ecx, [ebp - 0x20]
movq qword [ebp - 0x20], xmm0
call fcn.100205a0
push ecx
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x34]
xorps xmm0, xmm0
mov dword [ebp - 0x2c], 0
push 0x10
movq qword [ebp - 0x34], xmm0
call fcn.100205a0
mov byte [ebp - 4], 4
xorps xmm0, xmm0
mov ecx, dword [ebp - 0x1c]
sub ecx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
sub eax, dword [ebp - 0x34]
push ecx
add eax, ecx
movq qword [ebp - 0x40], xmm0
push eax
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x38], 0
call fcn.100205a0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x4c]
xorps xmm0, xmm0
mov dword [ebp - 0x44], 0
movq qword [ebp - 0x4c], xmm0
call fcn.1001eaa0
mov byte [ebp - 4], 6
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x4c]
sub ecx, eax
mov esi, dword [ebp - 0x48]
mov edi, dword [edi + 0xc]
sub esi, edx
push 0
push ecx
push eax
push 0
push 0xc350
push dword [ebx + 0x10]
mov ecx, edi
push dword [ebx + 0xc]
push esi
push edx
push dword [ebp - 0x24]
call dword [0x100b42b0]
call edi
test eax, eax
js 0x1002038b
lea ecx, [ebp - 0x4c]
call fcn.10020530
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x40]
sub ecx, eax
je 0x10020205
test eax, eax
je 0x100201f2
push ecx
test edx, edx
je 0x100201e7
push edx
push eax
call fcn.10083c30
add esp, 0xc
jmp 0x10020202
push 0
push eax
call fcn.10083a60
add esp, 0xc
call fcn.10086f38
mov dword [eax], 0x16
call fcn.100869af
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x30]
sub ecx, eax
mov eax, dword [ebp - 0x40]
mov esi, dword [ebp - 0x34]
add eax, ecx
sub edx, esi
je 0x10020249
test esi, esi
je 0x10020239
push edx
test eax, eax
je 0x1002022e
push eax
push esi
call fcn.10083c30
add esp, 0xc
jmp 0x10020249
push 0
push esi
call fcn.10083a60
add esp, 0xc
call fcn.10086f38
mov dword [eax], 0x16
call fcn.100869af
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 4
call fcn.10020530
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x84], 0x208
mov dword [ebp - 0x80], 0x6610
mov dword [ebp - 0x7c], 0x20
sub eax, ecx
je 0x100202c1
test ecx, ecx
je 0x10020290
cmp eax, 0x20
ja 0x10020290
push eax
push ecx
lea eax, [ebp - 0x78]
push eax
call fcn.10083c30
add esp, 0xc
jmp 0x100202c1
xorps xmm0, xmm0
movups xmmword [ebp - 0x78], xmm0
movups xmmword [ebp - 0x68], xmm0
test ecx, ecx
jne 0x100202ac
call fcn.10086f38
mov dword [eax], 0x16
jmp 0x100202bc
cmp eax, 0x20
jbe 0x100202c1
call fcn.10086f38
mov dword [eax], 0x22
call fcn.100869af
mov esi, dword [ebp - 0x88]
lea eax, [ebp - 0x84]
add esi, 0x18
push esi
push 1
push 0
push 0x2c
push eax
mov eax, dword [ebp - 0x8c]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
je 0x100203aa
push 0
push dword [ebp - 0x34]
push 1
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x100203c9
lea ecx, [ebp - 0x34]
call fcn.10020530
lea ecx, [ebp - 0x20]
call fcn.10020530
mov dword [ebp - 4], 0xa
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x10020336
push 0
push eax
mov eax, dword [ebp - 0x28]
mov esi, dword [eax + 8]
mov ecx, esi
call dword [0x100b42b0]
call esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.1006d58e
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0xc
push str.CryptAcquireContext_failed
lea ecx, [ebp - 0x58]
call fcn.10005d60
lea ecx, [ebp - 0x58]
mov dword [ebp - 4], 0
call fcn.1000a520
push str.Error_opening_SHA512_provider
lea ecx, [ebp - 0x58]
call fcn.10005d60
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 2
call fcn.1000a520
push str.Error_computing_PBKDF2_using_SHA512_provider
lea ecx, [ebp - 0xa4]
call fcn.10005d60
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 7
call fcn.1000a520
push str.Encrypt:_CryptImportKey_failed
lea ecx, [ebp - 0xa4]
call fcn.10005d60
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 8
call fcn.1000a520
push str.Encrypt:_CryptSetKeyParam_IV__failed
lea ecx, [ebp - 0xa4]
call fcn.10005d60
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 9
call fcn.1000a520
int3