Function at 0x4fa520
Capabilities:
Encode data using xor

Disassembly:
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push edi
xor edi, edi
mov dword [esi + 0x6af80], 2
cmp dword [esi + 0x6af90], ebx
je 0x4fa4e2
push ebp
cmp dword [esi + 0x6af90], 3
jb 0x4fa355
mov edx, dword [esi + 0x6af84]
mov eax, dword [esi + 0x6af7c]
shl eax, 5
movzx ecx, byte [edx + esi + 0x1af72]
xor ecx, eax
and ecx, 0x7fff
and edx, 0x7fff
mov dword [esi + 0x6af7c], ecx
mov ebx, dword [esi + ecx*4 + 0x4af70]
mov dword [esi + edx*4 + 0x2af70], ebx
mov ecx, dword [esi + 0x6af7c]
mov eax, dword [esi + 0x6af84]
mov dword [esi + ecx*4 + 0x4af70], eax
test ebx, ebx
je 0x4fa392
mov eax, dword [esi + 0x6af84]
sub eax, ebx
cmp eax, 0x7efa
ja 0x4fa392
mov eax, dword [esi + 0x6af90]
cmp dword [esi + 0x6afa0], eax
jbe 0x4fa37c
mov dword [esi + 0x6afa0], eax
mov edx, ebx
mov ecx, esi
call fcn.004f9fc0
mov ecx, dword [esi + 0x6af90]
mov edi, eax
cmp edi, ecx
cmova edi, ecx
mov ecx, esi
cmp edi, 3
jb 0x4fa45f
mov edx, dword [esi + 0x6af84]
lea eax, [edi - 3]
sub edx, dword [esi + 0x6af88]
push eax
call fcn.004f9770
sub dword [esi + 0x6af90], edi
add esp, 4
mov ebp, eax
cmp edi, dword [esi + 0x6af98]
ja 0x4fa429
cmp dword [esi + 0x6af90], 3
jb 0x4fa429
dec edi
nop
inc dword [esi + 0x6af84]
mov edx, dword [esi + 0x6af84]
mov eax, dword [esi + 0x6af7c]
shl eax, 5
movzx ecx, byte [esi + edx + 0x1af72]
and edx, 0x7fff
xor ecx, eax
and ecx, 0x7fff
mov dword [esi + 0x6af7c], ecx
mov ebx, dword [esi + ecx*4 + 0x4af70]
mov dword [esi + edx*4 + 0x2af70], ebx
mov ecx, dword [esi + 0x6af7c]
mov eax, dword [esi + 0x6af84]
mov dword [esi + ecx*4 + 0x4af70], eax
sub edi, 1
jne 0x4fa3d0
jmp 0x4fa480
add dword [esi + 0x6af84], edi
xor edi, edi
mov eax, dword [esi + 0x6af84]
movzx ecx, byte [eax + esi + 0x1af70]
mov dword [esi + 0x6af7c], ecx
movzx eax, byte [eax + esi + 0x1af71]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
mov dword [esi + 0x6af7c], eax
jmp 0x4fa486
mov eax, dword [esi + 0x6af84]
xor edx, edx
movzx eax, byte [eax + esi + 0x1af70]
push eax
call fcn.004f9770
add esp, 4
mov ebp, eax
dec dword [esi + 0x6af90]
inc dword [esi + 0x6af84]
test ebp, ebp
je 0x4fa4c1
mov ecx, dword [esi + 0x6af74]
test ecx, ecx
js 0x4fa49e
lea edx, [esi + 0x1af70]
add edx, ecx
jmp 0x4fa4a0
xor edx, edx
mov eax, dword [esi + 0x6af84]
sub eax, ecx
mov ecx, esi
push 0
push eax
call fcn.004f95c0
mov eax, dword [esi + 0x6af84]
add esp, 8
mov dword [esi + 0x6af74], eax
cmp dword [esi + 0x6af90], 0x106
jae 0x4fa4d4
mov ecx, esi
call fcn.004fa180
cmp dword [esi + 0x6af90], 0
jne 0x4fa300
pop ebp
mov ecx, dword [esi + 0x6af74]
test ecx, ecx
js 0x4fa4f6
lea edx, [esi + 0x1af70]
add edx, ecx
jmp 0x4fa4f8
xor edx, edx
mov eax, dword [esi + 0x6af84]
sub eax, ecx
mov ecx, esi
push 1
push eax
call fcn.004f95c0
add esp, 8
pop edi
pop esi
pop ebx
ret
push ecx
push ebx
push ebp
push esi
mov esi, ecx
xor ebx, ebx
xor ebp, ebp
push edi
cmp dword [esi + 4], 3
lea edi, [ebx + 2]
jg 0x4fa540
pop edi
pop esi
pop ebp
pop ebx
add esp, 4
jmp 0x4fa2e0
cmp dword [esi + 0x6af90], ebx
je 0x4fa7d9
nop dword [eax]
cmp dword [esi + 0x6af90], 3
jb 0x4fa5a5
mov edx, dword [esi + 0x6af84]
mov eax, dword [esi + 0x6af7c]
shl eax, 5
movzx ecx, byte [edx + esi + 0x1af72]
xor ecx, eax
and ecx, 0x7fff
and edx, 0x7fff
mov dword [esi + 0x6af7c], ecx
mov ebx, dword [esi + ecx*4 + 0x4af70]
mov dword [esi + edx*4 + 0x2af70], ebx
mov ecx, dword [esi + 0x6af7c]
mov eax, dword [esi + 0x6af84]
mov dword [esi + ecx*4 + 0x4af70], eax
mov eax, dword [esi + 0x6af88]
mov dword [esi + 0x6af80], edi
mov edi, 2
mov dword [esp + 0x10], eax
test ebx, ebx
je 0x4fa624
mov eax, dword [esi + 0x6af80]
cmp eax, dword [esi + 0x6af98]
jae 0x4fa624
mov eax, dword [esi + 0x6af84]
sub eax, ebx
cmp eax, 0x7efa
ja 0x4fa624
mov eax, dword [esi + 0x6af90]
cmp dword [esi + 0x6afa0], eax
jbe 0x4fa5ef
mov dword [esi + 0x6afa0], eax
mov edx, ebx
mov ecx, esi
call fcn.004f9fc0
mov ecx, dword [esi + 0x6af90]
mov edi, eax
cmp edi, ecx
cmova edi, ecx
cmp edi, 3
jne 0x4fa624
mov ecx, dword [esi + 0x6af84]
mov eax, 2
sub ecx, dword [esi + 0x6af88]
cmp ecx, 0x1000
cmova edi, eax
mov ecx, dword [esi + 0x6af80]
cmp ecx, 3
jb 0x4fa72d
cmp edi, ecx
ja 0x4fa72d
mov edi, dword [esi + 0x6af90]
lea eax, [ecx - 3]
mov edx, dword [esi + 0x6af84]
add edi, 0xfffffffd
add edi, edx
mov ecx, esi
sub edx, dword [esp + 0x10]
push eax
dec edx
call fcn.004f9770
mov edx, dword [esi + 0x6af80]
mov ecx, 1
sub ecx, edx
mov dword [esp + 0x14], eax
add esp, 4
add dword [esi + 0x6af90], ecx
lea ecx, [edx - 2]
mov dword [esi + 0x6af80], ecx
nop
inc dword [esi + 0x6af84]
mov edx, dword [esi + 0x6af84]
cmp edx, edi
ja 0x4fa6d6
mov eax, dword [esi + 0x6af7c]
movzx ecx, byte [edx + esi + 0x1af72]
shl eax, 5
xor ecx, eax
and ecx, 0x7fff
and edx, 0x7fff
mov dword [esi + 0x6af7c], ecx
mov ebx, dword [esi + ecx*4 + 0x4af70]
mov dword [esi + edx*4 + 0x2af70], ebx
mov ecx, dword [esi + 0x6af7c]
mov eax, dword [esi + 0x6af84]
mov dword [esi + ecx*4 + 0x4af70], eax
add dword [esi + 0x6af80], 0xffffffff
jne 0x4fa680
inc dword [esi + 0x6af84]
xor ebp, ebp
mov ecx, dword [esi + 0x6af84]
lea edi, [ebp + 2]
cmp dword [esp + 0x10], ebp
je 0x4fa79a
mov eax, dword [esi + 0x6af74]
test eax, eax
js 0x4fa70e
lea edx, [esi + 0x1af70]
add edx, eax
jmp 0x4fa710
xor edx, edx
sub ecx, eax
push 0
push ecx
mov ecx, esi
call fcn.004f95c0
mov eax, dword [esi + 0x6af84]
add esp, 8
mov dword [esi + 0x6af74], eax
jmp 0x4fa79a
test ebp, ebp
je 0x4fa789
mov eax, dword [esi + 0x6af84]
xor edx, edx
mov ecx, esi
movzx eax, byte [eax + esi + 0x1af6f]
push eax
call fcn.004f9770
add esp, 4
test eax, eax
je 0x4fa78e
mov ecx, dword [esi + 0x6af74]
test ecx, ecx
js 0x4fa764
lea edx, [esi + 0x1af70]
add edx, ecx
jmp 0x4fa766
xor edx, edx
mov eax, dword [esi + 0x6af84]
sub eax, ecx
mov ecx, esi
push 0
push eax
call fcn.004f95c0
mov eax, dword [esi + 0x6af84]
add esp, 8
mov dword [esi + 0x6af74], eax
jmp 0x4fa78e
mov ebp, 1
inc dword [esi + 0x6af84]
dec dword [esi + 0x6af90]
cmp dword [esi + 0x6af90], 0x106
jae 0x4fa7ad
mov ecx, esi
call fcn.004fa180
cmp dword [esi + 0x6af90], 0
jne 0x4fa550
test ebp, ebp
je 0x4fa7d9
mov eax, dword [esi + 0x6af84]
xor edx, edx
mov ecx, esi
movzx eax, byte [eax + esi + 0x1af6f]
push eax
call fcn.004f9770
add esp, 4
mov ecx, dword [esi + 0x6af74]
test ecx, ecx
js 0x4fa7ed
lea edx, [esi + 0x1af70]
add edx, ecx
jmp 0x4fa7ef
xor edx, edx
mov eax, dword [esi + 0x6af84]
sub eax, ecx
mov ecx, esi
push 1
push eax
call fcn.004f95c0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret