Function at 0x5b3150
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x460
mov eax, dword [0x675978]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x424], eax
mov dword [ebp - 0x440], ecx
mov dword [ecx], 0
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x41c], edi
test eax, eax
je 0x5b3b49
push ebx
push esi
push eax
call fcn.005b2c00
mov ebx, eax
add esp, 4
mov dword [ebp - 0x420], ebx
test ebx, ebx
jne 0x5b3208
mov eax, dword [str..pat]
xor esi, esi
test eax, eax
je 0x5b3b47
push eax
push dword [ebp - 0x424]
lea eax, [ebp - 0x404]
push str._s_s
push 0x400
push eax
call sym.BZDPatcher.exe_SDL_snprintf
lea eax, [ebp - 0x404]
push eax
call fcn.005b2c00
mov ebx, eax
mov dword [ebp - 0x420], eax
add esp, 0x18
test ebx, ebx
jne 0x5b3208
mov eax, dword [esi*4 + 0x675968]
inc esi
test eax, eax
jne 0x5b31b3
pop esi
pop ebx
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
push 0xef
push 1
lea eax, [ebp - 0x404]
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 0xef
jne 0x5b3b32
push 0x16
lea eax, [ebp - 0x404]
push str.GF1PATCH110
push eax
call sym.BZDPatcher.exe_SDL_memcmp
add esp, 0xc
test eax, eax
je 0x5b3262
push 0x16
lea eax, [ebp - 0x404]
push str.GF1PATCH100
push eax
call sym.BZDPatcher.exe_SDL_memcmp
add esp, 0xc
test eax, eax
jne 0x5b3b32
mov al, byte [ebp - 0x3b2]
cmp al, 1
je 0x5b3274
test al, al
jne 0x5b3b32
mov al, byte [ebp - 0x36d]
cmp al, 1
je 0x5b3286
test al, al
jne 0x5b3b32
push 8
call sym.BZDPatcher.exe_SDL_malloc
mov esi, eax
add esp, 4
mov eax, dword [ebp - 0x440]
mov dword [ebp - 0x40c], esi
mov dword [eax], esi
test esi, esi
je 0x5b3ae1
movsx ecx, byte [ebp - 0x33e]
mov dword [esi], ecx
imul ecx, ecx, 0x6c
push ecx
call sym.BZDPatcher.exe_SDL_malloc
add esp, 4
mov dword [esi + 4], eax
test eax, eax
je 0x5b3ae1
cmp dword [esi], 0
mov dword [ebp - 0x424], 0
jle 0x5b3abb
fld qword [0x63cc48]
fstp qword [ebp - 0x448]
fld qword [0x636930]
fstp qword [ebp - 0x450]
fld qword [0x604090]
fstp qword [ebp - 0x458]
fld qword [0x636928]
fstp qword [ebp - 0x460]
mov dword [ebp - 0x42c], 0
push 1
push 0
push 7
push ebx
call sym.BZDPatcher.exe_SDL_RWseek
push 1
push 1
lea eax, [ebp - 0x411]
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x20
cmp eax, 1
jne 0x5b3af3
mov esi, dword [esi + 4]
add esi, dword [ebp - 0x42c]
push eax
push 4
lea eax, [ebp - 0x418]
mov dword [ebp - 0x438], esi
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov eax, dword [ebp - 0x418]
push 1
mov dword [esi + 8], eax
lea eax, [ebp - 0x418]
push 4
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov eax, dword [ebp - 0x418]
push 1
mov dword [esi], eax
lea eax, [ebp - 0x418]
push 4
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov eax, dword [ebp - 0x418]
push 1
mov dword [esi + 4], eax
lea eax, [ebp - 0x428]
push 2
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
movzx eax, word [ebp - 0x428]
push 1
mov dword [esi + 0xc], eax
lea eax, [ebp - 0x418]
push 4
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov eax, dword [ebp - 0x418]
push 1
mov dword [esi + 0x10], eax
lea eax, [ebp - 0x418]
push 4
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov eax, dword [ebp - 0x418]
push 1
mov dword [esi + 0x14], eax
lea eax, [ebp - 0x418]
push 4
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov eax, dword [ebp - 0x418]
push 1
push 0
push 2
push ebx
mov dword [esi + 0x18], eax
call sym.BZDPatcher.exe_SDL_RWseek
push 1
push 1
lea eax, [ebp - 0x405]
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x20
cmp eax, 1
jne 0x5b3aed
mov al, byte [ebp - 0x405]
mov ecx, dword [ebp + 0x18]
mov byte [ebp - 0x404], al
cmp ecx, 0xffffffff
jne 0x5b349a
shl al, 3
add al, 4
jmp 0x5b349c
mov al, cl
and al, 0x7f
push 0x12
mov byte [esi + 0x67], al
lea eax, [ebp - 0x404]
push 1
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 0x12
jne 0x5b3aed
cmp byte [ebp - 0x3f7], 0
je 0x5b351b
cmp byte [ebp - 0x3f6], 0
je 0x5b351b
mov al, byte [ebp - 0x3f8]
test al, al
jne 0x5b34de
xor eax, eax
jmp 0x5b34f2
movzx ecx, al
imul eax, dword [edi + 0xf2cc], 0x260000
imul ecx, dword [edi + 0xc]
cdq
idiv ecx
mov dword [esi + 0x54], eax
movzx eax, byte [ebp - 0x3f7]
imul eax, dword [edi + 0xf2cc]
imul ecx, dword [edi + 0xc], 0x26
shl eax, 0xf
cdq
idiv ecx
mov dword [esi + 0x58], eax
mov al, byte [ebp - 0x3f6]
mov byte [esi + 0x64], al
jmp 0x5b352d
mov byte [esi + 0x64], 0
mov dword [esi + 0x58], 0
mov dword [esi + 0x54], 0
mov al, byte [ebp - 0x3f4]
test al, al
je 0x5b35d7
cmp byte [ebp - 0x3f3], 0
je 0x5b35d7
movzx ecx, al
imul eax, dword [edi + 0xc], 0x26
shl ecx, 6
cdq
idiv ecx
mov dword [esi + 0x60], eax
cmp byte [ebp - 0x3f5], 0
mov dword [ebp - 0x410], eax
jne 0x5b3577
xor eax, eax
mov dword [esi + 0x5c], eax
mov al, byte [ebp - 0x3f3]
mov byte [esi + 0x65], al
jmp 0x5b35e9
fild dword [ebp - 0x410]
fstp qword [ebp - 0x434]
fld qword [ebp - 0x434]
fmul qword [ebp - 0x448]
movzx eax, byte [ebp - 0x3f5]
imul eax, dword [edi + 0xc]
fmul qword [ebp - 0x450]
fstp dword [ebp - 0x410]
fld dword [ebp - 0x410]
mov dword [ebp - 0x410], eax
fild dword [ebp - 0x410]
fstp qword [ebp - 0x434]
fdiv qword [ebp - 0x434]
call fcn.004867c0
mov dword [esi + 0x5c], eax
mov al, byte [ebp - 0x3f3]
mov byte [esi + 0x65], al
jmp 0x5b35e9
mov byte [esi + 0x65], 0
mov dword [esi + 0x60], 0
mov dword [esi + 0x5c], 0
push 1
push 1
lea eax, [ebp - 0x405]
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
mov al, byte [ebp - 0x405]
push 1
push 0
push 0x28
push ebx
mov byte [esi + 0x66], al
call sym.BZDPatcher.exe_SDL_RWseek
mov ecx, dword [ebp + 0x20]
xor edx, edx
add esp, 0x10
movzx eax, cl
cmp ecx, 0xffffffff
cmove eax, edx
mov byte [esi + 0x68], al
mov cl, byte [esi + 0x66]
test cl, 4
je 0x5b363d
or cl, 0x20
mov byte [esi + 0x66], cl
cmp dword [ebp + 0x24], 1
mov al, cl
jne 0x5b364f
test cl, 0x3c
je 0x5b364f
and al, 0xc3
mov byte [esi + 0x66], al
mov ecx, dword [ebp + 0x28]
cmp ecx, 1
jne 0x5b365e
and al, 0xbf
mov byte [esi + 0x66], al
jmp 0x5b36a2
test ecx, ecx
je 0x5b36a2
test al, 0x1c
jne 0x5b366d
and al, 0x9f
mov byte [esi + 0x66], al
jmp 0x5b36a2
push 6
lea eax, [ebp - 0x404]
push 0x63cc40
push eax
call sym.BZDPatcher.exe_SDL_memcmp
add esp, 0xc
test eax, eax
je 0x5b369e
cmp byte [ebp - 0x3f9], 0x64
jge 0x5b369e
mov al, byte [esi + 0x66]
test al, 0x20
jne 0x5b36a2
and al, 0xbf
mov byte [esi + 0x66], al
jmp 0x5b36a2
and byte [esi + 0x66], 0xbf
movzx edx, byte [ebp - 0x404]
mov ecx, 3
mov eax, edx
and edx, 0x3f
shr eax, 6
sub ecx, eax
lea ecx, [ecx + ecx*2]
shl edx, cl
mov ecx, 3
imul eax, edx, 0xac44
cdq
idiv dword [edi + 0xc]
imul eax, dword [edi + 0xf2cc]
shl eax, 0xa
mov dword [esi + 0x1c], eax
movzx eax, byte [ebp - 0x3fe]
shl eax, 0x16
mov dword [esi + 0x34], eax
movzx edx, byte [ebp - 0x403]
mov eax, edx
and edx, 0x3f
shr eax, 6
sub ecx, eax
lea ecx, [ecx + ecx*2]
shl edx, cl
mov ecx, 3
imul eax, edx, 0xac44
cdq
idiv dword [edi + 0xc]
imul eax, dword [edi + 0xf2cc]
shl eax, 0xa
mov dword [esi + 0x20], eax
movzx eax, byte [ebp - 0x3fd]
shl eax, 0x16
mov dword [esi + 0x38], eax
movzx edx, byte [ebp - 0x402]
mov eax, edx
and edx, 0x3f
shr eax, 6
sub ecx, eax
lea ecx, [ecx + ecx*2]
shl edx, cl
mov ecx, 3
imul eax, edx, 0xac44
cdq
idiv dword [edi + 0xc]
imul eax, dword [edi + 0xf2cc]
shl eax, 0xa
mov dword [esi + 0x24], eax
movzx eax, byte [ebp - 0x3fc]
shl eax, 0x16
mov dword [esi + 0x3c], eax
movzx edx, byte [ebp - 0x401]
mov eax, edx
and edx, 0x3f
shr eax, 6
sub ecx, eax
lea ecx, [ecx + ecx*2]
shl edx, cl
mov ecx, 3
imul eax, edx, 0xac44
cdq
idiv dword [edi + 0xc]
imul eax, dword [edi + 0xf2cc]
shl eax, 0xa
mov dword [esi + 0x28], eax
movzx eax, byte [ebp - 0x3fb]
shl eax, 0x16
mov dword [esi + 0x40], eax
movzx edx, byte [ebp - 0x400]
mov eax, edx
and edx, 0x3f
shr eax, 6
sub ecx, eax
lea ecx, [ecx + ecx*2]
shl edx, cl
imul eax, edx, 0xac44
cdq
idiv dword [edi + 0xc]
imul eax, dword [edi + 0xf2cc]
shl eax, 0xa
mov dword [esi + 0x2c], eax
mov ecx, 3
movzx eax, byte [ebp - 0x3fa]
shl eax, 0x16
mov dword [esi + 0x44], eax
movzx edx, byte [ebp - 0x3ff]
mov eax, edx
and edx, 0x3f
shr eax, 6
sub ecx, eax
lea ecx, [ecx + ecx*2]
shl edx, cl
imul eax, edx, 0xac44
cdq
idiv dword [edi + 0xc]
imul eax, dword [edi + 0xf2cc]
shl eax, 0xa
mov dword [esi + 0x30], eax
movzx eax, byte [ebp - 0x3f9]
shl eax, 0x16
mov dword [esi + 0x48], eax
mov eax, dword [esi + 8]
add eax, 4
push eax
call sym.BZDPatcher.exe_SDL_malloc
add esp, 4
mov dword [esi + 0x50], eax
test eax, eax
je 0x5b3adb
push 1
push dword [esi + 8]
push eax
push ebx
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
jne 0x5b3aed
test byte [esi + 0x66], al
jne 0x5b38ca
mov eax, dword [esi + 0x50]
mov edi, dword [esi + 8]
mov dword [ebp - 0x410], eax
mov eax, dword [esi]
add eax, eax
mov dword [esi], eax
lea ecx, [edi + edi]
mov eax, dword [esi + 4]
add eax, eax
mov dword [esi + 8], ecx
mov dword [esi + 4], eax
lea eax, [ecx + 4]
push eax
call sym.BZDPatcher.exe_SDL_malloc
add esp, 4
mov dword [ebp - 0x430], eax
mov edx, eax
test eax, eax
je 0x5b3ad5
test edi, edi
je 0x5b38b6
mov ecx, dword [ebp - 0x410]
lea esp, [esp]
movzx eax, byte [ecx]
lea edx, [edx + 2]
shl ax, 8
lea ecx, [ecx + 1]
mov word [edx - 2], ax
sub edi, 1
jne 0x5b38a0
push dword [esi + 0x50]
call sym.BZDPatcher.exe_SDL_free
mov eax, dword [ebp - 0x430]
add esp, 4
mov dword [esi + 0x50], eax
test byte [esi + 0x66], 2
je 0x5b38ed
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0x50]
cdq
sub eax, edx
sar eax, 1
je 0x5b38ed
mov edx, 0xffff8000
xor word [ecx], dx
lea ecx, [ecx + 2]
sub eax, 1
jne 0x5b38e2
test byte [esi + 0x66], 0x10
je 0x5b394b
mov eax, dword [esi + 8]
mov edi, dword [esi + 0x50]
cdq
sub eax, edx
sar eax, 1
lea ebx, [edi + eax*2]
cdq
sub eax, edx
sar eax, 1
je 0x5b392a
jmp 0x5b3910
mov cx, word [ebx]
lea edi, [edi + 2]
movzx edx, word [edi - 2]
lea ebx, [ebx - 2]
mov word [edi - 2], cx
mov word [ebx + 2], dx
sub eax, 1
jne 0x5b3910
mov edx, dword [esi + 8]
mov eax, edx
sub eax, dword [esi + 4]
mov ecx, dword [esi]
sub edx, ecx
mov ebx, dword [ebp - 0x420]
mov dword [esi], eax
mov al, byte [esi + 0x66]
and al, 0xef
mov dword [esi + 4], edx
or al, 4
mov byte [esi + 0x66], al
cmp dword [ebp + 0x1c], 0xffffffff
je 0x5b396b
fild dword [ebp + 0x1c]
fstp qword [ebp - 0x43c]
fld qword [ebp - 0x43c]
fdiv qword [ebp - 0x458]
jmp 0x5b39ed
mov eax, dword [esi + 0x50]
xor ecx, ecx
mov dword [ebp - 0x430], eax
mov eax, dword [esi + 8]
cdq
sub eax, edx
mov dword [ebp - 0x410], ecx
mov edi, eax
sar edi, 1
je 0x5b39cc
mov ebx, dword [ebp - 0x430]
mov esi, ecx
movzx edx, word [ebx]
lea ebx, [ebx + 2]
mov eax, edx
dec edi
neg eax
test dx, dx
movzx ecx, ax
mov eax, edx
cmovns ecx, eax
movzx eax, cx
cmp ax, si
jle 0x5b39b0
mov esi, eax
test edi, edi
jne 0x5b3990
mov ebx, dword [ebp - 0x420]
mov dword [ebp - 0x410], esi
mov esi, dword [ebp - 0x438]
mov ecx, dword [ebp - 0x410]
movsx eax, cx
mov dword [ebp - 0x438], eax
fild dword [ebp - 0x438]
fstp qword [ebp - 0x43c]
fld qword [ebp - 0x43c]
fdivr qword [ebp - 0x460]
fstp dword [ebp - 0x410]
movss xmm0, dword [ebp - 0x410]
movss dword [esi + 0x4c], xmm0
mov eax, dword [esi + 8]
cdq
sub eax, edx
mov edi, dword [ebp - 0x41c]
mov ecx, eax
mov eax, dword [esi]
cdq
sub eax, edx
sar ecx, 1
sar eax, 1
mov dword [esi], eax
mov eax, dword [esi + 4]
cdq
sub eax, edx
mov dword [esi + 8], ecx
sar eax, 1
xor edx, edx
mov dword [esi + 4], eax
mov eax, dword [esi + 0x50]
mov word [eax + ecx*2 + 2], dx
mov ecx, dword [esi + 8]
mov eax, dword [esi + 0x50]
mov word [eax + ecx*2], dx
mov ecx, dword [esi + 4]
mov eax, dword [esi + 8]
shl dword [esi], 0xc
shl eax, 0xc
mov dword [esi + 8], eax
shl ecx, 0xc
mov dword [esi + 4], ecx
movzx eax, byte [ebp - 0x411]
and eax, 0xf
shl eax, 8
or dword [esi], eax
movzx eax, byte [ebp - 0x411]
and eax, 0xf0
shl eax, 4
or eax, ecx
mov dword [esi + 4], eax
cmp byte [esi + 0x68], dl
je 0x5b3a8d
test byte [esi + 0x66], 4
jne 0x5b3a8d
push esi
push edi
call fcn.005b5dc0
add esp, 8
cmp dword [edi], 0
jne 0x5b3aed
cmp dword [ebp + 0x2c], 1
jne 0x5b3a99
mov eax, dword [esi + 4]
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x424]
mov esi, dword [ebp - 0x40c]
inc eax
add dword [ebp - 0x42c], 0x6c
mov dword [ebp - 0x424], eax
cmp eax, dword [esi]
jl 0x5b3315
push ebx
call sym.BZDPatcher.exe_SDL_RWclose
add esp, 4
pop esi
pop ebx
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x41c]
mov esi, dword [ebp - 0x40c]
mov dword [edi], 1
test esi, esi
je 0x5b3b32
jmp 0x5b3af3
mov esi, dword [ebp - 0x40c]
cmp dword [esi + 4], 0
je 0x5b3b29
xor edi, edi
cmp dword [esi], edi
jle 0x5b3b1e
xor ebx, ebx
mov eax, dword [esi + 4]
push dword [ebx + eax + 0x50]
call sym.BZDPatcher.exe_SDL_free
inc edi
lea ebx, [ebx + 0x6c]
add esp, 4
cmp edi, dword [esi]
jl 0x5b3b01
mov ebx, dword [ebp - 0x420]
push dword [esi + 4]
call sym.BZDPatcher.exe_SDL_free
add esp, 4
push esi
call sym.BZDPatcher.exe_SDL_free
add esp, 4
push ebx
call sym.BZDPatcher.exe_SDL_RWclose
mov eax, dword [ebp - 0x440]
add esp, 4
mov dword [eax], 0
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop edi
call fcn.005b6a10
mov esp, ebp
pop ebp
ret