Function at 0x409560
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x28
cmp byte [esi], 0
push ebx
push ebp
push edi
je 0x4095b1
cmp byte [esi + 1], 0
je 0x4095c1
mov ecx, dword [esi + 4]
push 2
xor edi, edi
lea eax, [esp + 0x28]
push eax
push edi
push ecx
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp byte [esi], 0
je 0x4095d3
cmp byte [esi + 1], 0
je 0x4095cb
mov ecx, dword [esi + 4]
push 1
push edi
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, eax
sub ebp, dword [esi + 0x10]
mov dword [esp + 0xc], ebp
jmp 0x4095dc
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x24]
mov dword [esi + 0x28], edx
mov dword [esi + 0x2c], eax
xor edi, edi
jmp 0x40958d
or eax, 0xffffffff
pop edi
pop ebp
pop ebx
add esp, 0x28
ret
mov dword [esp + 0xc], edi
mov ebp, edi
jmp 0x4095dc
mov edx, dword [esi + 0x28]
mov dword [esp + 0xc], edx
mov ebp, edx
mov edi, 0xffff
cmp ebp, edi
mov dword [esp + 0x10], edi
jae 0x4095ef
mov dword [esp + 0x10], ebp
mov edi, ebp
push 0x404
call fcn.0040cb8a
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4095c1
mov eax, 4
cmp edi, eax
mov dword [esp + 0x18], 0xffffffff
jbe 0x409743
jmp 0x40962c
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0xc]
add eax, 0x400
cmp eax, edi
mov dword [esp + 0x14], edi
ja 0x40963d
mov dword [esp + 0x14], eax
mov edx, ebp
sub edx, dword [esp + 0x14]
sub ebp, edx
cmp ebp, 0x404
mov dword [esp + 0x20], edx
jbe 0x409656
mov ebp, 0x404
xor ecx, ecx
cmp byte [esi], cl
je 0x40968a
cmp byte [esi + 1], cl
je 0x409743
mov eax, dword [esi + 0x10]
add eax, edx
mov edx, dword [esi + 0x14]
push ecx
adc edx, ecx
lea ecx, [esp + 0x30]
push ecx
mov dword [esp + 0x34], edx
mov edx, dword [esi + 4]
push eax
push edx
mov dword [esp + 0x38], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x409690
mov dword [esi + 0x28], edx
mov dword [esi + 0x2c], ecx
cmp byte [esi], 0
mov edi, ebp
je 0x4096b8
mov ecx, dword [esi + 4]
push 0
lea eax, [esp + 0x20]
push eax
push ebp
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4096b2
mov byte [esi + 8], 1
mov eax, dword [esp + 0x1c]
jmp 0x4096ee
xor eax, eax
mov ecx, ebp
add ecx, dword [esi + 0x28]
adc eax, dword [esi + 0x2c]
cmp eax, dword [esi + 0x24]
jl 0x4096d4
jg 0x4096ce
cmp ecx, dword [esi + 0x20]
jbe 0x4096d4
mov edi, dword [esi + 0x20]
sub edi, dword [esi + 0x28]
mov edx, dword [esi + 0x1c]
add edx, dword [esi + 0x28]
push edi
push edx
push ebx
call fcn.0040e300
add esp, 0xc
add dword [esi + 0x28], edi
mov eax, edi
adc dword [esi + 0x2c], 0
xor edx, edx
div ebp
cmp eax, 1
jne 0x409743
lea eax, [ebp - 3]
test eax, eax
jl 0x40972e
mov edi, edi
sub eax, 1
cmp byte [eax + ebx], 0x50
jne 0x40971e
cmp byte [eax + ebx + 1], 0x4b
jne 0x40971e
cmp byte [eax + ebx + 2], 5
jne 0x40971e
cmp byte [eax + ebx + 3], 6
je 0x409724
test eax, eax
jge 0x409700
jmp 0x40972e
mov ecx, dword [esp + 0x20]
add eax, ecx
mov dword [esp + 0x18], eax
cmp dword [esp + 0x18], 0
jne 0x409743
mov edx, dword [esp + 0x10]
cmp dword [esp + 0x14], edx
jb 0x409620
push ebx
call fcn.0040cc4d
mov eax, dword [esp + 0x1c]
add esp, 4
pop edi
pop ebp
pop ebx
add esp, 0x28
ret