Function at 0x404041
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [ebp + 8]
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0xc], ecx
cmp dword [ebp - 4], 0
je 0x404065
mov edx, dword [ebp - 4]
movsx eax, byte [edx + 0x5c]
cmp eax, 0x72
je 0x40406f
mov eax, 0xfffffffe
jmp 0x4042ee
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x38], 0xfffffffd
je 0x404081
mov edx, dword [ebp - 4]
cmp dword [edx + 0x38], 0xffffffff
jne 0x404089
or eax, 0xffffffff
jmp 0x4042ee
mov eax, dword [ebp - 4]
cmp dword [eax + 0x38], 1
jne 0x404099
xor eax, eax
jmp 0x4042ee
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov dword [edx + 0xc], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
mov dword [ecx + 0x10], edx
mov eax, dword [ebp - 4]
cmp dword [eax + 0x10], 0
je 0x4042c5
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x58], 0
je 0x404185
mov edx, dword [ebp - 4]
mov eax, dword [edx + 4]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x10]
cmp edx, dword [ecx + 0x10]
jbe 0x4040e8
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x10]
mov dword [ebp - 0x10], ecx
cmp dword [ebp - 0x10], 0
jbe 0x404144
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
push ecx
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0xc]
push eax
call fcn.0043a1e0
add esp, 0xc
mov ecx, dword [ebp - 8]
add ecx, dword [ebp - 0x10]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov dword [edx + 0xc], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx]
add edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
mov dword [eax], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x10]
sub edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
mov dword [eax + 0x10], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 4]
sub edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x10], 0
jbe 0x404177
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x40]
push eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x10]
push edx
push 1
mov eax, dword [ebp - 8]
push eax
call fcn.00451525
add esp, 0x10
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x10]
sub edx, eax
mov eax, dword [ebp - 4]
mov dword [eax + 0x10], edx
mov ecx, dword [ebp - 4]
mov eax, dword [ebp + 0x10]
sub eax, dword [ecx + 0x10]
jmp 0x4042ee
mov edx, dword [ebp - 4]
cmp dword [edx + 4], 0
jne 0x404202
mov eax, dword [ebp - 4]
cmp dword [eax + 0x3c], 0
jne 0x404202
call fcn.0043fed9
mov dword [eax], 0
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x40]
push edx
push 0x1000
push 1
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x44]
push ecx
call fcn.00451525
add esp, 0x10
mov edx, dword [ebp - 4]
mov dword [edx + 4], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 4], 0
jne 0x4041f7
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x3c], 1
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x40]
mov ecx, dword [eax + 0xc]
and ecx, 0x20
test ecx, ecx
je 0x4041f7
mov edx, dword [ebp - 4]
mov dword [edx + 0x38], 0xffffffff
jmp 0x4042c5
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x44]
mov dword [eax], edx
push 0
mov eax, dword [ebp - 4]
push eax
call fcn.004049bd
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x38], eax
mov edx, dword [ebp - 4]
cmp dword [edx + 0x38], 1
jne 0x4042ac
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0xc]
sub ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x4c]
push ecx
call fcn.00406def
mov edx, dword [ebp - 4]
mov dword [edx + 0x4c], eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 4]
push edx
call fcn.004044ef
add esp, 4
mov ecx, dword [ebp - 4]
cmp eax, dword [ecx + 0x4c]
jne 0x404271
mov edx, dword [ebp - 4]
push edx
call fcn.004044ef
add esp, 4
mov ecx, dword [ebp - 4]
cmp eax, dword [ecx + 0x14]
je 0x40427d
mov edx, dword [ebp - 4]
mov dword [edx + 0x38], 0xfffffffd
jmp 0x4042ac
mov eax, dword [ebp - 4]
push eax
call fcn.00403cbc
add esp, 4
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x38], 0
jne 0x4042ac
mov edx, dword [ebp - 4]
push edx
call fcn.00404760
push 0
push 0
push 0
call fcn.00406def
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x4c], eax
mov edx, dword [ebp - 4]
cmp dword [edx + 0x38], 0
jne 0x4042be
mov eax, dword [ebp - 4]
cmp dword [eax + 0x3c], 0
je 0x4042c0
jmp 0x4042c5
jmp 0x4040b1
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0xc]
sub edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x4c]
push edx
call fcn.00406def
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x4c], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 0x10]
sub eax, dword [edx + 0x10]
mov esp, ebp
pop ebp
ret 0xc