Function at 0x4ff0b0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 4
push esi
mov dword [0x81a450], eax
mov dword [0x81a444], eax
mov dword [0x81a454], eax
mov eax, dword [0x7ccacc]
push edi
mov edi, dword [esp + 0x14]
test eax, eax
mov esi, 2
mov dword [0x81a44c], 1
mov dword [0x81a448], 8
mov dword [0x7ccad0], 0
jne 0x4ff101
mov eax, dword [esp + 0xc]
mov dword [0x83a488], eax
jmp 0x4ff137
mov ecx, dword [esp + 0xc]
push 0x10000
mov dword [0x7ccac0], ecx
call fcn.004f56e0
add esp, 4
mov dword [0x83a488], eax
test eax, eax
jne 0x4ff127
pop edi
or eax, 0xffffffff
pop esi
ret
mov dword [0x7ccab4], 0
mov dword [0x7ccac4], edi
mov edx, dword [esp + 0x10]
push edi
mov dword [0x85a4a0], edx
call fcn.004fe9d0
mov eax, dword [0x7ccac8]
add esp, 4
test eax, eax
je 0x4ff369
mov ecx, dword [0x7ccab8]
mov eax, dword [0x83a484]
push ebx
mov edi, dword [0x83a488]
xor edx, edx
and ecx, 0x3ff
mov dl, byte [eax + edi + 2]
mov edi, eax
and edx, 0x7fff
and edi, 0x7fff
shl ecx, 5
xor edx, ecx
xor ecx, ecx
mov dword [0x7ccab8], edx
mov cx, word [edx*2 + 0x84a4a0]
mov word [edi*2 + 0x83a4a0], cx
mov word [edx*2 + 0x84a4a0], ax
test ecx, ecx
je 0x4ff1d3
mov edx, eax
sub edx, ecx
cmp edx, 0x7efa
ja 0x4ff1d3
push ecx
call fcn.004febe0
mov esi, eax
mov eax, dword [0x7ccac8]
add esp, 4
cmp esi, eax
jbe 0x4ff1ce
mov esi, eax
mov eax, dword [0x83a484]
cmp esi, 3
jb 0x4ff2aa
mov ebx, dword [0x85a4a4]
lea ecx, [esi - 3]
sub eax, ebx
push ecx
push eax
call fcn.005015f0
mov ecx, dword [0x7ccac8]
mov edi, eax
mov eax, dword [0x81a450]
add esp, 8
sub ecx, esi
cmp esi, eax
mov dword [0x7ccac8], ecx
ja 0x4ff26a
mov ecx, dword [0x7ccab8]
mov eax, dword [0x83a484]
dec esi
mov ebx, dword [0x83a488]
inc eax
xor edx, edx
mov dword [0x83a484], eax
mov dl, byte [ebx + eax + 2]
and ecx, 0x3ff
and edx, 0x7fff
shl ecx, 5
xor ecx, edx
mov edx, eax
and edx, 0x7fff
dec esi
mov bx, word [ecx*2 + 0x84a4a0]
mov dword [0x7ccab8], ecx
mov word [edx*2 + 0x83a4a0], bx
mov word [ecx*2 + 0x84a4a0], ax
jne 0x4ff216
inc eax
mov dword [0x83a484], eax
jmp 0x4ff2e0
mov eax, dword [0x83a484]
mov ecx, dword [0x83a488]
add eax, esi
xor edx, edx
mov dword [0x83a484], eax
xor ebx, ebx
mov dl, byte [eax + ecx]
xor esi, esi
mov dword [0x7ccab8], edx
mov bl, byte [eax + ecx + 1]
mov ecx, ebx
and edx, 0x3ff
and ecx, 0x7fff
shl edx, 5
xor ecx, edx
mov dword [0x7ccab8], ecx
jmp 0x4ff2e0
mov edx, dword [0x83a488]
xor ecx, ecx
mov cl, byte [eax + edx]
push ecx
push 0
call fcn.005015f0
mov edx, dword [0x7ccac8]
mov ecx, dword [0x7ccab8]
mov edi, eax
mov eax, dword [0x83a484]
add esp, 8
dec edx
inc eax
mov dword [0x7ccac8], edx
mov dword [0x83a484], eax
test edi, edi
je 0x4ff31c
mov edx, dword [0x85a4a8]
test edx, edx
jl 0x4ff2f8
mov ecx, dword [0x83a488]
add ecx, edx
jmp 0x4ff2fa
xor ecx, ecx
lea ebx, [edi - 1]
push 0
sub eax, edx
push ebx
push eax
push ecx
call fcn.00500c70
mov eax, dword [0x83a484]
mov ecx, dword [0x7ccab8]
add esp, 0x10
mov dword [0x85a4a8], eax
mov edx, dword [0x7ccacc]
test edx, edx
je 0x4ff358
mov edx, dword [0x7ccac8]
mov ebx, 0x106
cmp edx, ebx
jae 0x4ff358
mov edx, dword [0x7ccabc]
test edx, edx
jne 0x4ff358
call fcn.004feae0
mov eax, dword [0x7ccac8]
mov ecx, dword [0x7ccab8]
cmp eax, ebx
mov eax, dword [0x83a484]
jb 0x4ff335
mov edx, dword [0x7ccac8]
test edx, edx
jne 0x4ff163
pop ebx
jmp 0x4ff372
mov edi, dword [esp + 0xc]
mov eax, dword [0x83a484]
mov edx, dword [0x85a4a8]
test edx, edx
jl 0x4ff386
mov ecx, dword [0x83a488]
add ecx, edx
jmp 0x4ff388
xor ecx, ecx
dec edi
push 1
sub eax, edx
push edi
push eax
push ecx
call fcn.00500c70
mov eax, dword [0x7ccad0]
add esp, 0x10
pop edi
pop esi
ret