Function at 0x58e270
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x675978]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x3c], eax
cmp dword [edi + 0x6c], 0
jne 0x58e529
lea esp, [esp]
push 1
push 1
lea eax, [ebp - 0x21]
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
je 0x58e2c4
mov dword [edi + 0x6c], 1
jmp 0x58e51f
cmp byte [ebp - 0x21], 0x4f
jne 0x58e51f
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWtell
mov ebx, eax
add esp, 4
sub ebx, dword [edi + 0x24]
mov dword [ebp - 0x30], ebx
lea ecx, [ebx - 0x19]
cmp ecx, dword [edi + 0x38]
ja 0x58e529
mov esi, 1
push 1
push 1
lea eax, [ebp - 0x22]
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
je 0x58e315
mov dword [edi + 0x6c], 1
xor al, al
jmp 0x58e318
mov al, byte [ebp - 0x22]
cmp al, byte [esi + 0x674ad0]
jne 0x58e326
inc esi
cmp esi, 4
jl 0x58e2f2
cmp dword [edi + 0x6c], 0
jne 0x58e529
cmp esi, 4
jne 0x58e4cb
mov eax, dword [0x674ad0]
mov dword [ebp - 0x20], eax
push 1
push 1
lea eax, [ebp - 0x23]
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
je 0x58e369
mov dword [edi + 0x6c], 1
xor al, al
mov ecx, 1
jmp 0x58e36f
mov al, byte [ebp - 0x23]
mov ecx, dword [edi + 0x6c]
mov byte [ebp + esi - 0x20], al
inc esi
cmp esi, 0x1b
jb 0x58e341
test ecx, ecx
jne 0x58e529
cmp byte [ebp - 0x1c], cl
jne 0x58e4cb
movzx ecx, byte [ebp - 7]
movzx eax, byte [ebp - 8]
shl ecx, 8
add ecx, eax
movzx eax, byte [ebp - 9]
shl ecx, 8
add ecx, eax
movzx eax, byte [ebp - 0xa]
shl ecx, 8
add ecx, eax
mov eax, 0x16
mov dword [ebp - 0x34], ecx
cmp eax, 0x1b
jae 0x58e5d4
mov byte [ebp + eax - 0x20], 0
inc eax
cmp eax, 0x1a
jb 0x58e3b1
xor esi, esi
xor edx, edx
lea esp, [esp]
movzx ecx, byte [ebp + edx - 0x20]
mov eax, esi
shr eax, 0x18
xor ecx, eax
shl esi, 8
movzx eax, byte [ebp + edx - 0x1f]
xor esi, dword [ecx*4 + 0x67c098]
mov ecx, esi
shl esi, 8
shr ecx, 0x18
xor ecx, eax
xor esi, dword [ecx*4 + 0x67c098]
movzx ecx, byte [ebp + edx - 0x1e]
mov eax, esi
shr eax, 0x18
add edx, 3
xor ecx, eax
shl esi, 8
xor esi, dword [ecx*4 + 0x67c098]
cmp edx, 0x1b
jb 0x58e3d0
movzx eax, byte [ebp - 6]
xor ebx, ebx
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x58e4c3
jmp 0x58e430
push 1
push 1
lea eax, [ebp - 0x24]
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
je 0x58e453
mov dword [edi + 0x6c], 1
xor al, al
jmp 0x58e456
mov al, byte [ebp - 0x24]
movzx ecx, al
mov eax, esi
shr eax, 0x18
add ebx, ecx
xor eax, ecx
shl esi, 8
xor esi, dword [eax*4 + 0x67c098]
sub dword [ebp - 0x2c], 1
jne 0x58e430
test ebx, ebx
je 0x58e4c3
cmp dword [edi + 0x6c], 0
jne 0x58e529
test ebx, ebx
je 0x58e4c3
push 1
push 1
lea eax, [ebp - 0x25]
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWread
add esp, 0x10
cmp eax, 1
je 0x58e4a7
mov dword [edi + 0x6c], 1
xor al, al
jmp 0x58e4aa
mov al, byte [ebp - 0x25]
mov ecx, esi
movzx eax, al
shr ecx, 0x18
xor ecx, eax
shl esi, 8
xor esi, dword [ecx*4 + 0x67c098]
sub ebx, 1
jne 0x58e484
cmp esi, dword [ebp - 0x34]
je 0x58e53c
mov ebx, dword [ebp - 0x30]
mov eax, dword [edi + 0x24]
add eax, ebx
mov dword [edi + 0x6c], 0
cmp eax, ebx
jb 0x58e4e3
cmp ebx, 0x80000000
jb 0x58e4ef
mov eax, 0x7fffffff
mov dword [edi + 0x6c], 1
push 0
push 0
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWseek
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x58e51f
push 2
push 0
push dword [edi + 0x24]
mov dword [edi + 0x6c], 1
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWseek
add esp, 0x10
cmp dword [edi + 0x6c], 0
je 0x58e2a0
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x38]
test esi, esi
je 0x58e553
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWtell
add esp, 4
sub eax, dword [edi + 0x24]
mov dword [esi], eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
je 0x58e566
movzx eax, byte [ebp - 0x1b]
shr eax, 2
and eax, 1
mov dword [ecx], eax
mov ecx, dword [ebp - 0x30]
mov eax, dword [edi + 0x24]
dec ecx
add eax, ecx
mov dword [edi + 0x6c], 0
cmp eax, ecx
jb 0x58e582
cmp ecx, 0x80000000
jb 0x58e58e
mov eax, 0x7fffffff
mov dword [edi + 0x6c], 1
push 0
push 0
push eax
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWseek
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x58e5be
push 2
push 0
push dword [edi + 0x24]
mov dword [edi + 0x6c], 1
push dword [edi + 0x20]
call sym.BZDPatcher.exe_SDL_RWseek
add esp, 0x10
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005b6a10
mov esp, ebp
pop ebp
ret
call fcn.005b6e59
int3