Function at 0x486600
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov ebp, dword [esp + 0x38]
mov ebx, dword [ebp]
mov edi, dword [ebp + 4]
mov eax, dword [ebp + 8]
mov dword [esp], eax
push 0
push 2
push ebx
call fcn.004392c0
add esp, 0xc
mov esi, eax
push edi
push ebx
push dword [ebp + 0x10]
push dword [esp + 0x40]
push eax
call fcn.00484d10
add esp, 0x14
movzx ebp, di
push 0
push ebp
push 0x10000
push 0
call fcn.0049e380
mov ecx, ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], edi
shr edi, 1
mov dword [esp + 8], edi
lea ebx, [edi - 1]
mov eax, ebx
mov edx, 0x55555555
mul edx
test ecx, ecx
mov dword [esp + 4], ecx
je 0x4867cb
imul eax, ebx, 0x5555
add edx, eax
shr edx, 0x10
lea eax, [edx + edx*2]
neg eax
mov edx, dword [esp + 8]
add eax, edx
add eax, 0xffffffff
mov ecx, 2
sub ecx, eax
shr ecx, 0xf
and ecx, 1
lea ecx, [ecx + ecx*2]
sub ecx, eax
add ecx, 3
movzx eax, cx
mov dword [esp + 0xc], eax
xor ecx, ecx
nop
nop
nop
movzx ebx, word [esi + ecx*2]
add ebx, dword [esp + 8]
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mul ebx
imul edi, ebx
add edx, edi
shr edx, 0x10
imul edx, ebp
sub ebx, edx
mov eax, ebx
not eax
add eax, dword [esp + 0x18]
shr eax, 0xf
and eax, 1
imul eax, ebp
sub ebx, eax
movzx ebx, bx
add ebx, dword [esp + 0xc]
mov eax, ebx
mov edx, 0x55555555
mul edx
mov eax, ebx
mov edi, 0x5555
imul eax, edi
add edx, eax
shr edx, 0x10
lea eax, [edx + edx*2]
sub ebx, eax
mov eax, 2
sub eax, ebx
shr eax, 0xf
and eax, 1
lea eax, [eax + eax*2]
not eax
add eax, ebx
mov word [esi + ecx*2], ax
add ecx, 1
cmp dword [esp + 4], ecx
jne 0x4866b0
mov ecx, dword [esp + 4]
mov ebx, ecx
add ebx, 0xffffffff
je 0x486802
and ecx, 0xfffffffe
xor eax, eax
mov ebp, dword [esp + 0x30]
nop
movsx edx, word [esi + eax*2]
mov edi, edx
shr edi, 0xf
and edi, 3
add edi, edx
mov word [esi + eax*2], di
movsx edx, word [esi + eax*2 + 2]
mov edi, edx
shr edi, 0xf
and edi, 3
add edi, edx
mov word [esi + eax*2 + 2], di
add eax, 2
cmp ecx, eax
jne 0x486740
test byte [esp + 4], 1
je 0x486786
movsx ecx, word [esi + eax*2]
mov edx, ecx
shr edx, 0xf
and edx, 3
add edx, ecx
mov word [esi + eax*2], dx
push 3
mov edi, dword [esp + 8]
push edi
mov eax, dword [esp + 0x40]
push dword [eax + 0x14]
push esi
push ebp
call fcn.00484d10
add esp, 0x14
lea eax, [edi + edi]
push eax
push esi
call fcn.00465e70
add esp, 8
push esi
call fcn.00439350
add esp, 4
test edi, edi
je 0x486818
mov eax, edi
and eax, 3
cmp ebx, 3
jae 0x486821
xor edx, edx
mov ecx, edi
jmp 0x48687a
push 3
push ecx
mov eax, dword [esp + 0x40]
push dword [eax + 0x14]
push esi
mov ebp, dword [esp + 0x40]
push ebp
mov ebx, ecx
call fcn.00484d10
add esp, 0x14
lea eax, [ebx + ebx]
push eax
push esi
call fcn.00465e70
add esp, 8
push esi
call fcn.00439350
add esp, 4
xor ecx, ecx
jmp 0x4868a9
xor eax, eax
mov ebp, dword [esp + 0x30]
test byte [esp + 4], 1
jne 0x486774
jmp 0x486786
xor ecx, ecx
mov ebx, edi
jmp 0x4868a9
mov ebx, edi
and ebx, 0xfffffffc
xor edx, edx
mov ecx, edi
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + edx*2]
add esi, 0xffff
shr esi, 0x10
add esi, ecx
movzx ecx, word [ebp + edx*2 + 2]
add ecx, 0xffff
shr ecx, 0x10
add ecx, esi
movzx esi, word [ebp + edx*2 + 4]
add esi, 0xffff
shr esi, 0x10
add esi, ecx
movzx ecx, word [ebp + edx*2 + 6]
add ecx, 0xffff
shr ecx, 0x10
add ecx, esi
add ecx, 0xfffffffc
add edx, 4
cmp ebx, edx
jne 0x486830
test eax, eax
mov ebx, dword [esp + 4]
je 0x4868a9
lea edx, [edx*2]
add edx, ebp
xor esi, esi
nop
nop
nop
movzx edi, word [edx + esi*2]
add edi, 0xffff
shr edi, 0x10
add ecx, edi
add ecx, 0xffffffff
add esi, 1
cmp eax, esi
jne 0x486890
mov edx, dword [esp]
xor ecx, edx
movzx eax, cx
add eax, 0xffff
shr eax, 0x10
neg eax
test edx, edx
je 0x486932
xor ecx, ecx
cmp edx, 1
je 0x48690d
mov edx, dword [esp]
and edx, 0xfffffffe
xor ecx, ecx
movsx esi, ax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + ecx*2]
mov ebx, edi
xor ebx, 1
and ebx, esi
xor ebx, edi
mov word [ebp + ecx*2], bx
movzx edi, word [ebp + ecx*2 + 2]
mov ebx, edi
xor ebx, 1
and ebx, esi
xor ebx, edi
mov word [ebp + ecx*2 + 2], bx
add ecx, 2
cmp edx, ecx
jne 0x4868e0
mov edx, dword [esp]
test dl, 1
mov ebx, dword [esp + 4]
je 0x486932
movzx edx, word [ebp + ecx*2]
mov esi, edx
xor esi, 1
movsx edi, ax
and edi, esi
xor edi, edx
mov edx, dword [esp]
mov word [ebp + ecx*2], di
mov ecx, ebx
sub ecx, edx
jbe 0x48698b
not eax
not edx
add edx, ebx
and ecx, 3
je 0x486993
mov esi, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
and word [ebp + esi*2], ax
add esi, 1
add ecx, 0xffffffff
jne 0x486950
cmp edx, 3
jb 0x48698b
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
and word [ebp + esi*2], ax
and word [ebp + esi*2 + 2], ax
and word [ebp + esi*2 + 4], ax
and word [ebp + esi*2 + 6], ax
add esi, 4
cmp ebx, esi
jne 0x486970
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
mov esi, dword [esp]
cmp edx, 3
jae 0x486970
jmp 0x48698b