Function at 0x4fa870
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [esp + 8]
push ebp
mov ebp, dword [esp + 0x10]
push esi
mov ecx, dword [ebx + 0xc]
push edi
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x14], ecx
cmp ecx, eax
jae 0x4fa8db
cmp dword [ebp + 0x14], 0
je 0x4fa89e
push eax
push ebx
call fcn.004fa1f0
add esp, 8
mov ebx, eax
jmp 0x4fa8db
mov eax, dword [ebp + 4]
mov edi, dword [ebx + 4]
mov edx, dword [ebx + 8]
mov esi, dword [ebx + 0x2c]
mov ecx, dword [ebx + 0x30]
mov dword [ebx + 4], eax
mov eax, dword [ebp + 8]
mov dword [ebx + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0xc], eax
mov eax, dword [ebp + 0x2c]
mov dword [ebx + 0x2c], eax
mov eax, dword [ebp + 0x30]
mov dword [ebx + 0x30], eax
mov eax, dword [esp + 0x14]
mov dword [ebp + 4], edi
mov dword [ebp + 8], edx
mov dword [ebp + 0xc], eax
mov dword [ebp + 0x2c], esi
mov dword [ebp + 0x30], ecx
mov esi, dword [ebp + 8]
xor edi, edi
mov dword [esp + 0x14], esi
test esi, esi
jle 0x4fa999
nop dword [eax]
mov eax, dword [ebp + 0x2c]
mov eax, dword [eax + edi*4]
mov edx, dword [eax + 4]
mov eax, dword [ebx + 0x2c]
mov eax, dword [eax + edi*4]
mov ecx, dword [eax + 4]
lea eax, [edx + 0x7fff]
lea esi, [ecx + 0x7fff]
cmp ecx, eax
ja 0x4fa930
cmp esi, edx
jb 0x4fa930
sub edx, ecx
mov esi, 0x8000
nop dword [eax]
mov al, byte [ecx + edx]
lea ecx, [ecx + 1]
xor byte [ecx - 1], al
sub esi, 1
jne 0x4fa920
jmp 0x4fa98c
lea eax, [edx + 0x20]
mov esi, 0x200
sub edx, ecx
nop word [eax + eax]
lea ecx, [ecx + 0x40]
lea eax, [eax + 0x40]
movups xmm0, xmmword [ecx - 0x40]
movups xmm1, xmmword [edx + ecx - 0x40]
pxor xmm1, xmm0
movups xmmword [ecx - 0x40], xmm1
movups xmm0, xmmword [ecx - 0x30]
movups xmm1, xmmword [eax - 0x50]
pxor xmm1, xmm0
movups xmm0, xmmword [eax - 0x40]
movups xmmword [ecx - 0x30], xmm1
movups xmm1, xmmword [ecx - 0x20]
pxor xmm1, xmm0
movups xmmword [ecx - 0x20], xmm1
movups xmm0, xmmword [ecx - 0x10]
movups xmm1, xmmword [eax - 0x30]
pxor xmm1, xmm0
movups xmmword [ecx - 0x10], xmm1
sub esi, 1
jne 0x4fa940
mov esi, dword [esp + 0x14]
inc edi
cmp edi, esi
jl 0x4fa8f0
mov ecx, dword [ebp + 0x30]
test ecx, ecx
je 0x4faa87
cmp dword [ebx + 0x30], 0
jne 0x4fa9d5
cmp dword [ebp + 0x14], 0
jne 0x4fa9c7
mov eax, dword [ebp + 8]
cmp eax, dword [ebx + 8]
jne 0x4fa9c7
mov dword [ebx + 0x30], ecx
mov dword [ebp + 0x30], 0
jmp 0x4faa87
push dword [ebx + 8]
call fcn.004f9690
add esp, 4
mov dword [ebx + 0x30], eax
xor edi, edi
test esi, esi
jle 0x4faa87
nop
mov eax, dword [ebp + 0x30]
mov eax, dword [eax + edi*4]
mov edx, dword [eax + 4]
mov eax, dword [ebx + 0x30]
lea ecx, [edx + 0x7fff]
mov eax, dword [eax + edi*4]
mov eax, dword [eax + 4]
lea esi, [eax + 0x7fff]
cmp eax, ecx
ja 0x4faa20
cmp esi, edx
jb 0x4faa20
sub edx, eax
mov esi, 0x8000
nop dword [eax]
mov cl, byte [eax + edx]
lea eax, [eax + 1]
or byte [eax - 1], cl
sub esi, 1
jne 0x4faa10
jmp 0x4faa7c
lea ecx, [edx + 0x20]
mov esi, 0x200
sub edx, eax
nop word [eax + eax]
lea eax, [eax + 0x40]
lea ecx, [ecx + 0x40]
movups xmm0, xmmword [eax - 0x40]
movups xmm1, xmmword [edx + eax - 0x40]
por xmm1, xmm0
movups xmmword [eax - 0x40], xmm1
movups xmm0, xmmword [eax - 0x30]
movups xmm1, xmmword [ecx - 0x50]
por xmm1, xmm0
movups xmm0, xmmword [ecx - 0x40]
movups xmmword [eax - 0x30], xmm1
movups xmm1, xmmword [eax - 0x20]
por xmm1, xmm0
movups xmmword [eax - 0x20], xmm1
movups xmm0, xmmword [eax - 0x10]
movups xmm1, xmmword [ecx - 0x30]
por xmm1, xmm0
movups xmmword [eax - 0x10], xmm1
sub esi, 1
jne 0x4faa30
inc edi
cmp edi, dword [esp + 0x14]
jl 0x4fa9e0
mov eax, dword [ebp + 0x20]
cmp eax, 2
jne 0x4faa9b
cmp dword [ebx + 0x20], eax
lea esi, [ebx + 0x20]
jne 0x4faaa2
mov dword [esi], eax
jmp 0x4faab8
test eax, eax
je 0x4faaaf
lea esi, [ebx + 0x20]
cmp dword [esi], 0
je 0x4faaaf
mov dword [esi], 1
jmp 0x4faab8
lea esi, [ebx + 0x20]
mov dword [esi], 0
cmp dword [ebp + 0x14], 0
jne 0x4faac7
push ebp
call fcn.004f8ec0
add esp, 4
mov ecx, dword [ebx + 0xc]
mov ebp, 0x8000
test ecx, ecx
je 0x4fab12
mov eax, dword [ebx + 0x2c]
dec ecx
mov edx, ecx
mov edi, ecx
shr edx, 0x12
and ecx, 7
shr edi, 3
inc ecx
and edi, 0x7fff
mov eax, dword [eax + edx*4]
mov edx, dword [eax + 4]
mov al, 1
shl al, cl
dec al
and byte [edx + edi], al
inc edi
cmp edi, ebp
jae 0x4fab12
mov eax, ebp
sub eax, edi
push eax
lea eax, [edx + edi]
push 0
push eax
call fcn.004dc1a0
add esp, 0xc
mov ecx, dword [ebx + 0xc]
test ecx, ecx
je 0x4fab5a
mov edi, dword [ebx + 0x30]
test edi, edi
je 0x4fab5a
dec ecx
mov eax, ecx
mov edx, ecx
shr eax, 0x12
and ecx, 7
shr edx, 3
inc ecx
and edx, 0x7fff
mov eax, dword [edi + eax*4]
mov edi, dword [eax + 4]
mov al, 1
shl al, cl
dec al
and byte [edi + edx], al
inc edx
cmp edx, ebp
jae 0x4fab5a
sub ebp, edx
lea eax, [edi + edx]
push ebp
push 0
push eax
call fcn.004dc1a0
add esp, 0xc
push 0
push ebx
call fcn.004f9a00
add esp, 8
test eax, eax
jne 0x4fab89
mov eax, dword [ebx + 0x30]
test eax, eax
je 0x4fab83
push dword [ebx + 8]
push eax
call fcn.004f9640
add esp, 8
mov dword [ebx + 0x30], 0
mov dword [esi], 2
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
ret