Function at 0x5fa330
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x402c
call fcn.006272c0
mov eax, dword [0x6a6040]
xor eax, esp
mov dword [esp + 0x4028], eax
mov eax, dword [esp + 0x4034]
push ebx
mov ebx, dword [esp + 0x4034]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x4044]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x4048]
mov dword [esp + 0x24], eax
push ebp
mov ebp, ecx
mov dword [esp + 0x24], ebp
push esi
mov esi, dword [esp + 0x4048]
test ebx, ebx
jne 0x5fa38a
lea ebx, [ebp + 0x1000]
mov eax, dword [esp + 0x4044]
xor cl, cl
mov edx, dword [esi]
mov esi, dword [esi + 4]
shr eax, 3
push edi
xor edi, edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], esi
mov byte [esp + 0x13], cl
mov dword [esp + 0x14], eax
test eax, eax
je 0x5fa3ef
lea eax, [esp + 0x24]
mov ecx, ebp
push eax
push ebx
call fcn.005f9480
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
mov ecx, dword [eax + edi*8]
xor edx, ecx
mov eax, dword [eax + edi*8 + 4]
xor esi, eax
add cl, al
mov dword [esp + 0x24], edx
add byte [esp + 0x13], cl
inc edi
mov dword [esp + 0x28], esi
cmp edi, dword [esp + 0x14]
jb 0x5fa3b2
mov cl, byte [esp + 0x13]
mov eax, dword [esp + 0x4048]
and eax, 7
je 0x5fa44a
push eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0
lea eax, [eax + edi*8]
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.00609db0
add esp, 0xc
lea eax, [esp + 0x24]
mov ecx, ebp
push eax
push ebx
call fcn.005f9480
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
xor esi, eax
mov edx, dword [esp + 0x24]
add al, cl
xor edx, ecx
mov cl, byte [esp + 0x13]
add cl, al
movzx edi, cl
mov eax, ebx
test ebx, ebx
jne 0x5fa459
lea eax, [ebp + 0x1000]
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], edx
push ecx
push eax
mov ecx, ebp
mov dword [esp + 0x28], esi
call fcn.005f9480
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
movaps xmm1, xmmword [0x66fde0]
xor eax, edi
mov dword [esp + 0x14], eax
mov ecx, 8
mov eax, dword [esp + 0x20]
xor eax, dword [esp + 0x4048]
mov dword [esp + 0x1c], eax
nop word [eax + eax]
lea eax, [ecx - 8]
movd xmm0, eax
lea edx, [edx + 0x20]
pshufd xmm0, xmm0, 0
lea eax, [ecx - 4]
paddd xmm0, xmm1
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x28], xmm0
movd xmm0, eax
lea eax, [ecx + 4]
pshufd xmm0, xmm0, 0
paddd xmm0, xmm1
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x20], xmm0
movd xmm0, ecx
add ecx, 0x10
pshufd xmm0, xmm0, 0
paddd xmm0, xmm1
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x18], xmm0
movd xmm0, eax
lea eax, [ecx - 8]
pshufd xmm0, xmm0, 0
paddd xmm0, xmm1
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x10], xmm0
cmp eax, 0x2000
jl 0x5fa4a0
lea esi, [esp + 0x38]
mov edi, esi
test ebx, ebx
jne 0x5fa551
lea ebx, [ebp + 0x1000]
mov eax, dword [esp + 0x14]
mov ebp, 0x800
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x14]
push eax
push ebx
call fcn.005f9480
mov edx, dword [esp + 0x14]
lea edi, [edi + 8]
xor edx, dword [edi - 8]
lea esi, [esi + 8]
mov eax, dword [edi - 4]
mov ecx, dword [esp + 0x18]
xor ecx, eax
mov dword [esi - 8], edx
mov dword [esi - 4], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ecx
sub ebp, 1
jne 0x5fa566
mov ebx, dword [esp + 0x30]
lea eax, [esp + 0x4038]
mov esi, dword [esp + 0x34]
sub eax, ebx
pop edi
push ebx
push eax
push esi
call fcn.00609db0
add esp, 0xc
xor eax, eax
test ebx, ebx
jle 0x5fa5d2
cmp byte [esi + eax], 0
jne 0x5fa5ce
inc eax
cmp eax, ebx
jl 0x5fa5c1
jmp 0x5fa5d2
cmp eax, ebx
jl 0x5fa5d5
mov byte [esi], 1
mov ecx, dword [esp + 0x4034]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00606a47
add esp, 0x402c
ret 0x18