Function at 0x1800016d0
Capabilities:
Connect pipe
Read file on windows
Write file on windows
Write pipe

Disassembly:
push rsi
push r12
sub rsp, 0x68
mov rax, qword [0x180024008]
xor rax, rsp
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x90], rbp
mov rsi, rcx
xor ebp, ebp
mov qword [rsp + 0x58], r14
mov r12d, ebp
mov r14d, ebp
cmp qword [rcx + 0x18], rbp
je 0x180001972
cmp qword [rcx + 0x20], rbp
je 0x180001972
mov rcx, qword [rcx + 8]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
je 0x180001729
lea r14d, [rbp + 1]
jmp 0x18000173e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
sete r14b
jne 0x180001972
mov qword [rsp + 0x88], rbx
lea rdx, str.Server::Listen
mov qword [rsp + 0x60], rdi
lea rcx, str._PPLmedic___ws__Client_connected._r_n
mov qword [rsp + 0x50], r15
call fcn.180001010
mov rcx, qword [rsi + 0x18]
xor edx, edx
mov r8d, 0x1000
call fcn.180004610
mov rcx, qword [rsi + 0x20]
xor edx, edx
mov r8d, 0x1000
call fcn.180004610
mov rdx, qword [rsi + 0x18]
lea r9, [rsp + 0x34]
mov rcx, qword [rsi + 8]
mov r8d, 0x1000
mov qword [rsp + 0x20], rbp
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180001934
nop dword [rax + rax]
cmp dword [rsp + 0x34], ebp
je 0x180001934
mov r15, qword [rsi + 0x18]
lea rdx, str.Server::ProcessRequest
mov rdi, qword [rsi + 0x20]
lea rcx, str._PPLmedic___ws__Processing_request_of_type:__d_r_n
mov ebx, dword [r15]
mov r8d, ebx
call fcn.180001010
sub ebx, 1
je 0x18000180b
sub ebx, 1
je 0x1800017fe
cmp ebx, 1
jne 0x1800019cd
mov r8, rdi
mov rdx, r15
call fcn.180002230
jmp 0x180001889
mov r8, rdi
mov rdx, r15
call fcn.180001fc0
jmp 0x180001889
mov dword [rsp + 0x30], 0xffffffff
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r9d, 4
lea r8, [rsp + 0x30]
mov rcx, rax
lea edx, [r9 + 3]
call qword [sym.imp.KERNEL32.dll_GetProcessInformation]
test eax, eax
je 0x180001851
mov r8d, dword [rsp + 0x30]
mov r9d, ebp
mov dword [rdi + 0xc], r8d
mov dword [rdi], 1
mov qword [rdi + 4], 1
jmp 0x18000186f
mov qword [rdi], 1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rdi + 8], eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, dword [rsp + 0x30]
mov r9d, eax
mov eax, dword [rdi + 4]
lea rdx, str.Server::DoGetProtectionLevel
lea rcx, str._PPLmedic___ws__Protection_level:_0x_08x__LE:__d__Result:__d_r_n
mov dword [rsp + 0x20], eax
call fcn.180001010
lea rcx, str._PPLmedic___ws__Result:__d_r_n
mov r8d, 1
lea rdx, str.Server::ProcessRequest
call fcn.180001010
mov rdx, qword [rsi + 0x20]
lea r9, [rsp + 0x38]
mov rcx, qword [rsi + 8]
mov r8d, 0x410
mov qword [rsp + 0x20], rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180001a15
cmp dword [rsp + 0x38], 0x410
jne 0x180001a15
mov rcx, qword [rsi + 8]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x1800019fb
mov rcx, qword [rsi + 0x18]
xor edx, edx
mov r8d, 0x1000
lea r12d, [rdx + 1]
call fcn.180004610
mov rcx, qword [rsi + 0x20]
xor edx, edx
mov r8d, 0x1000
call fcn.180004610
mov rdx, qword [rsi + 0x18]
lea r9, [rsp + 0x34]
mov rcx, qword [rsi + 8]
mov r8d, 0x1000
mov qword [rsp + 0x20], rbp
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1800017b0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._PPLmedic___ws__ReadFile_error:_0x_08x___d__r_n
mov r9d, ebx
lea rdx, str.Server::Listen
mov r8d, eax
call fcn.180001010
mov r15, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x88]
test r12d, r12d
jne 0x18000197a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov r9d, r12d
lea rdx, str.Server::Listen
mov r8d, ebp
lea rcx, str._PPLmedic___ws__LE:__d__Result:__d_r_n
call fcn.180001010
mov rbp, qword [rsp + 0x90]
test r14d, r14d
mov r14, qword [rsp + 0x58]
je 0x1800019b5
mov rcx, qword [rsi + 8]
cmp rcx, 0xffffffffffffffff
je 0x1800019b5
call qword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov eax, r12d
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.180002ad0
add rsp, 0x68
pop r12
pop rsi
ret
xor r8d, r8d
lea rdx, str.Server::ProcessRequest
lea rcx, str._PPLmedic___ws__Result:__d_r_n
call fcn.180001010
lea rdx, str.Server::Listen
lea rcx, str._PPLmedic___ws__Fail_to_process_request._r_n
call fcn.180001010
jmp 0x18000195b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._PPLmedic___ws__FlushFileBuffers_error:_0x_08x___d__r_n
jmp 0x180001949
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._PPLmedic___ws__WriteFile_error:_0x_08x___d__r_n
jmp 0x180001949