Function at 0x410054
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push edi
and dword [ebp - 0x1c], 0
or dword [ebp - 0xc], 0xffffffff
and dword [ebp - 0x18], 0
xor eax, eax
lea edi, [ebp - 0x14]
stosd dword es:[edi], eax
and dword [ebp - 0x24], 0
and dword [ebp - 8], 0
push 0
push 0x8000080
push 3
push 0
push 5
push SysReAllocString
push dword [ebp + 0x10]
call fcn.004103b7
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x4100d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
push dword [ebp - 0x1c]
call fcn.00407c6d
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jl 0x4100b9
mov dword [ebp - 0x1c], 0x80004005
push dword [ebp - 0x1c]
push 0xc4
push 0x405f18
call fcn.0040e33f
jmp 0x41024e
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x410123
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
push dword [ebp - 0x1c]
call fcn.00407c6d
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jl 0x410107
mov dword [ebp - 0x1c], 0x80004005
push dword [ebp - 0x1c]
push 0xc9
push 0x405f18
call fcn.0040e33f
jmp 0x41024e
mov eax, dword [ebp + 0x14]
xor ecx, ecx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], ecx
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x14]
jg 0x41015a
jl 0x410140
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x18]
jae 0x41015a
push 0x7a
call fcn.00407c6d
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jge 0x41015a
jmp 0x41024e
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 8]
cmp dword [eax], 0
je 0x41017c
push 1
push dword [ebp - 0x24]
mov eax, dword [ebp + 8]
push dword [eax]
call fcn.0040e2cb
mov dword [ebp - 8], eax
jmp 0x410189
push 1
push dword [ebp - 0x24]
call fcn.0040e2a9
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x4101b2
mov dword [ebp - 0x1c], 0x8007000e
push dword [ebp - 0x1c]
push 0xdc
push 0x405f18
call fcn.0040e33f
jmp 0x41024e
and dword [ebp - 0x20], 0
and dword [ebp - 4], 0
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x24]
sub eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x20]
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x410212
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
push dword [ebp - 0x1c]
call fcn.00407c6d
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jl 0x4101fc
mov dword [ebp - 0x1c], 0x80004005
push dword [ebp - 0x1c]
push 0xe4
push 0x405f18
call fcn.0040e33f
jmp 0x41024e
mov eax, dword [ebp - 0x20]
add eax, dword [ebp - 4]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 4], 0
jne 0x4101ba
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x24]
je 0x41023a
mov dword [ebp - 0x1c], 0x8000ffff
cmp dword [ebp - 0x1c], 0
jge 0x41023a
jmp 0x41024e
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
and dword [ebp - 8], 0
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x24]
mov dword [eax], ecx
cmp dword [ebp - 8], 0
je 0x41025c
push dword [ebp - 8]
call fcn.0040e2f0
cmp dword [ebp - 0xc], 0xffffffff
je 0x41026f
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0xc], 0xffffffff
mov eax, dword [ebp - 0x1c]
pop edi
leave
ret 0x10