Function at 0x50ef80
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x67a686
mov eax, dword fs:[0]
push eax
sub esp, 0x108
mov eax, dword [0x74b738]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ecx + 8]
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0xb4], ecx
mov dword [ebp - 4], 0
test esi, esi
je 0x50f06d
test edi, edi
je 0x50f099
mov edx, dword [ebp + 0x10]
test edx, 0xf
jne 0x50f0c5
lea eax, [edx - 0x10]
cmp dword [ebp + 0xc], eax
jbe 0x50f0f1
cmp byte [ecx + 0x10], 0
je 0x50f11d
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], edx
push eax
push edi
push 0
push 1
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
mov ecx, eax
test ecx, ecx
je 0x50f149
jmp 0x50f045
mov eax, dword [ebp - 0x18]
mov dword [ebx], eax
test ecx, ecx
setne al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00669a1e
mov esp, ebp
pop ebp
ret 0x10
push 0x80090003
call dword [sym.imp.KERNEL32.dll_SetLastError]
push str.Decrypt_1_:_Key_is_not_valid
lea ecx, [ebp - 0xc0]
call fcn.0050e2f0
push 0x70db0c
lea eax, [ebp - 0xc0]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x6f8
call dword [sym.imp.KERNEL32.dll_SetLastError]
push str.Decrypt_1_:_Buffer_is_NULL
lea ecx, [ebp - 0xcc]
call fcn.0050e2f0
push 0x70db0c
lea eax, [ebp - 0xcc]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x80090005
call dword [sym.imp.KERNEL32.dll_SetLastError]
push str.Decrypt_1_:_Data_size_is_not_a_multple_of_block_size
lea ecx, [ebp - 0xd8]
call fcn.0050e2f0
push 0x70db0c
lea eax, [ebp - 0xd8]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x80090028
call dword [sym.imp.KERNEL32.dll_SetLastError]
push str.Decrypt_1_:_Buffer_is_too_small
lea ecx, [ebp - 0xe4]
call fcn.0050e2f0
push 0x70db0c
lea eax, [ebp - 0xe4]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x80090027
call dword [sym.imp.KERNEL32.dll_SetLastError]
push str.Decrypt_1_:_IV_has_not_been_set
lea ecx, [ebp - 0xf0]
call fcn.0050e2f0
push 0x70db0c
lea eax, [ebp - 0xf0]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x98
lea ecx, [ebp - 0xb0]
call fcn.005104b0
push 1
push 2
lea ecx, [ebp - 0xb0]
call fcn.0050df90
lea eax, [ebp - 0xb0]
mov byte [ebp - 4], 1
push str.Decrypt_1_:_CryptDecrypt_failed__
push eax
call fcn.0050dd00
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 8
call esi
push eax
call fcn.0050fb90
push eax
lea eax, [ebp - 0xb0]
push eax
call fcn.0050dd00
add esp, 0xc
lea eax, [ebp - 0xb0]
push str.__0x
push eax
call fcn.0050dd00
add esp, 8
mov ecx, eax
push 0x5104d0
call fcn.0050eb30
mov edi, eax
call esi
push eax
mov ecx, edi
call fcn.0050e870
push 0x687a00
push eax
call fcn.0050dd00
add esp, 8
mov dword [ebx], 0
lea eax, [ebp - 0x114]
lea ecx, [ebp - 0xb0]
push eax
call fcn.00510b80
mov ecx, eax
mov byte [ebp - 4], 2
call fcn.00429a30
push eax
lea ecx, [ebp - 0xfc]
call fcn.0050e2f0
push 0x70db0c
lea eax, [ebp - 0xfc]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0
push 0
call sub.VCRUNTIME140.dll__CxxThrowException
int3