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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ac769
mov eax, dword fs:[0]
push eax
sub esp, 0x78
push ebx
push esi
push edi
mov eax, dword [0x663068]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x14], 0
mov eax, dword [0x663bfc]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0x80
test eax, eax
jne 0x415a2e
cmp dword [0x663c14], 0
mov eax, 0x64d50c
cmovne eax, dword [0x663c0c]
push 0
push 0
push eax
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
jns 0x415a91
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 0x415db5
mov edx, dword [0x6640dc]
test edx, edx
je 0x415ab1
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x415aa0
sub ecx, esi
sar ecx, 1
jmp 0x415ace
mov ecx, dword [0x6640f4]
mov eax, ecx
test ecx, ecx
je 0x415ac0
shr ecx, 1
dec ecx
test eax, eax
mov edx, 0x64d50c
cmovne edx, dword [0x6640ec]
mov esi, dword [sym.imp.bcrypt.dll_BCryptSetProperty]
lea eax, [ecx*2 + 2]
push 0
push eax
push edx
push 0x64dad0
push dword [ebp - 0x10]
call esi
test eax, eax
jns 0x415b48
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov dword [edi], vtable.CVolObject.0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [ebp - 4], 2
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 0x415db5
push 0x663bc0
mov ecx, 0x663bf0
call fcn.00415fe0
test eax, eax
je 0x415b96
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push str.EffectiveKeyLength
push dword [ebp - 0x10]
call esi
test eax, eax
jns 0x415b96
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov ecx, edi
call fcn.0042b8f0
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 1
jmp 0x415db5
push 0x664160
mov ecx, 0x6640d0
call fcn.00415fe0
test eax, eax
je 0x415bbf
push 0
push 4
lea eax, [ebp - 0x24]
push eax
push str.MessageBlockLength
push dword [ebp - 0x10]
call esi
test eax, eax
js 0x415b71
push 0
lea eax, [ebp - 0x2c]
push eax
push 4
lea eax, [ebp - 0x30]
push eax
push str.BlockLength
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
test eax, eax
js 0x415b71
mov ebx, dword [ebp + 0x20]
lea ecx, [ebp - 0x84]
push ebx
call fcn.00403ed0
mov dword [ebp - 4], 3
mov eax, dword [ebx + 0x14]
test eax, eax
jle 0x415c09
push 0
lea ecx, [ebp - 0x84]
call fcn.0042c0c0
jmp 0x415c18
push ecx
neg eax
lea ecx, [ebp - 0x84]
push eax
call fcn.0042c170
mov esi, dword [ebp + 0xc]
lea ecx, [ebp - 0x68]
push esi
call fcn.00403ed0
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x20]
mov ecx, dword [esi + 0x14]
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp ecx, eax
jle 0x415c46
push eax
lea ecx, [ebp - 0x68]
call fcn.0042c0c0
jmp 0x415c52
push ecx
sub eax, ecx
lea ecx, [ebp - 0x68]
push eax
call fcn.0042c170
mov eax, dword [ebp - 0x54]
xor edx, edx
mov ecx, dword [ebp - 0x5c]
test eax, eax
push edx
push eax
cmove ecx, edx
lea eax, [ebp - 0x18]
push ecx
push edx
push edx
push eax
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
test eax, eax
jns 0x415c93
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov ecx, edi
call fcn.0042b8f0
mov dword [ebp - 0x14], 1
jmp 0x415d9a
lea ecx, [ebp - 0x4c]
call fcn.0042b8f0
mov byte [ebp - 4], 5
xor ecx, ecx
mov esi, dword [ebp + 8]
cmp dword [ebp - 0x38], ecx
mov eax, dword [ebp - 0x40]
cmove eax, ecx
mov edx, dword [esi + 0x14]
test edx, edx
je 0x415cb7
mov ecx, dword [esi + 0xc]
push 1
lea ebx, [ebp - 0x1c]
push ebx
push 0
push eax
push 0
push 0
push 0
push edx
push ecx
push dword [ebp - 0x18]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov ebx, dword [ebp + 0x20]
test eax, eax
jns 0x415cf8
push dword [ebp - 0x18]
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.0042b8f0
jmp 0x415d87
push 1
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x4c]
call fcn.00415f70
test byte [ebx + 4], 1
je 0x415d11
xor ecx, ecx
xor eax, eax
jmp 0x415d1e
mov ecx, dword [ebp - 0x70]
xor edx, edx
mov eax, dword [ebp - 0x78]
test ecx, ecx
cmove eax, edx
mov edx, dword [ebp - 0x40]
xor edi, edi
cmp dword [ebp - 0x38], edi
mov ebx, dword [esi + 0x14]
cmove edx, edi
test ebx, ebx
jne 0x415d34
xor esi, esi
jmp 0x415d37
mov esi, dword [esi + 0xc]
push 1
lea edi, [ebp - 0x1c]
push edi
push dword [ebp - 0x1c]
push edx
push ecx
push eax
push 0
push ebx
push esi
push dword [ebp - 0x18]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
push dword [ebp - 0x18]
mov esi, eax
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
push 0
push dword [ebp - 0x10]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov edi, dword [ebp - 0x28]
test esi, esi
js 0x415cec
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x4c]
call fcn.0042c0c0
lea eax, [ebp - 0x4c]
mov ecx, edi
push eax
call fcn.00403ed0
mov dword [ebp - 0x14], 1
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x4c]
call fcn.00404480
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x68]
call fcn.00404480
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.00404480
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