Function at 0x506a40
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x310
mov eax, dword [0x641a90]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x308], eax
mov dword [ebp - 0x310], ecx
cmp word [esi + 0x168], 8
jbe 0x506a85
mov eax, 8
mov word [esi + 0x168], ax
mov word [esi + 0x1a], ax
movzx eax, word [esi + 0x168]
cmp eax, 1
jne 0x506aa3
mov eax, dword [esi + 0x10]
add eax, 7
cdq
and edx, 7
lea edi, [edx + eax]
sar edi, 3
jmp 0x506acf
cmp eax, 2
jne 0x506aba
mov eax, dword [esi + 0x10]
add eax, 3
cdq
and edx, 3
lea edi, [edx + eax]
sar edi, 2
jmp 0x506acf
cmp eax, 4
jne 0x506acc
mov eax, dword [esi + 0x10]
inc eax
cdq
sub eax, edx
mov edi, eax
sar edi, 1
jmp 0x506acf
mov edi, dword [esi + 0x10]
add edi, 3
mov dword [esi], 0
push esi
and edi, 0xfffffffc
mov dword [esi + 8], 1
push ecx
mov dword [esi + 0x20], edi
call fcn.00456000
movzx ebx, ax
add esp, 8
test bx, bx
jne 0x506caf
push 0x300
lea eax, [ebp - 0x304]
push 0
push eax
call fcn.00595760
movzx eax, word [esi + 0x170]
add esp, 0xc
cmp byte [ebp + 0x14], bl
jne 0x506b81
xor ecx, ecx
lea eax, [eax + eax*2]
mov dword [ebp - 0x30c], ecx
test eax, eax
jle 0x506ba7
lea esp, [esp]
cmp ecx, 0x300
jge 0x506ba7
mov eax, dword [ebp - 0x308]
push dword [eax]
lea eax, [ebp - 0x304]
push 3
add eax, ecx
push 1
push eax
call fcn.00595b79
mov eax, dword [ebp - 0x308]
push dword [eax]
call fcn.00597fff
movzx eax, word [esi + 0x170]
add esp, 0x14
mov ecx, dword [ebp - 0x30c]
add ecx, 3
mov dword [ebp - 0x30c], ecx
lea eax, [eax + eax*2]
cmp ecx, eax
jl 0x506b30
jmp 0x506ba7
mov ecx, 0x100
cmp ax, cx
jae 0x506b8d
mov ecx, eax
mov eax, dword [ebp - 0x308]
push dword [eax]
lea eax, [ebp - 0x304]
push 3
push ecx
push eax
call fcn.00595b79
add esp, 0x10
mov eax, dword [ebp - 0x308]
push 0
push dword [ebp + 0x18]
push dword [eax]
call fcn.00595cb4
add esp, 0xc
cmp dword [esi + 0x16c], 1
jne 0x506be8
push dword [ebp - 0x310]
push dword [esi + 0x14]
push edi
push dword [esi + 0xc]
push dword [ebp - 0x308]
call fcn.005068d0
add esp, 0x14
movzx ebx, ax
jmp 0x506c93
cmp dword [esi + 0x14], 0
mov dword [ebp - 0x30c], 0
jle 0x506c93
lea esp, [esp]
cmp word [esi + 0x1a], 4
jne 0x506c66
cmp word [esi + 0x18], 1
jne 0x506c66
cmp dword [esi + 0x16c], 2
je 0x506c6f
mov eax, dword [ebp - 0x308]
push dword [eax]
push 1
push edi
push dword [esi + 0xc]
call fcn.00595b79
add esp, 0x10
cmp eax, 1
jne 0x506c8e
push 1
push dword [ebp - 0x30c]
push 0xffffffffffffffff
push dword [ebp - 0x310]
call fcn.004585b0
movzx ebx, ax
add esp, 0x10
test bx, bx
jne 0x506c93
mov eax, dword [ebp - 0x30c]
inc eax
mov dword [ebp - 0x30c], eax
cmp eax, dword [esi + 0x14]
jl 0x506c00
jmp 0x506c93
cmp dword [esi + 0x16c], 2
jne 0x506c17
lea eax, [edi + edi]
push eax
push dword [esi + 0xc]
push dword [ebp - 0x308]
call fcn.00506770
movzx ebx, ax
add esp, 0xc
test bx, bx
jne 0x506c93
jmp 0x506c32
mov ebx, 4
lea eax, [ebp - 0x304]
push eax
push 8
push 0x200
push dword [ebp - 0x310]
call fcn.00453f80
add esp, 0x10
mov ecx, dword [ebp - 4]
mov ax, bx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005920c1
mov esp, ebp
pop ebp
ret