Function at 0x406430
Capabilities:
Encrypt or decrypt data via bcrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x5c], eax
lea eax, [edx - 0x10]
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x54], eax
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x68], 0
push ebx
lea ebx, [eax - 0xf]
push esi
push edi
cmp edx, 0x1f
jae 0x406495
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041005d
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0xc
call esi
push ebx
mov dword [ebp - 0x64], eax
call esi
push 0x10
mov ebx, eax
call esi
mov esi, dword [ebp - 0x64]
add esp, 0xc
mov edi, eax
test esi, esi
je 0x4065d4
test ebx, ebx
je 0x4065d4
test edi, edi
je 0x4065d4
mov edx, dword [ebp - 0x58]
movq xmm0, qword [edx + 3]
movq qword [esi], xmm0
mov eax, dword [edx + 0xb]
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x54]
add eax, 0xfffffff1
push eax
lea eax, [edx + 0xf]
push eax
push ebx
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x54]
add esp, 0xc
mov ecx, dword [ebp - 0x58]
push 0
movups xmm0, xmmword [eax + ecx]
push 0
push 0x41212c
lea eax, [ebp - 8]
push eax
movups xmmword [edi], xmm0
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
js 0x4065d4
push 0
push 0x20
push str.ChainingModeGCM
push str.ChainingMode
push dword [ebp - 8]
call dword [sym.imp.bcrypt.dll_BCryptSetProperty]
test eax, eax
js 0x4065d4
push 0
push dword [ebp + 0xc]
lea eax, [ebp - 0xc]
push dword [ebp - 0x6c]
push 0
push 0
push eax
push dword [ebp - 8]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
test eax, eax
js 0x4065d4
push 0
lea eax, [ebp - 0x10]
mov dword [ebp - 0x50], 0x40
push eax
mov eax, dword [ebp - 0x5c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x40], xmm0
movlpd qword [ebp - 0x30], xmm0
movlpd qword [ebp - 0x28], xmm0
push dword [eax]
lea eax, [ebp - 0x50]
movlpd qword [ebp - 0x20], xmm0
push dword [ebp - 0x60]
movlpd qword [ebp - 0x18], xmm0
push 0
push 0
push eax
mov eax, dword [ebp - 0x54]
add eax, 0xfffffff1
mov dword [ebp - 0x4c], 1
push eax
push ebx
push dword [ebp - 0xc]
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x44], 0xc
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x34], 0x10
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
test eax, eax
js 0x4065d4
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x68], 1
mov dword [ecx], eax
mov ecx, dword [ebp - 0x60]
mov byte [ecx + eax], 0
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x4065e2
push eax
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
mov eax, dword [ebp - 8]
test eax, eax
je 0x4065f2
push 0
push eax
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
test esi, esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
je 0x406605
mov eax, dword [ebp - 0x64]
push eax
call esi
add esp, 4
test ebx, ebx
je 0x40660f
push ebx
call esi
add esp, 4
test edi, edi
je 0x406619
push edi
call esi
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x68]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0041005d
mov esp, ebp
pop ebp
ret