Function at 0x508850
Capabilities:
Encode data using xor

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
xor eax, eax
lea edi, [ebp - 0x10]
stosd dword es:[edi], eax
mov byte [ebp - 2], al
mov eax, dword [0x1b7f0]
mov dword [ebp - 8], eax
jmp 0x508870
pause
mov eax, dword [ebp - 8]
mov esi, dword [eax + 4]
mov eax, dword [ebp - 8]
mov ebx, dword [eax]
mov eax, dword [ebp - 8]
cmp esi, dword [eax + 8]
jne 0x50886e
mov byte [ebp - 3], 0
xor edi, edi
mov eax, ebx
mov edx, esi
mov ecx, edi
call fcn.0050a0e4
xor byte [ebp - 3], al
add edi, 8
cmp edi, 0x40
jb 0x508889
xor ebx, ebx
xor esi, esi
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov ecx, esi
call fcn.0050a114
and al, 0xf
add byte [ebp - 2], al
add esi, 4
cmp esi, 0x40
jb 0x5088a3
mov eax, dword [ebp + 8]
or eax, dword [ebp + 0xc]
jne 0x5088d7
test byte [0x1bf17], 0x40
je 0x50891a
push 0x1be94
push 0x17
jmp 0x508909
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 0x14]
or eax, esi
jne 0x5088f3
test byte [0x1bf17], 0x40
je 0x50891a
push 0x1be94
push 0x18
jmp 0x508909
cmp byte [ebp + 0x1c], 0xff
jne 0x508921
test byte [0x1bf17], 0x40
je 0x50891a
push 0x1be94
push 0x19
push dword [0x1bf0c]
push dword [0x1bf08]
call fcn.004ff028
mov eax, 0xc0000001
jmp 0x50896b
push dword [ebp + 0x1c]
call fcn.00508566
test al, al
je 0x50893f
test byte [0x1bf17], 0x40
je 0x508966
push 0x1be94
push 0x1a
jmp 0x508955
cmp byte [ebp + 0x20], 2
jb 0x508978
test byte [0x1bf17], 0x40
je 0x508966
push 0x1be94
push 0x1b
push dword [0x1bf0c]
push dword [0x1bf08]
call fcn.004ff028
mov eax, 0xc000026a
mov ecx, dword [ebp + 0x18]
mov dword [ecx], ebx
mov dword [ecx + 4], ebx
jmp 0x508b1d
mov eax, dword [0x1b7f0]
mov dword [ebp - 8], eax
jmp 0x508984
pause
mov eax, dword [ebp - 8]
mov edi, dword [eax + 4]
mov eax, dword [ebp - 8]
mov eax, dword [eax]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
cmp edi, dword [eax + 8]
jne 0x508982
mov byte [ebp - 1], 0
mov eax, dword [ebp - 0x14]
mov edx, edi
mov ecx, ebx
call fcn.0050a0e4
xor byte [ebp - 1], al
add ebx, 8
cmp ebx, 0x40
jb 0x50899e
mov edi, 0x80000000
test dword [0x1bf14], edi
je 0x5089e4
movzx eax, byte [ebp - 3]
push eax
movzx eax, byte [ebp - 1]
push eax
push 0x1be94
push 0x1c
push dword [0x1bf0c]
push dword [0x1bf08]
call fcn.004ff232
movzx eax, byte [ebp - 3]
cdq
xor ebx, ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
mov ecx, ebx
call fcn.0050a0fc
xor dword [ebp - 0xc], eax
xor dword [ebp - 8], edx
add ebx, 8
cmp ebx, 0x40
jb 0x5089f7
mov al, byte [ebp - 1]
xor al, byte [ebp - 2]
movzx eax, al
cdq
shld edx, eax, 8
shl eax, 8
mov ecx, eax
mov al, byte [ebp - 2]
xor al, byte [ebp + 0x1c]
mov ebx, edx
movzx eax, al
cdq
or ecx, eax
mov al, byte [ebp - 1]
xor al, byte [ebp + 0x1c]
or ebx, edx
xor al, byte [ebp + 0x20]
shld ebx, ecx, 8
movzx eax, al
cdq
shl ecx, 8
or ecx, eax
mov al, byte [ebp - 2]
xor al, byte [ebp + 0x20]
or ebx, edx
shld ebx, ecx, 0x10
movzx eax, al
cdq
shl ecx, 0x10
or ecx, eax
mov eax, dword [ebp + 0x10]
or ebx, edx
shld ebx, ecx, 8
mov edx, esi
shrd eax, edx, 0xd
xor al, byte [ebp + 0x20]
shl ecx, 8
movzx eax, al
shr edx, 0xd
cdq
or ecx, eax
movzx eax, byte [ebp - 1]
or ebx, edx
shld ebx, ecx, 8
cdq
shl ecx, 8
or ecx, eax
mov eax, dword [ebp + 0x10]
shrd eax, esi, 0x17
xor al, byte [ebp + 0x1c]
or ebx, edx
shld ebx, ecx, 8
movzx eax, al
shl ecx, 8
cdq
or ecx, eax
xor dword [ebp - 0xc], ecx
or ebx, edx
shr esi, 0x17
xor dword [ebp - 8], ebx
test dword [0x1bf14], edi
je 0x508add
movzx eax, byte [ebp - 2]
push eax
push dword [ebp - 8]
push dword [ebp - 0xc]
push 0x1be94
push 0x1d
push dword [0x1bf0c]
push dword [0x1bf08]
call fcn.00508486
mov eax, dword [ebp + 8]
and eax, 0xb
inc eax
test dword [0x1bf14], edi
mov esi, eax
je 0x508b07
push esi
push 0x1be94
push 0x1e
push dword [0x1bf0c]
push dword [0x1bf08]
call fcn.004ff204
push esi
push dword [ebp - 8]
push dword [ebp - 0xc]
call fcn.00508512
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
mov dword [ecx + 4], edx
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x1c