Function at 0x401000
Capabilities:
Encrypt or decrypt data via bcrypt
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x420004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x14]
push edi
mov dword [ebp - 0x38], eax
lea eax, [esi + 0x10]
push eax
push 0
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
push 0
mov edi, eax
lea eax, [ebp - 0x20]
push 0x41dad4
push eax
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
js 0x4010a6
push 0
push 0x10
push edi
push dword [ebp - 0x20]
call dword [sym.imp.bcrypt.dll_BCryptGenRandom]
push 0
push dword [ebp - 0x20]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
push esi
push dword [ebp - 0x2c]
lea eax, [edi + 0x10]
push eax
call fcn.004059d0
add esp, 0xc
lea eax, [ebp - 0x10]
push 0
push 0
push 0x41da5c
push eax
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
mov esi, eax
test esi, esi
js 0x4011e5
push 0
lea eax, [ebp - 8]
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 0x4011e5
push dword [ebp - 0x1c]
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x4011e5
push 0
lea eax, [ebp - 8]
push eax
push 4
lea eax, [ebp - 0xc]
push eax
push str.BlockLength
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov esi, eax
test esi, esi
js 0x4011e5
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 0x4011e5
mov eax, dword [ebp - 0x30]
push 0
push dword [eax + 4]
push dword [eax]
lea eax, [ebp - 0x18]
push dword [ebp - 0x1c]
push ebx
push eax
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
mov esi, eax
test esi, esi
js 0x4011e5
push 1
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push dword [ebp - 0xc]
push 0
push 0
push dword [ebp - 0x24]
push edi
push dword [ebp - 0x18]
call dword [sym.imp.bcrypt.dll_BCryptEncrypt]
mov esi, eax
test esi, esi
js 0x4011e5
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x4011e5
push 1
lea eax, [ebp - 8]
push eax
push dword [ebp - 0x14]
push ebx
push dword [ebp - 0xc]
push 0
push 0
push dword [ebp - 0x24]
push edi
push dword [ebp - 0x18]
call dword [sym.imp.bcrypt.dll_BCryptEncrypt]
mov esi, eax
test esi, esi
js 0x4011e5
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
mov dword [eax], ebx
mov eax, dword [ebp - 0x14]
mov dword [ecx], eax
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x4011ff
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0
call edi
push eax
call ebx
jmp 0x401205
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x401215
push 0
push eax
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x401223
push eax
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x401232
push eax
push 0
call edi
push eax
call ebx
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