Function at 0x403970
Capabilities:
Read file on windows

Disassembly:
push ecx
mov ecx, dword [esp + 0xc]
push ebx
push ebp
mov ebp, dword [esp + 0x10]
push esi
push edi
test ebp, ebp
mov dword [esp + 0x10], ecx
je 0x403ed8
cmp byte [ebp + 0x5c], 0x72
jne 0x403ed8
mov eax, dword [ebp + 0x38]
or edi, 0xffffffff
cmp eax, 0xfffffffd
je 0x403ed0
cmp eax, edi
je 0x403ed0
mov ebx, 1
cmp eax, ebx
jne 0x4039bb
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov eax, dword [esp + 0x20]
mov dword [esp + 0x18], ecx
test eax, eax
mov dword [ebp + 0xc], ecx
mov dword [ebp + 0x10], eax
je 0x403ea7
mov eax, dword [ebp + 0x58]
test eax, eax
mov eax, dword [ebp + 4]
jne 0x403e14
test eax, eax
jne 0x403a28
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x403a28
call fcn.0040b18a
mov dword [eax], 0
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x44]
push eax
push 0x4000
push ebx
push ecx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403a22
mov edx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [edx + 0xc], 0x20
jne 0x403ea4
mov eax, dword [ebp + 0x44]
mov dword [ebp], eax
push 0
push ebp
call fcn.00404240
add esp, 8
cmp eax, ebx
mov dword [ebp + 0x38], eax
jne 0x403dee
mov ecx, dword [ebp + 0xc]
mov eax, dword [esp + 0x10]
mov edx, dword [ebp + 0x4c]
sub ecx, eax
push ecx
push eax
push edx
call fcn.00405e10
mov dword [ebp + 0x4c], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 0x3c]
add esp, 0xc
test eax, eax
je 0x403a6a
mov esi, edi
jmp 0x403ac6
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403ab2
call fcn.0040b18a
mov dword [eax], 0
mov ecx, dword [ebp + 0x40]
mov edx, dword [ebp + 0x44]
push ecx
push 0x4000
push ebx
push edx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403aac
mov eax, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [eax + 0xc], 0x20
je 0x403aa8
mov dword [ebp + 0x38], edi
mov esi, edi
jmp 0x403ac6
mov ecx, dword [ebp + 0x44]
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
xor edx, edx
dec eax
mov dword [ebp + 4], eax
mov eax, dword [ebp]
mov dl, byte [eax]
inc eax
mov esi, edx
mov dword [ebp], eax
mov eax, dword [ebp + 0x3c]
test eax, eax
je 0x403ad1
mov eax, edi
jmp 0x403b2b
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403b19
call fcn.0040b18a
mov dword [eax], 0
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x44]
push eax
push 0x4000
push ebx
push ecx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403b13
mov edx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [edx + 0xc], 0x20
je 0x403b0f
mov dword [ebp + 0x38], edi
mov eax, edi
jmp 0x403b2b
mov eax, dword [ebp + 0x44]
mov dword [ebp], eax
mov eax, dword [ebp + 4]
mov ecx, dword [ebp]
dec eax
mov dword [ebp + 4], eax
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp], ecx
shl eax, 8
add eax, esi
mov esi, eax
mov eax, dword [ebp + 0x3c]
test eax, eax
je 0x403b3d
mov eax, edi
jmp 0x403b97
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403b85
call fcn.0040b18a
mov dword [eax], 0
mov ecx, dword [ebp + 0x40]
mov edx, dword [ebp + 0x44]
push ecx
push 0x4000
push ebx
push edx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403b7f
mov eax, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [eax + 0xc], 0x20
je 0x403b7b
mov dword [ebp + 0x38], edi
mov eax, edi
jmp 0x403b97
mov ecx, dword [ebp + 0x44]
mov dword [ebp], ecx
mov eax, dword [ebp + 4]
mov ecx, dword [ebp]
dec eax
mov dword [ebp + 4], eax
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp], ecx
shl eax, 0x10
add esi, eax
mov eax, dword [ebp + 0x3c]
test eax, eax
je 0x403ba7
mov eax, edi
jmp 0x403c01
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403bef
call fcn.0040b18a
mov dword [eax], 0
mov edx, dword [ebp + 0x40]
mov eax, dword [ebp + 0x44]
push edx
push 0x4000
push ebx
push eax
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403be9
mov ecx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [ecx + 0xc], 0x20
je 0x403be5
mov dword [ebp + 0x38], edi
mov eax, edi
jmp 0x403c01
mov edx, dword [ebp + 0x44]
mov dword [ebp], edx
mov eax, dword [ebp + 4]
mov ecx, dword [ebp]
dec eax
mov dword [ebp + 4], eax
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp], ecx
cmp eax, edi
jne 0x403c0c
mov dword [ebp + 0x38], 0xfffffffd
mov ecx, dword [ebp + 0x4c]
shl eax, 0x18
add eax, esi
cmp eax, ecx
je 0x403c24
mov dword [ebp + 0x38], 0xfffffffd
jmp 0x403dee
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x403d8a
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403c75
call fcn.0040b18a
mov dword [eax], 0
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x44]
push eax
push 0x4000
push ebx
push ecx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403c6f
mov edx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [edx + 0xc], 0x20
je 0x403c83
mov dword [ebp + 0x38], edi
jmp 0x403c83
mov eax, dword [ebp + 0x44]
mov dword [ebp], eax
mov ecx, dword [ebp + 4]
mov eax, dword [ebp]
dec ecx
inc eax
mov dword [ebp + 4], ecx
mov dword [ebp], eax
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x403d8a
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403cd4
call fcn.0040b18a
mov dword [eax], 0
mov ecx, dword [ebp + 0x40]
mov edx, dword [ebp + 0x44]
push ecx
push 0x4000
push ebx
push edx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403cce
mov eax, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [eax + 0xc], 0x20
je 0x403ce2
mov dword [ebp + 0x38], edi
jmp 0x403ce2
mov ecx, dword [ebp + 0x44]
mov dword [ebp], ecx
mov ecx, dword [ebp + 4]
mov eax, dword [ebp]
dec ecx
inc eax
mov dword [ebp + 4], ecx
mov dword [ebp], eax
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x403d8a
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403d33
call fcn.0040b18a
mov dword [eax], 0
mov edx, dword [ebp + 0x40]
mov eax, dword [ebp + 0x44]
push edx
push 0x4000
push ebx
push eax
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403d2d
mov ecx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [ecx + 0xc], 0x20
je 0x403d41
mov dword [ebp + 0x38], edi
jmp 0x403d41
mov edx, dword [ebp + 0x44]
mov dword [ebp], edx
mov ecx, dword [ebp + 4]
mov eax, dword [ebp]
dec ecx
inc eax
mov dword [ebp + 4], ecx
mov dword [ebp], eax
mov eax, dword [ebp + 0x3c]
test eax, eax
je 0x403d4c
mov ecx, edi
jmp 0x403da6
mov eax, dword [ebp + 4]
test eax, eax
jne 0x403d94
call fcn.0040b18a
mov dword [eax], 0
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x44]
push eax
push 0x4000
push ebx
push ecx
call fcn.0040b682
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x403d8e
mov edx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], ebx
test byte [edx + 0xc], 0x20
je 0x403d8a
mov dword [ebp + 0x38], edi
mov ecx, edi
jmp 0x403da6
mov eax, dword [ebp + 0x44]
mov dword [ebp], eax
mov eax, dword [ebp + 4]
xor ecx, ecx
dec eax
mov dword [ebp + 4], eax
mov eax, dword [ebp]
mov cl, byte [eax]
inc eax
mov dword [ebp], eax
cmp ecx, edi
jne 0x403db1
mov dword [ebp + 0x38], 0xfffffffd
push ebp
call fcn.00403430
mov eax, dword [ebp + 0x38]
add esp, 4
test eax, eax
jne 0x403ea7
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0x14]
push ebp
call fcn.00404030
add esp, 4
mov dword [ebp + 8], esi
mov dword [ebp + 0x14], edi
push 0
push 0
push 0
call fcn.00405e10
add esp, 0xc
mov dword [ebp + 0x4c], eax
or edi, 0xffffffff
mov eax, dword [ebp + 0x38]
test eax, eax
jne 0x403ea7
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x403ea7
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x4039d1
jmp 0x403ea7
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jbe 0x403e1d
mov eax, ecx
test eax, eax
jbe 0x403e5c
mov esi, dword [ebp]
mov edi, dword [ebp + 0xc]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
mov esi, dword [ebp]
mov edx, dword [ebp + 0x10]
add ecx, eax
mov dword [esp + 0x18], ecx
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp + 4]
add esi, eax
sub edx, eax
sub ecx, eax
mov dword [ebp], esi
mov dword [ebp + 0x10], edx
mov dword [ebp + 4], ecx
mov eax, dword [ebp + 0x10]
test eax, eax
jbe 0x403e7e
mov edx, dword [ebp + 0x40]
push edx
push eax
mov eax, dword [esp + 0x20]
push ebx
push eax
call fcn.0040b682
mov ecx, dword [ebp + 0x10]
add esp, 0x10
sub ecx, eax
mov dword [ebp + 0x10], ecx
mov eax, dword [esp + 0x20]
mov edi, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
sub eax, edi
add esi, eax
add edx, eax
test eax, eax
mov dword [ebp + 8], esi
mov dword [ebp + 0x14], edx
jne 0x403edd
mov dword [ebp + 0x3c], ebx
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov dword [ebp + 0x38], edi
mov ecx, dword [ebp + 0xc]
mov eax, dword [esp + 0x10]
mov edx, dword [ebp + 0x4c]
sub ecx, eax
push ecx
push eax
push edx
call fcn.00405e10
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 0x4c], eax
mov eax, dword [esp + 0x2c]
add esp, 0xc
sub eax, ecx
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov eax, 0xfffffffe
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret