Function at 0x40e470
Capabilities:
Read pipe
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x128
mov eax, dword [0x43b004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x128], eax
mov eax, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x124], eax
mov eax, dword [ebp + 0x18]
push edi
mov dword [ebp - 0x11c], eax
lea eax, [ebp - 0x108]
push str..pipeK7TSMngrService1
push eax
mov dword [ebp - 0x10c], ecx
mov dword [ebp - 0x110], ebx
call dword [sym.imp.USER32.dll_wsprintfA]
xor edi, edi
add esp, 8
mov dword [ebp - 0x118], edi
cmp dword [esi], edi
je 0x40e4dd
mov edi, dword [esi + 4]
mov dword [ebp - 0x118], edi
lea eax, [ebx + 0x40]
add eax, edi
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x40e509
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041559f
mov esp, ebp
pop ebp
ret
lea eax, [ebx + 0x1c]
mov dword [ebx], 0x4b375453
add eax, edi
mov dword [ebx + 4], 0x1010
mov dword [ebp - 0x114], eax
mov eax, dword [ebp - 0x10c]
mov dword [ebx + 0x10], eax
mov eax, dword [ebp - 0x110]
mov dword [ebx + 8], 0x1c
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x14], edi
mov dword [ebx + 0x18], eax
test edi, edi
je 0x40e55e
mov eax, dword [esi]
lea ecx, [ebx + 0x1c]
test eax, eax
je 0x40e55e
push dword [esi + 4]
push eax
push ecx
call fcn.00418f60
add esp, 0xc
push 0
call fcn.0041bfa4
add esp, 4
lea esi, [eax + 5]
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40e5eb
nop
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
je 0x40e5b6
push 0
call fcn.0041bfa4
add esp, 4
cmp eax, esi
ja 0x40e612
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x2710
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeA]
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40e590
push 0
push 0
lea eax, [ebp - 0x120]
mov dword [ebp - 0x120], 2
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetNamedPipeHandleState]
test eax, eax
jne 0x40e61e
xor esi, esi
jmp 0x40e6d0
cmp edi, 0xffffffff
jne 0x40e5eb
xor esi, esi
jmp 0x40e6dc
mov esi, dword [ebp - 0x114]
lea eax, [ebp - 0x10c]
push 0
push eax
mov eax, dword [ebp - 0x110]
add eax, 0x24
mov dword [ebp - 0x10c], 0
push eax
mov eax, dword [ebp - 0x118]
push esi
add eax, 0x1c
push eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_TransactNamedPipe]
test eax, eax
jne 0x40e65c
xor esi, esi
jmp 0x40e6d0
mov ecx, dword [ebp - 0x10c]
cmp ecx, 0x24
jae 0x40e66b
xor esi, esi
jmp 0x40e6d0
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x40e676
xor esi, esi
jmp 0x40e6c8
mov edx, dword [ebp - 0x110]
lea eax, [ecx - 0x24]
mov dword [ebp - 0x10c], eax
mov esi, 1
mov ecx, eax
cmp eax, edx
jbe 0x40e69a
mov eax, edx
mov ecx, edx
mov dword [ebp - 0x10c], eax
mov edx, dword [ebp - 0x124]
mov dword [edx], eax
test ecx, ecx
je 0x40e6bf
push eax
mov eax, dword [ebp - 0x114]
add eax, 0x24
push eax
push dword [ebp - 0x128]
call fcn.00418f60
add esp, 0xc
mov eax, dword [ebp - 0x114]
mov eax, dword [eax + 0x20]
mov ecx, dword [ebp - 0x11c]
mov dword [ecx], eax
cmp edi, 0xffffffff
je 0x40e6dc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041559f
mov esp, ebp
pop ebp
ret