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

Disassembly:
push rbx
push rsi
push r13
sub rsp, 0x90
mov rax, qword [0x140415a10]
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 0x1400d57b0
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, [0x140346ee0]
lea rdx, str._s___error__d
lea ecx, [rbx + 2]
mov r9d, eax
call fcn.14016fab0
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d59f9
mov r8d, dword [rsp + 0x30]
cmp r8d, 8
je 0x1400d57df
mov r9d, 8
lea rdx, str.not_enough_read___d_bytes__expected__d_bytes_
lea ecx, [r9 - 6]
call fcn.14016fab0
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d59f9
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x60]
mov r8d, 0xa
mov qword [rsp + 0xc0], rbp
call fcn.1402b9a08
mov ebp, eax
test eax, eax
jne 0x1400d5842
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 0x1400d5834
mov rcx, qword [rsp + 0x40]
call fcn.1402150f0
mov dword [rsi + 0x34], 1
xor al, al
jmp 0x1400d59f1
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 0x1400d589a
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, [0x140346ee0]
lea rdx, str._s___error__d
mov r9d, eax
mov ecx, 2
call fcn.14016fab0
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d59f1
cmp dword [rsp + 0x34], ebp
jae 0x1400d58c7
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.14016fab0
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d59f1
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.1402b7390
mov rdi, rax
test rax, rax
jne 0x1400d5916
lea rdx, str.out_of_memory__needed__u_bytes_
lea ecx, [rax + 2]
mov r8d, r14d
call fcn.14016fab0
mov dword [rsi + 0x34], 3
xor al, al
jmp 0x1400d59d9
mov r8, r15
xor edx, edx
mov rcx, rax
call fcn.1402bfa30
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 0x1400d5975
mov rcx, rdi
call fcn.1402b7350
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, [0x140346ee0]
lea rdx, str._s___error__d
mov r9d, eax
mov ecx, 2
call fcn.14016fab0
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d59d9
cmp dword [rsp + 0x30], ebp
jae 0x1400d59a7
mov rcx, rdi
call fcn.1402b7350
mov r8d, dword [rsp + 0x30]
lea rdx, str.not_enough_read___d_bytes__expected__d_bytes_
mov r9d, ebp
mov ecx, 2
call fcn.14016fab0
mov dword [rsi + 0x34], 5
xor al, al
jmp 0x1400d59d9
cmp byte [rdi], bl
je 0x1400d59b9
or rbx, 0xffffffffffffffff
nop
inc rbx
cmp byte [rdi + rbx], 0
jne 0x1400d59b0
lea rcx, [rsi + 0x58]
mov r8, rbx
mov rdx, rdi
call fcn.1400ba880
mov rcx, rdi
mov dword [rsi + 0x34], 1
call fcn.1402b7350
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.1402b6d40
add rsp, 0x90
pop r13
pop rsi
pop rbx
ret