Function at 0x516ea0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x5b0008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x14]
mov edi, dword [esi + 0x10de4]
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x1c], eax
cmp dword [esi + 0x10de0], edi
je 0x516efb
imul ecx, edi, 0x2c
mov edx, dword [ecx + esi + 0x10dfc]
mov eax, edx
sub eax, edi
mov edi, dword [ebp - 0x1c]
mov dword [edi], eax
mov eax, dword [ecx + esi + 0x10e00]
mov dword [esi + 0x10de4], edx
jmp 0x51711d
cmp dword [ebx + 0x18], 0
jne 0x516fba
cmp dword [esi + 0x10d98], 0x80
jb 0x516f1a
push esi
call fcn.00515920
add esp, 4
cmp dword [esi + 0x10ddc], 0x10
jb 0x516fba
xor eax, eax
lea ecx, [esi + 0x10d9c]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x18], ecx
nop word [eax + eax]
mov edi, eax
mov dword [ebp - 0x28], 4
mov dword [ebp - 0x24], 0
mov ebx, 1
nop word [eax + eax]
movzx ecx, word [esi + ebx*2 + 0x70e4]
mov edx, edi
and edx, 1
shr ecx, 4
mov eax, edx
shr edi, 1
neg eax
shr eax, 4
and eax, 0x7f
lea ebx, [edx + ebx*2]
xor ecx, eax
movzx eax, byte [ecx + 0x561b68]
mov ecx, dword [ebp - 0x24]
add ecx, eax
sub dword [ebp - 0x28], 1
mov dword [ebp - 0x24], ecx
jne 0x516f60
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
inc eax
mov dword [ebp - 0x2c], eax
mov dword [edx], ecx
add edx, 4
mov dword [ebp - 0x18], edx
cmp eax, 0x10
jb 0x516f40
mov ebx, dword [ebp - 0x30]
mov dword [esi + 0x10ddc], 0
push dword [ebp + 0x18]
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push ebx
push esi
call fcn.00515bb0
add esp, 0x14
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x517122
movups xmm0, xmmword [esi + 0x1e8]
mov edi, 1
movups xmmword [ebp - 0x14], xmm0
cmp eax, edi
jbe 0x517060
lea eax, [esi + 0x1f8]
lea ecx, [esi + 0xa88]
nop dword [eax]
push eax
push ecx
push ebx
call fcn.00518050
add esp, 0xc
mov dword [esi + 0xa8c], eax
cmp eax, dword [ebx + 0x48]
jae 0x517060
mov edx, dword [ebx + 0x14]
mov eax, 0xfff
mov ecx, dword [ebx + 0x20]
sub eax, edi
sub ecx, edx
inc ecx
cmp ecx, eax
cmovae ecx, eax
mov eax, dword [ebp + 0x18]
push ecx
push dword [ebx + 0x48]
add eax, edi
dec edx
push edi
push eax
push dword [ebp - 0x18]
mov eax, dword [ebx]
add eax, edx
push eax
lea eax, [ebp - 0x14]
push eax
push esi
call fcn.005161e0
inc edi
mov dword [ebp - 0x18], eax
add esp, 0x20
lea ecx, [esi + 0xa88]
cmp edi, eax
lea eax, [esi + 0x1f8]
jb 0x517000
imul eax, edi, 0x2c
mov dword [esi + 0x10de0], edi
mov ebx, dword [eax + esi + 0x10dfc]
mov eax, dword [eax + esi + 0x10e00]
mov dword [ebp - 0x18], eax
nop word [eax + eax]
imul edx, edi, 0x2c
add edx, esi
cmp byte [edx + 0x10dec], 0
je 0x5170d5
imul ecx, ebx, 0x2c
lea eax, [ebx - 1]
add ecx, esi
mov dword [ecx + 0x10e00], 0xffffffff
mov byte [ecx + 0x10dec], 0
mov dword [ecx + 0x10dfc], eax
cmp byte [edx + 0x10ded], 0
je 0x5170d5
mov byte [ecx + 0x10dc0], 0
mov eax, dword [edx + 0x10df0]
mov dword [ecx + 0x10dd0], eax
mov eax, dword [edx + 0x10df4]
mov dword [ecx + 0x10dd4], eax
mov ecx, dword [ebp - 0x18]
mov edx, ebx
imul eax, ebx, 0x2c
mov ebx, dword [eax + esi + 0x10e00]
mov dword [ebp - 0x18], ebx
mov ebx, dword [eax + esi + 0x10dfc]
mov dword [eax + esi + 0x10dfc], edi
mov edi, edx
mov dword [eax + esi + 0x10e00], ecx
test edx, edx
jne 0x517080
mov edi, dword [ebp - 0x1c]
mov eax, dword [esi + 0x10dfc]
mov dword [esi + 0x10de4], eax
mov dword [edi], eax
mov eax, dword [esi + 0x10e00]
mov ecx, dword [ebp - 0x20]
mov dword [ecx], eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00518799
mov esp, ebp
pop ebp
ret