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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x420004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x24], eax
xor edi, edi
mov eax, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x14]
push edi
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x10]
push 0x41da5c
push eax
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 8], 0
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov esi, eax
test esi, esi
js 0x4013fb
push edi
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 0x1c]
push eax
push str.ObjectLength
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov esi, eax
test esi, esi
js 0x4013fb
push dword [ebp - 0x1c]
push edi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x4013fb
push 0
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 8]
push eax
push str.BlockLength
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov esi, eax
test esi, esi
js 0x4013fb
push 0
push 0x20
push str.ChainingModeCBC
push str.ChainingMode
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptSetProperty]
mov esi, eax
test esi, esi
js 0x4013fb
mov eax, dword [ebp - 0x20]
push 0
push dword [eax + 4]
push dword [eax]
lea eax, [ebp - 0x18]
push dword [ebp - 0x1c]
push edi
push eax
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
mov esi, eax
test esi, esi
js 0x4013fb
push 1
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push dword [ebp - 8]
push 0
push 0
push dword [ebp + 0xc]
push dword [ebp - 0x24]
push dword [ebp - 0x18]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov esi, eax
test esi, esi
js 0x4013fb
push dword [ebp - 0x14]
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x20], eax
test eax, eax
je 0x4013fb
push 1
lea ecx, [ebp - 0x14]
push ecx
push dword [ebp - 0x14]
push eax
push dword [ebp - 8]
push 0
push 0
push dword [ebp + 0xc]
push dword [ebp - 0x24]
push dword [ebp - 0x18]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov esi, eax
test esi, esi
js 0x4013fb
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x28]
add eax, 0xfffffff0
push eax
push 8
mov dword [ecx], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [ebp - 0x2c]
mov dword [ecx], eax
mov ecx, dword [ebp - 0x28]
push dword [ecx]
mov ecx, dword [ebp - 0x20]
add ecx, 0x10
push ecx
push eax
call fcn.004059d0
add esp, 0xc
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x40140b
push 0
push eax
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x401419
push eax
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
test edi, edi
je 0x401429
push edi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040296b
mov esp, ebp
pop ebp
ret 0x10