Function at 0x50f020
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5adf1e
mov eax, dword fs:[0]
push eax
sub esp, 0x91c
mov eax, dword [0x676664]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 0x14]
mov ebx, dword [ebp + 8]
mov ecx, edi
mov dword [ebp - 0x8e8], eax
mov dword [ebp - 0x90c], edi
mov dword [ebp - 0x8f4], esi
call fcn.00410b40
lea ecx, [ebp - 0x378]
call fcn.0050a850
lea ecx, [ebp - 0xe8]
mov dword [ebp - 4], 0
call fcn.0050ac90
lea ecx, [ebp - 0x8e0]
mov byte [ebp - 4], 1
call fcn.0050d350
push ebx
lea ecx, [ebp - 0xd4]
mov byte [ebp - 4], 2
mov dword [ebp - 0xe0], 1
call fcn.00413bd0
lea ecx, [ebp - 0xd4]
call fcn.00410b60
push esi
add eax, eax
lea ecx, [ebp - 0x8e0]
push ecx
lea edx, [ebp - 0xe8]
add eax, eax
push edx
add eax, eax
mov ebx, 3
push 0
lea ecx, [ebp - 0x378]
mov dword [ebp - 0xd8], eax
mov dword [ebp - 0xdc], ebx
call fcn.0050e180
lea ecx, [ebp - 0x928]
call fcn.00410e50
mov eax, dword [ebp - 0x8e8]
push eax
lea ecx, [ebp - 0x928]
mov byte [ebp - 4], bl
call fcn.00413bd0
lea ecx, [ebp - 0x928]
call fcn.00410b60
mov ebx, eax
cmp ebx, 0x10
jb 0x50f32c
test bl, 7
jne 0x50f32c
shr ebx, 3
dec ebx
lea esi, [ebx*8]
push esi
push 0
mov ecx, edi
mov dword [ebp - 0x8e8], ebx
mov dword [ebp - 0x908], esi
call fcn.00411b50
lea ecx, [ebp - 0x928]
call fcn.00410b80
mov ecx, edi
mov ebx, eax
call fcn.00410b80
mov ecx, dword [ebx]
mov edi, dword [ebx + 4]
push esi
add ebx, 8
push ebx
push eax
mov dword [ebp - 0x8ec], eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], edi
call sub.MSVCR100.dll_memcpy
mov edx, dword [ebp - 0x8ec]
lea eax, [esi + edx - 8]
add esp, 0xc
mov dword [ebp - 0x8f0], 5
mov dword [ebp - 0x8ec], eax
mov ebx, dword [ebp - 0x8e8]
mov esi, dword [ebp - 0x8ec]
mov eax, ebx
cmp eax, 1
jl 0x50f236
imul byte [ebp - 0x8f0]
mov byte [ebp - 0x8e1], al
mov dl, byte [ebp - 0x8e1]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x904], ecx
mov ecx, dword [esi]
add dl, bl
mov eax, edi
shr eax, 0x18
xor dl, al
lea eax, [ebp - 0x904]
mov dword [ebp - 0x8fc], ecx
mov ecx, eax
mov dword [ebp - 0x900], edi
push eax
mov byte [ebp - 0x8fd], dl
mov edx, dword [esi + 4]
push ecx
lea ecx, [ebp - 0x378]
mov dword [ebp - 0x8f8], edx
call fcn.0050c3b0
mov eax, dword [ebp - 0x8fc]
mov ecx, dword [ebp - 0x8f8]
mov edx, dword [ebp - 0x904]
mov edi, dword [ebp - 0x900]
mov dword [esi], eax
mov dword [esi + 4], ecx
dec ebx
sub esi, 8
mov dword [ebp - 0x18], edx
cmp ebx, 1
jge 0x50f1c3
dec dword [ebp - 0x8f0]
jns 0x50f1a4
mov dword [ebp - 0x14], edi
mov edi, dword [ebp - 0x90c]
mov ecx, edi
mov bl, 1
call fcn.00410b60
cmp eax, dword [ebp - 0x908]
je 0x50f286
mov esi, dword [ebp - 0x8f4]
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.Output_is_not_the_expected_size.
mov ecx, esi
call eax
mov ecx, edi
call fcn.00410b60
push eax
push str.outNumBytes
mov ecx, esi
call fcn.0044e8c0
jmp 0x50f2b0
xor eax, eax
mov cl, 0xa6
lea ebx, [ebx]
cmp byte [ebp + eax - 0x18], cl
jne 0x50f29e
inc eax
cmp eax, 8
jl 0x50f290
jmp 0x50f2b2
mov ecx, dword [ebp - 0x8f4]
mov edx, dword [ecx]
mov eax, dword [edx + 0x14]
push str.KEK_is_not_the_correct_key.
call eax
xor bl, bl
lea ecx, [ebp - 0x928]
mov byte [ebp - 4], 2
call fcn.00411620
lea ecx, [ebp - 0x8e0]
mov byte [ebp - 4], 1
call fcn.0050abd0
mov dword [ebp - 0xe8], vtable._ckSymSettings.0
lea ecx, [ebp - 0x7c]
mov byte [ebp - 4], 9
call fcn.00411620
lea ecx, [ebp - 0x98]
mov byte [ebp - 4], 8
call fcn.00411620
lea ecx, [ebp - 0xb4]
mov byte [ebp - 4], 7
call fcn.00411620
lea ecx, [ebp - 0xd4]
mov byte [ebp - 4], 0
call fcn.00411620
lea ecx, [ebp - 0x378]
mov dword [ebp - 4], 0xffffffff
call fcn.0050a8d0
mov al, bl
jmp 0x50f3bc
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.Key_data_must_be_a_multiple_of_8_bytes_in_length.
mov ecx, esi
call eax
push ebx
push str.keyDataLen
mov ecx, esi
call fcn.0044e8c0
lea ecx, [ebp - 0x928]
mov byte [ebp - 4], 2
call fcn.00411620
lea ecx, [ebp - 0x8e0]
mov byte [ebp - 4], 1
call fcn.0050abd0
mov dword [ebp - 0xe8], vtable._ckSymSettings.0
lea ecx, [ebp - 0x7c]
mov byte [ebp - 4], 6
call fcn.00411620
lea ecx, [ebp - 0x98]
mov byte [ebp - 4], 5
call fcn.00411620
lea ecx, [ebp - 0xb4]
mov byte [ebp - 4], 4
call fcn.00411620
lea ecx, [ebp - 0xd4]
mov byte [ebp - 4], 0
call fcn.00411620
lea ecx, [ebp - 0x378]
mov dword [ebp - 4], 0xffffffff
call fcn.0050a8d0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0059af98
mov esp, ebp
pop ebp
ret