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

Disassembly:
push rdi
sub rsp, 0x70
mov rdi, qword [0x140032a20]
test rdi, rdi
je 0x1400052e0
mov qword [rsp + 0x68], rbx
mov ecx, 0x80000
mov qword [rsp + 0x60], rbp
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x48], r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r14, rax
xor r15d, r15d
mov rsi, qword [rdi + 0x1c]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x28], r15
xor edx, edx
mov rcx, rsi
cmp word [rdi + 0x44], 1
jne 0x140005162
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
jne 0x1400050ab
lea ebx, [rax - 1]
jmp 0x140005264
mov ebx, r15d
cmp dword [rsp + 0x30], r15d
je 0x140005264
lea r9, [rsp + 0x80]
mov dword [rsp + 0x80], r15d
mov r8d, 4
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0x90]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140005133
nop dword [rax]
mov eax, dword [rsp + 0x80]
test eax, eax
je 0x140005133
add ebx, eax
cmp ebx, 4
jge 0x14000513d
mov r8d, 4
movsxd rax, ebx
lea rdx, [rsp + 0x90]
mov qword [rsp + 0x20], r15
sub r8d, ebx
lea r9, [rsp + 0x80]
add rdx, rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1400050f0
mov ebx, 0xffffffff
jmp 0x140005204
jne 0x140005133
mov r8d, dword [rsp + 0x90]
cmp r8d, 0x80000
jg 0x140005133
mov rdx, r14
mov rcx, rsi
call fcn.1400087d0
mov ebx, eax
jmp 0x140005204
lea rax, [rsp + 0x98]
mov dword [rsp + 0x88], r15d
mov qword [rsp + 0x20], rax
mov rbp, r14
mov ebx, r15d
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x1400051ff
nop word [rax + rax]
cmp dword [rsp + 0x98], r15d
je 0x140005241
cmp ebx, 0x80000
jge 0x140005241
mov r8d, 0x80000
mov qword [rsp + 0x20], r15
sub r8d, ebx
lea r9, [rsp + 0x88]
mov rdx, rbp
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x88]
xor r9d, r9d
add ebx, eax
mov qword [rsp + 0x28], r15
add rbp, rax
xor r8d, r8d
lea rax, [rsp + 0x98]
xor edx, edx
mov rcx, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
jne 0x140005190
mov ebx, 0xffffffff
test ebx, ebx
jle 0x140005264
cmp dword [0x140036d14], 1
mov r8d, dword [rdi + 0x40]
jne 0x140005256
mov rax, qword [0x140036d20]
cmp word [rax + 0x1c0], 2
jne 0x140005256
movsxd rcx, dword [rax + 0x1c8]
test ecx, ecx
je 0x140005256
movsxd rdx, ebx
cmp rdx, rcx
ja 0x14000524a
mov r9d, 1
jmp 0x14000525c
mov ebx, dword [rsp + 0x88]
jmp 0x140005204
mov rdx, r14
mov ecx, ebx
call fcn.14000a2f0
jmp 0x140005264
movsxd rdx, ebx
xor r9d, r9d
mov rcx, r14
call fcn.14000a200
mov eax, dword [rdi + 0x34]
cmp eax, 1
jne 0x140005273
cmp ebx, 0xffffffff
je 0x14000528a
jmp 0x140005291
test eax, eax
jne 0x140005291
mov rcx, qword [rdi + 4]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x140005291
mov dword [rdi + 0x38], 1
cmp word [rdi + 0x44], 1
jne 0x14000529c
test ebx, ebx
jg 0x1400052a0
mov rdi, qword [rdi + 0x2c]
test rdi, rdi
jne 0x140005070
xor edx, edx
mov r8d, 0x80000
mov rcx, r14
call fcn.140021acb
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call fcn.140004e70
mov r15, qword [rsp + 0x48]
mov r14, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x68]
add rsp, 0x70
pop rdi
ret