Function at 0x10001600
Capabilities:
Read file on windows
Read pipe

Disassembly:
mov eax, dword [0x10009fc8]
sub esp, 0x4c
push ebx
xor ebx, ebx
push ebp
push esi
cmp eax, ebx
push edi
je 0x10001865
cmp dword [0x1000a5d0], ebx
je 0x10001865
mov eax, dword [0x1000a5cc]
cmp eax, ebx
je 0x10001865
cmp eax, 0xffffffff
je 0x10001865
lea ecx, [esp + 0x14]
mov ebp, dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
push ecx
lea edx, [esp + 0x14]
lea ecx, [esp + 0x1c]
push edx
push ecx
lea edx, [esp + 0x28]
push ebx
push edx
push eax
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
call ebp
mov esi, eax
mov eax, dword [0x10009fc4]
cmp eax, ebx
je 0x10001681
mov ecx, dword [esp + 0x10]
push ecx
push esi
push str._peekpipe_d__tot_lu__n
push eax
call fcn.10001bce
add esp, 0x10
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
cmp esi, ebx
je 0x1000172b
mov eax, dword [esp + 0x10]
cmp eax, ebx
jbe 0x1000172b
mov edx, dword [esp + 0x14]
push edx
push eax
lea eax, [esp + 0x24]
push str._tot_lu__bytesLeft_lu__n
push eax
call fcn.10001ccb
mov eax, dword [0x10009fc4]
add esp, 0x10
cmp eax, ebx
je 0x100016cf
lea ecx, [esp + 0x1c]
push ecx
push 0x100090e4
push eax
call fcn.10001bce
add esp, 0xc
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], ebx
cmp eax, ebx
jbe 0x1000172b
mov ecx, dword [0x1000a5cc]
lea edx, [esp + 0x18]
push ebx
push edx
lea eax, [esp + 0x24]
push 1
push eax
push ecx
call edi
mov ecx, dword [0x10009fc4]
cmp ecx, ebx
je 0x1000171a
mov edx, dword [esp + 0x1c]
and edx, 0xff
push edx
push eax
mov eax, dword [esp + 0x1c]
push eax
push str._flush_0xcc__i_lu__ok_lu__buf_0__x__n
push ecx
call fcn.10001bce
add esp, 0x14
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jb 0x100016db
mov ecx, dword [0x1000a5d0]
mov esi, dword [sym.imp.KERNEL32.dll_ResetEvent]
push ecx
call esi
mov edx, dword [0x1000a5d4]
push edx
call esi
push 0x10009234
call fcn.10001090
add esp, 4
test eax, eax
je 0x10001761
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x4c
ret
lea eax, [esp + 0x14]
lea ecx, [esp + 0x10]
push eax
lea edx, [esp + 0x1c]
push ecx
mov ecx, dword [0x1000a5cc]
push edx
lea eax, [esp + 0x28]
push ebx
push eax
push ecx
mov byte [esp + 0x34], bl
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
call ebp
mov esi, eax
mov eax, dword [0x10009fc4]
cmp eax, ebx
je 0x100017ae
mov edx, dword [esp + 0x10]
push edx
push esi
push str._peekpipe_d__tot_lu__n
push eax
call fcn.10001bce
add esp, 0x10
cmp esi, ebx
je 0x10001858
mov eax, dword [esp + 0x10]
cmp eax, 1
jb 0x10001858
cmp eax, 0x38
jbe 0x100017d0
mov dword [esp + 0x10], 0x38
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [0x1000a5cc]
lea eax, [esp + 0x18]
push ebx
push eax
lea ecx, [esp + 0x24]
push 1
push ecx
push edx
mov dword [esp + 0x2c], ebx
call edi
mov esi, eax
movsx eax, byte [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x1c]
push eax
push ecx
push esi
push str._readFile_lu__nob_lu__err_ld__buf_x
push 0x1000a3cc
call fcn.10001ccb
mov eax, dword [0x10009fc4]
add esp, 0x18
cmp eax, ebx
je 0x10001834
push 0x1000a3cc
push 0x100090e4
push eax
call fcn.10001bce
add esp, 0xc
cmp dword [esp + 0x18], ebx
jbe 0x1000184e
test byte [esp + 0x1c], 4
jne 0x1000184e
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x4c
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x4c
ret
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0x4c
ret
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x4c
ret