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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x546339
mov eax, dword fs:[0]
push eax
sub esp, 0x94
push ebx
push esi
push edi
mov eax, dword [0x5bf364]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, edx
mov edi, ecx
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x20], 0x80
cmp ebx, 1
jge 0x413f13
mov ebx, 1
jmp 0x413f1d
mov eax, 2
cmp ebx, eax
cmovg ebx, eax
mov eax, dword [0x5c6d3c]
test eax, eax
jne 0x413f39
cmp dword [0x5c6d54], 0
mov eax, 0x580994
cmovne eax, dword [0x5c6d4c]
push 0
push 0
push eax
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
jns 0x413f9c
mov dword [edi], vtable.CVolObject.0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [ebp - 4], 1
mov dword [edi], vtable.CVolMem.0
mov dword [edi + 0xc], 0
mov dword [edi + 0x14], 0
mov dword [edi + 0x10], 0
mov dword [edi + 0x18], 0x40
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 1
jmp 0x414366
mov edx, dword [0x5c721c]
test edx, edx
je 0x413fc1
mov ecx, edx
lea esi, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x413fb0
sub ecx, esi
sar ecx, 1
jmp 0x413fde
mov ecx, dword [0x5c7234]
mov eax, ecx
test ecx, ecx
je 0x413fd0
shr ecx, 1
dec ecx
test eax, eax
mov edx, 0x580994
cmovne edx, dword [0x5c722c]
mov esi, dword [sym.imp.bcrypt.dll_BCryptSetProperty]
lea eax, [ecx*2 + 2]
push 0
push eax
push edx
push 0x588940
push dword [ebp - 0x10]
call esi
test eax, eax
jns 0x414022
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov ecx, edi
call fcn.00498a50
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 1
jmp 0x414366
push 0x5c6d00
mov ecx, 0x5c6d30
call fcn.00411d10
test eax, eax
je 0x41404b
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push str.EffectiveKeyLength
push dword [ebp - 0x10]
call esi
test eax, eax
js 0x413ffd
push 0x5c72a0
mov ecx, 0x5c7210
call fcn.00411d10
test eax, eax
je 0x414074
push 0
push 4
lea eax, [ebp - 0x40]
push eax
push str.MessageBlockLength
push dword [ebp - 0x10]
call esi
test eax, eax
js 0x413ffd
push 0
lea eax, [ebp - 0x9c]
push eax
push 4
lea eax, [ebp - 0xa0]
push eax
push str.BlockLength
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
test eax, eax
js 0x413ffd
mov esi, dword [ebp + 0x20]
lea ecx, [ebp - 0x60]
push esi
call fcn.00405710
mov dword [ebp - 4], 2
mov eax, dword [esi + 0x14]
test eax, eax
jle 0x4140c2
push 0
lea ecx, [ebp - 0x60]
call fcn.004992e0
jmp 0x4140ce
push ecx
neg eax
lea ecx, [ebp - 0x60]
push eax
call fcn.00499390
mov esi, dword [ebp + 0xc]
lea ecx, [ebp - 0x7c]
push esi
call fcn.00405710
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x20]
mov ecx, dword [esi + 0x14]
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp ecx, eax
jle 0x4140fc
push eax
lea ecx, [ebp - 0x7c]
call fcn.004992e0
jmp 0x414108
push ecx
sub eax, ecx
lea ecx, [ebp - 0x7c]
push eax
call fcn.00499390
mov eax, dword [ebp - 0x68]
xor edx, edx
mov ecx, dword [ebp - 0x70]
test eax, eax
push edx
push eax
cmove ecx, edx
lea eax, [ebp - 0x1c]
push ecx
push edx
push edx
push eax
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
test eax, eax
jns 0x414149
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov ecx, edi
call fcn.00498a50
mov dword [ebp - 0x14], 1
jmp 0x41434e
lea ecx, [ebp - 0x3c]
call fcn.00498a50
mov byte [ebp - 4], 4
cmp ebx, 1
jne 0x414254
push dword [ebp + 8]
lea ecx, [ebp - 0x98]
call fcn.00405710
mov byte [ebp - 4], 5
xor eax, eax
cmp dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp - 0x8c]
cmove ecx, eax
mov eax, dword [ebp - 0x84]
xor esi, esi
push ebx
test eax, eax
cmove edx, esi
lea esi, [ebp - 0x18]
push esi
push 0
push ecx
push 0
push 0
push 0
push eax
push edx
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptEncrypt]
test eax, eax
jns 0x4141dd
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov ecx, edi
call fcn.00498a50
mov dword [ebp - 0x14], ebx
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x98]
call fcn.00405c00
jmp 0x414342
push ecx
push dword [ebp - 0x18]
lea ecx, [ebp - 0x3c]
call fcn.00412940
mov eax, dword [ebp + 0x20]
test byte [eax + 4], 1
je 0x4141f8
xor ebx, ebx
xor esi, esi
jmp 0x414205
mov ebx, dword [ebp - 0x4c]
xor eax, eax
mov esi, dword [ebp - 0x54]
test ebx, ebx
cmove esi, eax
mov ecx, dword [ebp - 0x30]
xor eax, eax
cmp dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x8c]
cmove ecx, eax
cmp dword [ebp - 0x84], eax
push 1
cmove edx, eax
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x18]
mov eax, dword [ebp - 0x84]
push ecx
push ebx
push esi
push 0
push eax
push edx
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptEncrypt]
mov esi, eax
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x98]
call fcn.00405c00
jmp 0x414309
mov esi, dword [ebp + 8]
xor ecx, ecx
cmp dword [ebp - 0x28], ecx
mov eax, dword [ebp - 0x30]
cmove eax, ecx
mov edx, dword [esi + 0x14]
test edx, edx
je 0x41426c
mov ecx, dword [esi + 0xc]
push 1
lea ebx, [ebp - 0x18]
push ebx
push 0
push eax
push 0
push 0
push 0
push edx
push ecx
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
test eax, eax
jns 0x4142aa
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov ecx, edi
call fcn.00498a50
jmp 0x41433b
push ecx
push dword [ebp - 0x18]
lea ecx, [ebp - 0x3c]
call fcn.00412940
mov eax, dword [ebp + 0x20]
test byte [eax + 4], 1
je 0x4142c5
xor ecx, ecx
xor eax, eax
jmp 0x4142d2
mov ecx, dword [ebp - 0x4c]
xor edx, edx
mov eax, dword [ebp - 0x54]
test ecx, ecx
cmove eax, edx
mov edx, dword [ebp - 0x30]
xor edi, edi
cmp dword [ebp - 0x28], edi
mov ebx, dword [esi + 0x14]
cmove edx, edi
test ebx, ebx
jne 0x4142e8
xor esi, esi
jmp 0x4142eb
mov esi, dword [esi + 0xc]
push 1
lea edi, [ebp - 0x18]
push edi
push dword [ebp - 0x18]
push edx
push ecx
push eax
push 0
push ebx
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov edi, dword [ebp - 0x44]
mov esi, eax
push dword [ebp - 0x1c]
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
test esi, esi
js 0x41429e
push dword [ebp - 0x18]
lea ecx, [ebp - 0x3c]
call fcn.004992e0
lea eax, [ebp - 0x3c]
mov ecx, edi
push eax
call fcn.00405710
mov dword [ebp - 0x14], 1
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x3c]
call fcn.00405c00
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x7c]
call fcn.00405c00
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x60]
call fcn.00405c00
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24