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

Disassembly:
mov r11, rsp
push rbp
push rbx
push r14
lea rbp, [r11 - 0x238]
sub rsp, 0x320
mov rax, qword [0x180069028]
xor rax, rsp
mov qword [rbp + 0x1f0], rax
and dword [rdx + 0x58], 0xfffdffff
mov rbx, rdx
mov qword [r11 - 0x20], rsi
mov r14, rcx
mov qword [r11 - 0x28], rdi
mov rsi, r8
mov rdi, qword [rdx + 0x128]
test rdi, rdi
je 0x1800139a8
test byte [rdi + 0x58], 0x40
je 0x1800139a8
mov rcx, qword [rdi + 8]
mov rdx, rdi
add rcx, 0x58
call fcn.180010c80
mov eax, dword [rdi + 0x58]
test al, 0x40
je 0x1800139a8
and eax, 0xffffffbf
mov dword [rdi + 0x58], eax
test al, 0x20
je 0x1800139a8
mov rax, qword [rdi + 8]
dec dword [rax + 8]
mov ecx, dword [rsi + 0x40]
movaps xmmword [rsp + 0x300], xmm6
test ecx, ecx
jns 0x180013a70
test dword [rbx + 0x58], 0x100
je 0x180013c6c
movups xmm6, xmmword [0x18005fc48]
call qword [0x18006cdd8]
mov esi, eax
cmp eax, 0x3e3
je 0x180013c6c
mov rcx, qword [rbx + 0x128]
movdqa xmmword [rsp + 0x40], xmm6
cmp eax, 0x6d
jne 0x180013a34
test rcx, rcx
je 0x180013a0e
lea rdx, [0x180014260]
call fcn.18000b590
xor edi, edi
mov qword [rbx + 0x128], rdi
and dword [rbx + 0x58], 0xffff7fff
mov rcx, rbx
call fcn.18000b950
lea r8, [rsp + 0x40]
mov rdx, 0xfffffffffffff001
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
jmp 0x180013c6c
test rcx, rcx
je 0x180013a4e
lea rdx, [0x180014260]
call fcn.18000b590
xor edi, edi
mov qword [rbx + 0x128], rdi
mov rcx, rbx
call fcn.18000b950
mov ecx, esi
call fcn.180011510
movsxd rdx, eax
lea r8, [rsp + 0x40]
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
jmp 0x180013c6c
test dword [rbx + 0x58], 0x100
je 0x180013c52
xor edi, edi
nop
mov rcx, qword [rbx + 0x118]
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rdi
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x180013c26
mov ecx, dword [rsp + 0x30]
test ecx, ecx
je 0x180013c52
cmp dword [rbx + 0x110], edi
je 0x180013b71
cmp qword [rbx + 0x1e8], rdi
jne 0x180013b62
mov rcx, qword [rbx + 0x118]
lea r9, [rsp + 0x34]
mov r8d, select
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180013c26
mov eax, dword [rsp + 0x60]
test al, 2
je 0x180013b47
mov rcx, qword [rbx + 0x118]
lea r9, [rsp + 0x34]
mov r8d, 0x278
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180013c26
mov r8d, dword [rsp + 0x60]
lea rdx, [rsp + 0x70]
and r8d, 4
mov rcx, rbx
call fcn.180013810
mov eax, dword [rsp + 0x60]
test al, 1
je 0x180013b5c
mov rax, qword [rsp + 0x68]
mov qword [rbx + 0x1e8], rax
jmp 0x180013bf6
mov ecx, dword [rsp + 0x30]
jmp 0x180013b71
mov eax, dword [rbx + 0x1e8]
cmp ecx, eax
cmovae ecx, eax
mov dword [rsp + 0x30], ecx
mov edx, ecx
lea r8, [rsp + 0x50]
mov qword [rsp + 0x48], rdi
mov rcx, rbx
mov dword [rsp + 0x40], edi
movaps xmm0, xmmword [rsp + 0x40]
movdqa xmmword [rsp + 0x50], xmm0
call qword [rbx + 0x68]
mov rdx, qword [rsp + 0x58]
test rdx, rdx
je 0x180013c12
mov eax, dword [rsp + 0x50]
test eax, eax
je 0x180013c12
mov r8d, dword [rsp + 0x30]
lea r9, [rsp + 0x34]
mov rcx, qword [rbx + 0x118]
cmp eax, r8d
mov qword [rsp + 0x20], rdi
cmovb r8d, eax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180013c05
mov ecx, dword [rsp + 0x34]
cmp dword [rbx + 0x110], edi
je 0x180013bde
sub qword [rbx + 0x1e8], rcx
mov rdx, rcx
lea r8, [rsp + 0x50]
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
mov eax, dword [rsp + 0x50]
cmp dword [rsp + 0x34], eax
jbe 0x180013c52
test dword [rbx + 0x58], 0x100
jne 0x180013a80
jmp 0x180013c52
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rsp + 0x40], xmm0
jmp 0x180013c32
lea r8, [rsp + 0x50]
mov rdx, 0xfffffffffffff024
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
jmp 0x180013c52
movups xmm0, xmmword [0x18005fc48]
movaps xmmword [rsp + 0x40], xmm0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e3
je 0x180013c52
lea r9, [rsp + 0x40]
mov r8d, eax
mov rdx, rbx
mov rcx, r14
call fcn.180013770
mov eax, dword [rbx + 0x58]
and eax, 0x20100
cmp eax, 0x100
jne 0x180013c6c
mov rdx, rbx
mov rcx, r14
call fcn.180012fd0
mov ecx, dword [rbx + 0x78]
mov eax, dword [rbx + 0x58]
dec ecx
movaps xmm6, xmmword [rsp + 0x300]
mov rdi, qword [rsp + 0x310]
mov rsi, qword [rsp + 0x318]
mov dword [rbx + 0x78], ecx
test al, 1
je 0x180013cad
test ecx, ecx
jne 0x180013cad
test al, 8
jne 0x180013cad
or eax, 8
mov dword [rbx + 0x58], eax
mov rax, qword [r14 + 0x50]
mov qword [rbx + 0x50], rax
mov qword [r14 + 0x50], rbx
mov rcx, qword [rbp + 0x1f0]
xor rcx, rsp
call fcn.180016f60
add rsp, 0x320
pop r14
pop rbx
pop rbp
ret