Function at 0x5989b0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x18
mov ecx, dword [esp + 0x20]
push ebx
push ebp
mov ebp, dword [esp + 0x24]
movzx eax, word [ebp + 4]
push esi
push edi
xor edi, edi
mov dword [esp + 0x24], eax
mov eax, dword [ebp]
cmp dword [eax + 0x14], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
je 0x5989f0
cmp dword [eax + 0x18], 0xffffffff
je 0x5989fe
mov edx, dword [eax + 0x1c]
cmp edx, ecx
mov dword [eax + 0x18], ecx
ja 0x5989eb
mov ecx, edx
mov dword [eax + 0x18], ecx
jmp 0x5989fe
push edi
push ecx
mov ecx, dword [eax + 4]
push ecx
call fcn.006081d8
add esp, 0xc
mov esi, dword [ebp]
mov ecx, dword [esi + 0x14]
cmp ecx, edi
je 0x598a52
mov eax, dword [esi + 0x1c]
mov ebx, 1
cmp eax, ebx
jb 0x598a1e
mov edi, dword [esi + 0x18]
lea edx, [edi + 1]
cmp edx, eax
jbe 0x598a2b
mov edi, dword [esi + 0x18]
sub eax, edi
mov ebx, eax
je 0x598dde
lea eax, [edi + ecx]
push ebx
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0060d1b0
add edi, ebx
add esp, 0xc
cmp ebx, 1
mov dword [esi + 0x18], edi
jne 0x598dde
movzx eax, byte [esp + 0x2c]
jmp 0x598a66
mov esi, dword [esi + 4]
cmp esi, edi
je 0x598a64
push esi
call fcn.0060963d
add esp, 4
jmp 0x598a66
xor eax, eax
test eax, eax
jne 0x598dde
mov esi, dword [ebp]
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x598abd
lea ebx, [eax + 1]
mov eax, dword [esi + 0x1c]
cmp eax, ebx
jb 0x598a8c
mov edi, dword [esi + 0x18]
lea edx, [edi + 1]
cmp edx, eax
jbe 0x598a95
mov edi, dword [esi + 0x18]
sub eax, edi
mov ebx, eax
je 0x598ab8
lea eax, [edi + ecx]
push ebx
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0060d1b0
add edi, ebx
add esp, 0xc
cmp ebx, 1
mov dword [esi + 0x18], edi
jne 0x598ab8
movzx eax, byte [esp + 0x2c]
jmp 0x598ad1
or eax, 0xffffffff
jmp 0x598ad1
mov esi, dword [esi + 4]
test esi, esi
je 0x598acf
push esi
call fcn.0060963d
add esp, 4
jmp 0x598ad1
xor eax, eax
add eax, 0xffffffb3
jne 0x598dde
mov esi, dword [ebp]
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x598b29
lea ebx, [eax + 1]
mov eax, dword [esi + 0x1c]
cmp eax, ebx
jb 0x598af8
mov edi, dword [esi + 0x18]
lea edx, [edi + 1]
cmp edx, eax
jbe 0x598b01
mov edi, dword [esi + 0x18]
sub eax, edi
mov ebx, eax
je 0x598b24
lea eax, [edi + ecx]
push ebx
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0060d1b0
add edi, ebx
add esp, 0xc
cmp ebx, 1
mov dword [esi + 0x18], edi
jne 0x598b24
movzx eax, byte [esp + 0x2c]
jmp 0x598b3d
or eax, 0xffffffff
jmp 0x598b3d
mov esi, dword [esi + 4]
test esi, esi
je 0x598b3b
push esi
call fcn.0060963d
add esp, 4
jmp 0x598b3d
xor eax, eax
add eax, 0xffffffae
jne 0x598dde
mov esi, dword [ebp]
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x598b95
lea ebx, [eax + 1]
mov eax, dword [esi + 0x1c]
cmp eax, ebx
jb 0x598b64
mov edi, dword [esi + 0x18]
lea edx, [edi + 1]
cmp edx, eax
jbe 0x598b6d
mov edi, dword [esi + 0x18]
sub eax, edi
mov ebx, eax
je 0x598b90
lea eax, [edi + ecx]
push ebx
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.0060d1b0
add edi, ebx
add esp, 0xc
cmp ebx, 1
mov dword [esi + 0x18], edi
jne 0x598b90
movzx eax, byte [esp + 0x2c]
jmp 0x598ba9
or eax, 0xffffffff
jmp 0x598ba9
mov esi, dword [esi + 4]
test esi, esi
je 0x598ba7
push esi
call fcn.0060963d
add esp, 4
jmp 0x598ba9
xor eax, eax
imul eax, eax, 0x101
mov esi, ebp
mov word [ebp + 4], ax
call fcn.0057e000
mov edx, dword [esp + 0x30]
lea eax, [eax + edx + 8]
mov dword [esp + 0x14], eax
mov eax, dword [ebp]
cmp dword [eax + 0x14], 0
je 0x598bd4
mov eax, dword [eax + 0x18]
jmp 0x598be0
mov ecx, dword [eax + 4]
push ecx
call fcn.00609413
add esp, 4
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x18], eax
jge 0x598dbd
mov dword [esp + 0x2c], 0
mov dword [esp + 0x10], 4
mov edi, edi
mov esi, dword [ebp]
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x598c51
mov eax, dword [esi + 0x1c]
mov ebx, 1
cmp eax, ebx
jb 0x598c20
mov edi, dword [esi + 0x18]
lea edx, [edi + 1]
cmp edx, eax
jbe 0x598c29
mov edi, dword [esi + 0x18]
sub eax, edi
mov ebx, eax
je 0x598c4c
lea eax, [edi + ecx]
push ebx
push eax
lea ecx, [esp + 0x38]
push ecx
call fcn.0060d1b0
add edi, ebx
add esp, 0xc
cmp ebx, 1
mov dword [esi + 0x18], edi
jne 0x598c4c
movzx eax, byte [esp + 0x30]
jmp 0x598c65
or eax, 0xffffffff
jmp 0x598c65
mov esi, dword [esi + 4]
test esi, esi
je 0x598c63
push esi
call fcn.0060963d
add esp, 4
jmp 0x598c65
xor eax, eax
mov edx, dword [esp + 0x2c]
shl edx, 8
or edx, eax
sub dword [esp + 0x10], 1
mov dword [esp + 0x2c], edx
jne 0x598c00
mov esi, ebp
call fcn.0057e000
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x2c]
cmp eax, 0x505244
je 0x598d29
cmp eax, 0x545457
je 0x598cfb
cmp eax, 0x574247
jne 0x598d76
call fcn.0057e000
xor eax, eax
mov edi, str.DiMAGE_A200
lea esi, [ebp + 0x255]
mov ecx, 0xc
repe cmpsb byte [esi], byte es:[edi]
mov ebx, eax
setne bl
sub ebx, 1
and ebx, 3
xor edi, edi
jmp 0x598cd0
mov esi, ebp
call fcn.0057df50
movzx ecx, ax
mov edx, edi
sar edx, 1
xor edx, edi
mov dword [esp + 0x2c], ecx
xor edx, ebx
fild dword [esp + 0x2c]
add edi, 1
cmp edi, 4
fstp dword [ebp + edx*4 + 0x205c8]
jl 0x598cd0
jmp 0x598d76
mov eax, dword [ebp]
cmp dword [eax + 0x14], 0
je 0x598d09
mov eax, dword [eax + 0x18]
jmp 0x598d15
mov eax, dword [eax + 4]
push eax
call fcn.00609413
add esp, 4
push eax
mov ecx, ebp
call fcn.00598280
mov ecx, dword [esp + 0x14]
mov dword [ebp + 0x348], ecx
jmp 0x598d76
mov eax, dword [ebp]
cmp dword [eax + 0x14], 0
je 0x598d4e
mov ecx, dword [eax + 0x18]
cmp ecx, 0xffffffff
je 0x598d5e
mov edx, dword [eax + 0x1c]
add ecx, 8
cmp edx, ecx
mov dword [eax + 0x18], ecx
ja 0x598d49
mov ecx, edx
mov dword [eax + 0x18], ecx
jmp 0x598d5e
mov edx, dword [eax + 4]
push 1
push 8
push edx
call fcn.006081d8
add esp, 0xc
call fcn.0057df50
movzx eax, ax
mov dword [esp + 0x1c], eax
call fcn.0057df50
movzx ecx, ax
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
lea ecx, [edx + eax + 8]
mov eax, dword [ebp]
cmp dword [eax + 0x14], 0
je 0x598da9
cmp dword [eax + 0x18], 0xffffffff
je 0x598bc6
mov edx, dword [eax + 0x1c]
cmp edx, ecx
mov dword [eax + 0x18], ecx
ja 0x598da1
mov ecx, edx
mov dword [eax + 0x18], ecx
jmp 0x598bc6
push 0
push ecx
mov ecx, dword [eax + 4]
push ecx
call fcn.006081d8
add esp, 0xc
jmp 0x598bc6
mov dx, word [esp + 0x1c]
mov ax, word [esp + 0x20]
mov cx, word [esp + 0x24]
mov word [ebp + 0x45c], dx
mov word [ebp + 0x45e], ax
mov word [ebp + 4], cx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 8