Function at 0x518950
Capabilities:
Encode data using xor

Disassembly:
sub esp, 8
push esi
mov esi, ecx
mov eax, dword [esi + 0x24]
push edi
mov edi, dword [esi + 0xc]
cmp eax, edi
mov dword [esp + 0xc], eax
jge 0x518b52
push ebx
push ebp
mov ebp, eax
cmp edi, ebp
jl 0x518a0a
jle 0x5189ef
cmp dword [esi + 0x28], edi
jge 0x5189ef
test edi, edi
je 0x51899a
lea eax, [edi*4]
push 0x10
push eax
call fcn.005475c0
add esp, 8
mov ebx, eax
mov dword [esp + 0x10], eax
jmp 0x5189a0
xor ebx, ebx
mov dword [esp + 0x10], ebx
mov edx, dword [esi + 0x24]
xor eax, eax
test edx, edx
jle 0x5189c8
mov ecx, ebx
jmp 0x5189b0
test ecx, ecx
je 0x5189bc
mov ebx, dword [esi + 0x2c]
mov ebx, dword [ebx + eax*4]
mov dword [ecx], ebx
inc eax
add ecx, 4
cmp eax, edx
jl 0x5189b0
mov ebx, dword [esp + 0x10]
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5189e5
cmp byte [esi + 0x30], 0
je 0x5189de
push eax
call fcn.00547600
add esp, 4
mov dword [esi + 0x2c], 0
mov byte [esi + 0x30], 1
mov dword [esi + 0x2c], ebx
mov dword [esi + 0x28], edi
cmp ebp, edi
mov eax, ebp
jge 0x518a0a
mov ecx, dword [esi + 0x2c]
lea ecx, [ecx + eax*4]
test ecx, ecx
je 0x518a05
mov dword [ecx], 0
inc eax
cmp eax, edi
jl 0x5189f5
mov dword [esi + 0x24], edi
mov ebx, dword [esi + 0x38]
cmp edi, ebx
mov dword [esp + 0x10], ebx
jl 0x518aaa
jle 0x518a8f
cmp dword [esi + 0x3c], edi
jge 0x518a8f
test edi, edi
je 0x518a3d
lea edx, [edi*4]
push 0x10
push edx
call fcn.005475c0
add esp, 8
mov ebp, eax
jmp 0x518a3f
xor ebp, ebp
mov edx, dword [esi + 0x38]
xor eax, eax
test edx, edx
jle 0x518a68
mov ecx, ebp
lea ebx, [ebx]
test ecx, ecx
je 0x518a60
mov ebx, dword [esi + 0x40]
mov ebx, dword [ebx + eax*4]
mov dword [ecx], ebx
mov ebx, dword [esp + 0x10]
inc eax
add ecx, 4
cmp eax, edx
jl 0x518a50
mov eax, dword [esi + 0x40]
test eax, eax
je 0x518a85
cmp byte [esi + 0x44], 0
je 0x518a7e
push eax
call fcn.00547600
add esp, 4
mov dword [esi + 0x40], 0
mov byte [esi + 0x44], 1
mov dword [esi + 0x40], ebp
mov dword [esi + 0x3c], edi
cmp ebx, edi
mov eax, ebx
jge 0x518aaa
mov ecx, dword [esi + 0x40]
lea ecx, [ecx + eax*4]
test ecx, ecx
je 0x518aa5
mov dword [ecx], 0
inc eax
cmp eax, edi
jl 0x518a95
xor eax, eax
mov dword [esi + 0x38], edi
test edi, edi
jle 0x518ac2
mov edx, dword [esi + 0x2c]
mov dword [edx + eax*4], 0xffffffff
inc eax
cmp eax, edi
jl 0x518ab3
xor eax, eax
test edi, edi
jle 0x518adf
jmp 0x518ad0
mov ecx, dword [esi + 0x40]
mov dword [ecx + eax*4], 0xffffffff
inc eax
cmp eax, edi
jl 0x518ad0
xor edx, edx
cmp dword [esp + 0x14], edx
jle 0x518b50
xor edi, edi
lea esp, [esp]
mov ecx, dword [esi + 0x10]
mov eax, dword [ecx + edi + 4]
mov eax, dword [eax + 0xc]
add ecx, edi
mov ecx, dword [ecx]
shl eax, 0x10
or eax, dword [ecx + 0xc]
mov ebx, dword [esi + 0x40]
mov ecx, eax
shl ecx, 0xf
not ecx
add eax, ecx
mov ecx, eax
sar ecx, 0xa
xor ecx, eax
lea eax, [ecx + ecx*8]
mov ecx, eax
sar ecx, 6
xor eax, ecx
mov ecx, eax
shl ecx, 0xb
not ecx
add eax, ecx
mov ecx, eax
sar ecx, 0x10
xor ecx, eax
mov eax, dword [esi + 0xc]
dec eax
and ecx, eax
mov eax, dword [esi + 0x2c]
mov eax, dword [eax + ecx*4]
mov dword [ebx + edx*4], eax
mov eax, dword [esi + 0x2c]
mov dword [eax + ecx*4], edx
inc edx
add edi, 0x10
cmp edx, dword [esp + 0x14]
jl 0x518af0
pop ebp
pop ebx
pop edi
pop esi
add esp, 8
ret