Function at 0x402a76
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x18], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
test eax, eax
je 0x402bd4
mov eax, dword [ebp + 8]
mov dword [eax + 0x10], 0
mov eax, dword [ebp + 8]
lea edx, [eax + 0x14]
mov dword [esp + 0xc], 0
lea eax, [ebp - 0x18]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
call eax
sub esp, 0x10
test eax, eax
jne 0x402b26
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
cmp eax, 0xea
jne 0x402b02
mov eax, dword [ebp - 0x18]
mov dword [esp + 8], eax
mov dword [esp + 4], str.GetOverlappedResult:_ERROR_MORE_DATA__len_d_
mov dword [esp], 0
call dbg.info
jmp 0x402b26
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.GetOverlappedResult
call dbg.syserror
jmp 0x402d65
mov eax, dword [ebp - 0x18]
test eax, eax
jne 0x402b51
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.fd_closed
call dbg.error
jmp 0x402d65
mov eax, dword [ebp - 0x18]
cmp dword [ebp - 0xc], eax
jne 0x402b75
shl dword [ebp - 0xc], 1
cmp dword [ebp - 0xc], 0x4000
jbe 0x402b6c
mov dword [ebp - 0xc], 0x4000
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0xc]
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x18]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x72
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dbg.print_xfer
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call dbg.iobuf_commit
mov eax, dword [ebp + 0x18]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [ebp + 0x14]
call eax
test eax, eax
jns 0x402bd4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov eax, 0xffffffff
jmp 0x402d65
lea eax, [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call dbg.iobuf_reserve
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x402c21
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov dword [esp], str.failed_to_allocate__s_buffer
call dbg.error
jmp 0x402d65
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp + 8]
lea edx, [eax + 0x14]
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x10], edx
lea edx, [ebp - 0x1c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
sub esp, 0x14
test eax, eax
je 0x402d0a
mov eax, dword [ebp - 0x1c]
test eax, eax
jne 0x402c8a
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.fd_closed
call dbg.error
jmp 0x402d65
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0xc], eax
jne 0x402cae
shl dword [ebp - 0xc], 1
cmp dword [ebp - 0xc], 0x4000
jbe 0x402ca5
mov dword [ebp - 0xc], 0x4000
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0xc]
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x72
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dbg.print_xfer
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call dbg.iobuf_commit
mov eax, dword [ebp + 0x18]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [ebp + 0x14]
call eax
test eax, eax
jns 0x402d60
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov eax, 0xffffffff
jmp 0x402d65
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
cmp eax, 0x6d
je 0x402d29
cmp eax, 0x3e5
jne 0x402d3f
mov eax, dword [ebp + 8]
mov dword [eax + 0x10], 1
jmp 0x402d60
mov dword [esp + 4], str.child_process_has_closed_pipe
mov dword [esp], 0
call dbg.info
jmp 0x402d60
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.failed_to_read
call dbg.syserror
jmp 0x402d65
mov eax, 0
leave
ret