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

Disassembly:
push rbx
push rsi
push r13
sub rsp, 0x90
mov rax, qword [0x140418a10]
xor rax, rsp
mov qword [rsp + 0x70], rax
xor eax, eax
mov r13, rcx
mov rcx, qword [rcx + 0x28]
mov rsi, rdx
xor ebx, ebx
lea r9, [rsp + 0x30]
lea r8d, [rax + 8]
lea rdx, [rsp + 0x60]
mov qword [rsp + 0x60], rax
mov byte [rsp + 0x68], al
mov dword [rsp + 0x30], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1400d5820
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, [0x140348ea0]
lea rdx, str._s___error__d
lea ecx, [rbx + 2]
mov r9d, eax
call fcn.140170d40
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d5a69
mov r8d, dword [rsp + 0x30]
cmp r8d, 8
je 0x1400d584f
mov r9d, 8
lea rdx, str.not_enough_read___d_bytes__expected__d_bytes_
lea ecx, [r9 - 6]
call fcn.140170d40
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d5a69
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x60]
mov r8d, 0xa
mov qword [rsp + 0xc0], rbp
call fcn.1402bc2d8
mov ebp, eax
test eax, eax
jne 0x1400d58b2
lea rcx, [rsi + 0x58]
lea rdx, [rsp + 0x40]
mov qword [rsp + 0x58], 0xf
mov qword [rsp + 0x50], rbx
mov byte [rsp + 0x40], bl
call fcn.1400b7e70
cmp qword [rsp + 0x58], 0x10
jb 0x1400d58a4
mov rcx, qword [rsp + 0x40]
call fcn.1402177e0
mov dword [rsi + 0x34], 1
xor al, al
jmp 0x1400d5a61
mov rcx, qword [r13 + 0x28]
lea rax, [rsp + 0x34]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x34], ebx
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
jne 0x1400d590a
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, [0x140348ea0]
lea rdx, str._s___error__d
mov r9d, eax
mov ecx, 2
call fcn.140170d40
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d5a61
cmp dword [rsp + 0x34], ebp
jae 0x1400d5937
mov r8d, dword [rsp + 0x30]
lea rdx, str.not_enough_bytes_available___d_bytes__expected__d_bytes_
mov r9d, ebp
mov ecx, 2
call fcn.140170d40
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d5a61
mov qword [rsp + 0xc8], rdi
mov qword [rsp + 0x88], r14
lea r14d, [rbp + 1]
mov ecx, r14d
mov qword [rsp + 0x80], r15
mov r15d, r14d
call fcn.1402b9c60
mov rdi, rax
test rax, rax
jne 0x1400d5986
lea rdx, str.out_of_memory__needed__u_bytes_
lea ecx, [rax + 2]
mov r8d, r14d
call fcn.140170d40
mov dword [rsi + 0x34], 3
xor al, al
jmp 0x1400d5a49
mov r8, r15
xor edx, edx
mov rcx, rax
call fcn.1402c22a0
mov rcx, qword [r13 + 0x28]
lea r9, [rsp + 0x30]
mov r8d, ebp
mov rdx, rdi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1400d59e5
mov rcx, rdi
call fcn.1402b9c20
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, [0x140348ea0]
lea rdx, str._s___error__d
mov r9d, eax
mov ecx, 2
call fcn.140170d40
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d5a49
cmp dword [rsp + 0x30], ebp
jae 0x1400d5a17
mov rcx, rdi
call fcn.1402b9c20
mov r8d, dword [rsp + 0x30]
lea rdx, str.not_enough_read___d_bytes__expected__d_bytes_
mov r9d, ebp
mov ecx, 2
call fcn.140170d40
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d5a49
cmp byte [rdi], bl
je 0x1400d5a29
or rbx, 0xffffffffffffffff
nop
inc rbx
cmp byte [rdi + rbx], 0
jne 0x1400d5a20
lea rcx, [rsi + 0x58]
mov r8, rbx
mov rdx, rdi
call fcn.1400ba880
mov rcx, rdi
mov dword [rsi + 0x34], 1
call fcn.1402b9c20
mov al, 1
mov r14, qword [rsp + 0x88]
mov rdi, qword [rsp + 0xc8]
mov r15, qword [rsp + 0x80]
mov rbp, qword [rsp + 0xc0]
mov rcx, qword [rsp + 0x70]
xor rcx, rsp
call fcn.1402b9610
add rsp, 0x90
pop r13
pop rsi
pop rbx
ret