Function at 0x6051670
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6106586
mov eax, dword fs:[0]
push eax
sub esp, 0x1dc
mov eax, dword [0x613b150]
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, ecx
mov dword [ebp - 0xd8], esi
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov ecx, dword [ebx]
mov dword [ebp - 0xd0], ebx
test ecx, ecx
je 0x60516c6
mov eax, dword [ecx]
call dword [eax + 8]
mov dword [ebx], 0
mov eax, dword [esi + 4]
test eax, eax
jne 0x60516d7
mov eax, 0x8007139f
jmp 0x6051949
test edi, edi
jne 0x60516e5
mov eax, 0x80070057
jmp 0x6051949
push 0
lea ecx, [ebp - 0x2c]
push ecx
push 4
push eax
mov dword [ebp - 0x2c], 1
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
jne 0x605171a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x6051949
movzx eax, ax
or eax, 0x80070000
jmp 0x6051949
push 0
lea eax, [ebp - 0x28]
push eax
push 3
push dword [esi + 4]
mov dword [ebp - 0x28], 1
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x60516ff
cmp byte [edi], 0
mov esi, edi
je 0x6051746
lea ecx, [ecx]
inc esi
cmp byte [esi], 0
jne 0x6051740
sub esi, edi
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xd4], esi
mov dword [ebp - 0xbc], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
call fcn.060c0efa
push esi
lea ecx, [ebp - 0xc8]
mov dword [ebp - 4], 0
call fcn.060c10f4
lea ecx, [ebp - 0xc8]
test eax, eax
je 0x60518b0
lea eax, [ebp - 0xd4]
push eax
call fcn.060c1c15
push eax
mov ecx, edi
call fcn.060511c0
mov edx, eax
mov ecx, edi
call fcn.06051070
add esp, 8
lea ecx, [ebp - 0xc8]
test eax, eax
jne 0x60517cb
call fcn.060c0f4c
mov eax, 0x8000ffff
jmp 0x6051949
call fcn.060c1c15
mov esi, eax
mov eax, dword [ebp - 0xd4]
xorps xmm0, xmm0
mov byte [ebp - 0x24], 0
movq qword [ebp - 0x23], xmm0
mov dword [ebp - 0x1b], 0
mov word [ebp - 0x17], 0
mov byte [ebp - 0x15], 0
cmp eax, 0x10
jae 0x605180f
lea ecx, [ebp - 0xc8]
call fcn.060c0f4c
mov eax, 0x8007000d
jmp 0x6051949
mov edi, dword [ebp - 0xd8]
add eax, 0xfffffff0
mov dword [ebp - 0xcc], eax
movq xmm0, qword [eax + esi]
movq qword [ebp - 0x24], xmm0
movq xmm0, qword [eax + esi + 8]
push 0
lea eax, [ebp - 0x24]
push eax
push 1
push dword [edi + 4]
movq qword [ebp - 0x1c], xmm0
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
jne 0x605186f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x605185d
movzx esi, si
or esi, 0x80070000
lea ecx, [ebp - 0xc8]
call fcn.060c0f4c
mov eax, esi
jmp 0x6051949
lea eax, [ebp - 0xcc]
push eax
push esi
push 0
push 1
push 0
push dword [edi + 4]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x6051848
mov eax, dword [ebp - 0xcc]
mov byte [eax + esi], 0
call fcn.060c2c9c
test eax, eax
je 0x60518a2
add eax, 8
jmp 0x60518a4
xor eax, eax
mov dword [ebx], eax
test eax, eax
jne 0x60518bf
lea ecx, [ebp - 0xc8]
call fcn.060c0f4c
mov eax, 0x8007000e
jmp 0x6051949
push 0xfde9
lea eax, [ebp - 0x1e4]
mov byte [ebp - 4], 1
push esi
lea ecx, [ebp - 0x1e8]
mov dword [ebp - 0x1e8], eax
call fcn.06051bc0
mov byte [ebp - 4], 2
mov ecx, dword [ebx]
push dword [ebp - 0x1e8]
mov eax, dword [ecx]
call dword [eax + 0x2c]
mov eax, dword [ebp - 0x1e8]
lea ecx, [ebp - 0x1e4]
cmp eax, ecx
je 0x605190a
push eax
call fcn.060ebabe
add esp, 4
lea ecx, [ebp - 0xc8]
call fcn.060c0f4c
xor eax, eax
jmp 0x6051949
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.060eb877
mov esp, ebp
pop ebp
ret 8