Function at 0x4036f2
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
xor esi, esi
cmp dword [0x41f9f8], 0x2000
jg 0x4037ac
push 0
push 0
push dword [0x41f9f4]
call sub.CRTDLL.DLL__lseek
push dword [0x41f9f8]
push dword [0x41f9d0]
push dword [0x41f9f4]
call sub.CRTDLL.DLL__read
add esp, 0x18
mov dword [0x41f9d8], eax
cmp eax, dword [0x41f9f8]
jne 0x403966
mov eax, dword [0x41f9f8]
mov edx, dword [0x41f9d0]
lea eax, [eax + edx - 0x16]
mov dword [0x41f9d4], eax
jmp 0x40379a
mov eax, dword [0x41f9d4]
cmp byte [eax], 0x50
jne 0x403794
push 4
push 0x421310
push eax
call sub.CRTDLL.DLL_strncmp
add esp, 0xc
or eax, eax
jne 0x403794
mov eax, dword [0x41f9d4]
sub eax, dword [0x41f9d0]
sub dword [0x41f9d8], eax
xor esi, esi
inc esi
jmp 0x403966
dec dword [0x41f9d4]
mov eax, dword [0x41f9d0]
cmp dword [0x41f9d4], eax
jae 0x40375d
jmp 0x403966
mov eax, dword [0x41f9f8]
mov ecx, 0x2000
cdq
idiv ecx
mov dword [ebp - 0x20], edx
cmp edx, 0x12
jle 0x403877
push 0
mov eax, dword [0x41f9f8]
sub eax, edx
push eax
push dword [0x41f9f4]
call sub.CRTDLL.DLL__lseek
mov dword [0x41f9fc], eax
push dword [ebp - 0x20]
push dword [0x41f9d0]
push dword [0x41f9f4]
call sub.CRTDLL.DLL__read
add esp, 0x18
mov dword [0x41f9d8], eax
cmp eax, dword [ebp - 0x20]
jne 0x403966
mov eax, dword [ebp - 0x20]
mov edx, dword [0x41f9d0]
lea eax, [eax + edx - 0x16]
mov dword [0x41f9d4], eax
jmp 0x403852
mov eax, dword [0x41f9d4]
cmp byte [eax], 0x50
jne 0x40384c
push 4
push 0x421310
push eax
call sub.CRTDLL.DLL_strncmp
add esp, 0xc
or eax, eax
jne 0x40384c
mov eax, dword [0x41f9d4]
sub eax, dword [0x41f9d0]
sub dword [0x41f9d8], eax
xor esi, esi
inc esi
jmp 0x40385f
dec dword [0x41f9d4]
mov eax, dword [0x41f9d0]
cmp dword [0x41f9d4], eax
jae 0x403818
push 3
push dword [0x41f9d0]
push dword [0x41fa08]
call sub.CRTDLL.DLL_strncpy
add esp, 0xc
jmp 0x403884
mov eax, dword [0x41f9f8]
sub eax, dword [ebp - 0x20]
mov dword [0x41f9fc], eax
mov edi, dword [ebp + 8]
sub edi, dword [ebp - 0x20]
mov eax, edi
add eax, 0x1fff
test eax, eax
jge 0x40389a
add eax, 0x1fff
sar eax, 0xd
mov dword [ebp - 0x1c], eax
xor ebx, ebx
inc ebx
jmp 0x403959
sub dword [0x41f9fc], 0x2000
push 0
push dword [0x41f9fc]
push dword [0x41f9f4]
call sub.CRTDLL.DLL__lseek
push 0x2000
push dword [0x41f9d0]
push dword [0x41f9f4]
call sub.CRTDLL.DLL__read
add esp, 0x18
mov dword [0x41f9d8], eax
cmp eax, 0x2000
jne 0x403966
mov eax, dword [0x41f9d0]
add eax, 0x1fff
mov dword [0x41f9d4], eax
jmp 0x403935
mov eax, dword [0x41f9d4]
cmp byte [eax], 0x50
jne 0x40392f
push 4
push 0x421310
push eax
call sub.CRTDLL.DLL_strncmp
add esp, 0xc
or eax, eax
jne 0x40392f
mov eax, dword [0x41f9d4]
sub eax, dword [0x41f9d0]
sub dword [0x41f9d8], eax
xor esi, esi
inc esi
jmp 0x403942
dec dword [0x41f9d4]
mov eax, dword [0x41f9d0]
cmp dword [0x41f9d4], eax
jae 0x4038fb
push 3
push dword [0x41f9d0]
push dword [0x41fa08]
call sub.CRTDLL.DLL_strncpy
add esp, 0xc
inc ebx
or esi, esi
jne 0x403966
cmp ebx, dword [ebp - 0x1c]
jle 0x4038a8
or esi, esi
jne 0x4039db
cmp dword [0x41324c], esi
jne 0x40397b
cmp dword [0x413220], 0
je 0x4039a9
push dword [0x41f9f0]
push str.__s__n
push 0x4139c8
call sub.CRTDLL.DLL_sprintf
push 0x401
push eax
push 0x4139c8
push 0x413218
call dword [0x41fc00]
add esp, 0x1c
push 0x421106
push 0x4139c8
call sub.CRTDLL.DLL_sprintf
push 0x401
push eax
push 0x4139c8
push 0x413218
call dword [0x41fc00]
add esp, 0x18
mov eax, 2
jmp 0x403a88
mov eax, dword [0x41f9fc]
mov edx, dword [0x41f9d4]
sub edx, dword [0x41f9d0]
add eax, edx
mov dword [0x413298], eax
push 0x16
lea eax, [ebp - 0x16]
push eax
call fcn.004058df
add esp, 8
or eax, eax
jne 0x403a0c
mov eax, 0x33
jmp 0x403a88
lea eax, [ebp - 0x12]
push eax
call fcn.00406a6d
mov word [0x41fa54], ax
lea eax, [ebp - 0x10]
push eax
call fcn.00406a6d
mov word [0x41fa56], ax
lea eax, [ebp - 0xe]
push eax
call fcn.00406a6d
mov word [0x41fa58], ax
lea eax, [ebp - 0xc]
push eax
call fcn.00406a6d
mov word [0x41fa5a], ax
lea eax, [ebp - 0xa]
push eax
call fcn.00406a83
mov dword [0x41fa5c], eax
lea eax, [ebp - 6]
push eax
call fcn.00406a83
mov dword [0x41fa60], eax
lea eax, [ebp - 2]
push eax
call fcn.00406a6d
add esp, 0x1c
mov word [0x41fa64], ax
mov eax, dword [0x41fa60]
add eax, dword [0x41fa5c]
mov dword [0x41329c], eax
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret