Function at 0x502d70
Capabilities:
Read pipe
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6bff46
mov eax, dword fs:[0]
push eax
sub esp, 0x34c
mov eax, dword [0x78efc4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x248]
push eax
call fcn.005020d0
lea ecx, [ebp - 0x340]
call fcn.00500b20
push 0
lea eax, [ebp - 0x348]
mov dword [ebp - 0x348], 0
push eax
push 0xf8
lea eax, [ebp - 0x340]
push eax
push 0xf8
lea eax, [ebp - 0x248]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_TransactNamedPipe]
test eax, eax
jne 0x502e62
call fcn.004486f0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x28]
call fcn.00531420
lea eax, [ebp - 0x28]
mov dword [ebp - 4], 0
push eax
push str.Unable_establish_connection_with_monitor__IPC_communication_problem_._Error:__0
push 2
mov ecx, esi
call fcn.0044f2f0
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x503275
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x502e53
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x503294
push edx
push ecx
call fcn.006779b1
add esp, 8
jmp 0x503275
cmp byte [ebp - 0x338], 2
jne 0x503262
cmp dword [ebp - 0x33c], 8
jne 0x503262
cmp dword [ebp - 0x330], 0
je 0x503262
cmp dword [ebp - 0x340], 0xf8
jne 0x503262
lea ecx, [ebp - 0x150]
call fcn.00500b20
push 0
lea eax, [ebp - 0x348]
mov byte [ebp - 0x148], 3
push eax
push 0xf8
lea eax, [ebp - 0x150]
mov dword [ebp - 0x14c], 8
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x502f42
call fcn.004486f0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x28]
call fcn.00531420
lea eax, [ebp - 0x28]
mov dword [ebp - 4], 1
push eax
push str.Unable_establish_connection_with_monitor__IPC_communication_problem_._Error:__0
push 2
mov ecx, esi
call fcn.0044f2f0
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x503275
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x502e53
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x503294
jmp 0x502e53
push 4
lea esi, [edi + 0x118]
call fcn.00677616
add esp, 4
mov dword [ebp - 0x344], eax
mov dword [eax], esi
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [ebp - 0x344]
mov dword [ebp - 0x34c], esi
push 0x30
mov dword [ebp - 4], 2
call fcn.00677616
sub esp, 0x24
mov dword [ebp - 0x344], eax
mov edx, dword [ebp - 0x32c]
mov ecx, esp
push edx
mov dword [ecx], vtable.std::_Func_impl_no_alloc_bool____cdecl___void____bool__void__.0
mov dword [ecx + 4], 0x537900
mov dword [ecx + 0x24], ecx
mov ecx, eax
call fcn.00504590
lea ecx, [edi + 0x104]
mov dword [ebp - 0x344], eax
lea edx, [ebp - 0x344]
cmp ecx, edx
je 0x502fca
push eax
mov dword [ebp - 0x344], 0
call fcn.00464bc0
lea ecx, [ebp - 0x344]
call fcn.00464c60
push 0x30
call fcn.00677616
sub esp, 0x24
mov dword [ebp - 0x344], eax
mov edx, dword [ebp - 0x328]
mov ecx, esp
push edx
mov dword [ecx], vtable.std::_Func_impl_no_alloc_bool____cdecl___void____bool__void__.0
mov dword [ecx + 4], 0x537900
mov dword [ecx + 0x24], ecx
mov ecx, eax
call fcn.00504590
lea ecx, [edi + 0x108]
mov dword [ebp - 0x344], eax
lea edx, [ebp - 0x344]
cmp ecx, edx
je 0x50302b
push eax
mov dword [ebp - 0x344], 0
call fcn.00464bc0
lea ecx, [ebp - 0x344]
call fcn.00464c60
push 0x30
call fcn.00677616
sub esp, 0x24
mov dword [ebp - 0x344], eax
mov edx, dword [ebp - 0x324]
mov ecx, esp
push edx
mov dword [ecx], vtable.std::_Func_impl_no_alloc_bool____cdecl___void____bool__void__.0
mov dword [ecx + 4], 0x537900
mov dword [ecx + 0x24], ecx
mov ecx, eax
call fcn.00504590
lea ecx, [edi + 0x10c]
mov dword [ebp - 0x344], eax
lea edx, [ebp - 0x344]
cmp ecx, edx
je 0x50308c
push eax
mov dword [ebp - 0x344], 0
call fcn.00464bc0
lea ecx, [ebp - 0x344]
call fcn.00464c60
push 0x30
call fcn.00677616
sub esp, 0x24
mov dword [ebp - 0x344], eax
mov edx, dword [ebp - 0x330]
mov ecx, esp
push edx
mov dword [ecx], vtable.std::_Func_impl_no_alloc_bool____cdecl___void____bool__void__.0
mov dword [ecx + 4], 0x537900
mov dword [ecx + 0x24], ecx
mov ecx, eax
call fcn.00504590
lea ecx, [edi + 0x100]
mov dword [ebp - 0x344], eax
lea edx, [ebp - 0x344]
cmp ecx, edx
je 0x5030ed
push eax
mov dword [ebp - 0x344], 0
call fcn.00464bc0
lea ecx, [ebp - 0x344]
call fcn.00464c60
push 0x30
call fcn.00677616
sub esp, 0x24
mov dword [ebp - 0x344], eax
mov edx, dword [ebp - 0x320]
mov ecx, esp
push edx
mov dword [ecx], vtable.std::_Func_impl_no_alloc_bool____cdecl___void____bool__void__.0
mov dword [ecx + 4], 0x537900
mov dword [ecx + 0x24], ecx
mov ecx, eax
call fcn.00504590
lea ecx, [edi + 0x114]
mov dword [ebp - 0x344], eax
lea edx, [ebp - 0x344]
cmp ecx, edx
je 0x50314e
push eax
mov dword [ebp - 0x344], 0
call fcn.00464bc0
lea ecx, [ebp - 0x344]
call fcn.00464c60
push 0x30
call fcn.00677616
sub esp, 0x24
mov dword [ebp - 0x34c], eax
mov edx, dword [ebp - 0x31c]
mov ecx, esp
push edx
mov dword [ecx], vtable.std::_Func_impl_no_alloc_bool____cdecl___void____bool__void__.0
mov dword [ecx + 4], 0x537900
mov dword [ecx + 0x24], ecx
mov ecx, eax
call fcn.00504590
lea ecx, [edi + 0x110]
mov dword [ebp - 0x344], eax
lea edx, [ebp - 0x344]
cmp ecx, edx
je 0x5031af
push eax
mov dword [ebp - 0x344], 0
call fcn.00464bc0
lea ecx, [ebp - 0x344]
call fcn.00464c60
mov eax, dword [ebp - 0x334]
mov dword [edi + 4], eax
mov dword [ebp - 4], 0xffffffff
push dword [esi]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 4
push esi
call fcn.006779b1
call fcn.004486f0
mov edx, dword [ebp - 0x33c]
lea ecx, [ebp - 0x58]
mov esi, eax
call fcn.00447cf0
lea edx, [ebp - 0x334]
mov dword [ebp - 4], 3
lea ecx, [ebp - 0x40]
call fcn.004657c0
add esp, 4
mov dword [ebp - 4], 4
lea eax, [ebp - 0x28]
lea ecx, [ebp - 0x58]
push eax
push ecx
lea ecx, [ebp - 0x358]
call fcn.0044fb00
lea eax, [ebp - 0x358]
mov byte [ebp - 4], 5
push eax
push str.Monitors_IPC_protocol_version_0__pid_1
push 1
mov ecx, esi
call fcn.004dd4f0
lea ecx, [ebp - 0x358]
call fcn.0044d720
push fcn.0044bb60
push 2
push 0x18
lea eax, [ebp - 0x58]
mov dword [ebp - 4], 0xffffffff
push eax
call fcn.00677646
mov al, 1
jmp 0x503277
call fcn.004486f0
push str.Unable_establish_connection_with_monitor._Error:_invalid_response
push 2
mov ecx, eax
call fcn.0044e9d0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.006773ff
mov esp, ebp
pop ebp
ret 4
call fcn.00682da2
int3