Function at 0x59a760
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
push ebx
push esi
mov esi, eax
mov eax, dword [esi]
cmp dword [eax + 0x14], 0
je 0x59a786
cmp dword [eax + 0x18], 0xffffffff
je 0x59a795
mov edx, dword [eax + 0x1c]
cmp edx, ecx
mov dword [eax + 0x18], ecx
ja 0x59a781
mov ecx, edx
mov dword [eax + 0x18], ecx
jmp 0x59a795
mov eax, dword [eax + 4]
push 0
push ecx
push eax
call fcn.006081d8
add esp, 0xc
call fcn.0057e000
mov ebx, eax
cmp ebx, 0xff
ja 0x59a9f6
test ebx, ebx
je 0x59a9b6
push ebp
push edi
sub ebx, 1
mov dword [esp + 0x18], ebx
call fcn.0057df50
movzx edi, ax
call fcn.0057df50
movzx ecx, ax
mov eax, dword [esi]
cmp dword [eax + 0x14], 0
mov dword [esp + 0x1c], ecx
je 0x59a7de
mov edx, dword [eax + 0x18]
mov dword [esp + 0x14], edx
jmp 0x59a7ee
mov eax, dword [eax + 4]
push eax
call fcn.00609413
add esp, 4
mov dword [esp + 0x14], eax
cmp edi, 0x100
jne 0x59a813
call fcn.0057df50
mov word [esi + 0x45c], ax
call fcn.0057df50
mov word [esi + 0x45e], ax
jmp 0x59a974
cmp edi, 0x121
jne 0x59a84b
call fcn.0057df50
mov word [esi + 0x460], ax
call fcn.0057df50
cmp ax, 0x10bc
mov word [esi + 0x462], ax
jne 0x59a974
mov word [esi + 0x462], 0x10bf
jmp 0x59a974
cmp edi, 0x130
jne 0x59a942
mov edi, dword [esi]
mov ecx, dword [edi + 0x14]
test ecx, ecx
je 0x59a8a7
mov eax, dword [edi + 0x1c]
mov ebp, 1
cmp eax, ebp
jb 0x59a876
mov ebx, dword [edi + 0x18]
lea edx, [ebx + 1]
cmp edx, eax
jbe 0x59a87f
mov ebx, dword [edi + 0x18]
sub eax, ebx
mov ebp, eax
je 0x59a8a2
lea eax, [ebx + ecx]
push ebp
push eax
lea ecx, [esp + 0x1a]
push ecx
call fcn.0060d1b0
add ebx, ebp
add esp, 0xc
cmp ebp, 1
mov dword [edi + 0x18], ebx
jne 0x59a8a2
movzx eax, byte [esp + 0x12]
jmp 0x59a8bb
or eax, 0xffffffff
jmp 0x59a8bb
mov edi, dword [edi + 4]
test edi, edi
je 0x59a8b9
push edi
call fcn.0060963d
add esp, 4
jmp 0x59a8bb
xor eax, eax
mov edi, dword [esi]
sar eax, 7
mov dword [esi + 0x36c], eax
mov ecx, dword [edi + 0x14]
test ecx, ecx
je 0x59a914
mov eax, dword [edi + 0x1c]
mov ebp, 1
cmp eax, ebp
jb 0x59a8e3
mov ebx, dword [edi + 0x18]
lea edx, [ebx + 1]
cmp edx, eax
jbe 0x59a8ec
mov ebx, dword [edi + 0x18]
sub eax, ebx
mov ebp, eax
je 0x59a90f
lea eax, [ebx + ecx]
push ebp
push eax
lea ecx, [esp + 0x1b]
push ecx
call fcn.0060d1b0
add ebx, ebp
add esp, 0xc
cmp ebp, 1
mov dword [edi + 0x18], ebx
jne 0x59a90f
movzx eax, byte [esp + 0x13]
jmp 0x59a928
or eax, 0xffffffff
jmp 0x59a928
mov edi, dword [edi + 4]
test edi, edi
je 0x59a926
push edi
call fcn.0060963d
add esp, 4
jmp 0x59a928
xor eax, eax
test al, 8
mov eax, fcn.00585b30
jne 0x59a936
mov eax, 0x582f00
mov ebx, dword [esp + 0x18]
mov dword [esi + 0x9692c], eax
jmp 0x59a974
cmp edi, 0x2ff0
jne 0x59a974
xor edi, edi
lea esp, [esp]
call fcn.0057df50
movzx edx, ax
mov dword [esp + 0x18], edx
mov eax, edi
xor eax, 1
fild dword [esp + 0x18]
add edi, 1
cmp edi, 4
fstp dword [esi + eax*4 + 0x205c8]
jb 0x59a950
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
mov eax, dword [esi]
add ecx, edx
cmp dword [eax + 0x14], 0
je 0x59a99d
cmp dword [eax + 0x18], 0xffffffff
je 0x59a9ac
mov edx, dword [eax + 0x1c]
cmp edx, ecx
mov dword [eax + 0x18], ecx
ja 0x59a998
mov ecx, edx
mov dword [eax + 0x18], ecx
jmp 0x59a9ac
mov eax, dword [eax + 4]
push 0
push ecx
push eax
call fcn.006081d8
add esp, 0xc
test ebx, ebx
jne 0x59a7b2
pop edi
pop ebp
cmp word [esi + 0x45c], 0
jne 0x59a9de
mov dword [esi + 0x338], 0x16161616
mov dword [esi + 0x9692c], 0x585670
mov dword [esi + 0x458], 0x18
movzx eax, word [esi + 0x36c]
mov cx, ax
shl word [esi + 0x460], cl
shr word [esi + 0x462], cl
pop esi
pop ebx
add esp, 0x10
ret