Function at 0x40eb00
Capabilities:
Connect pipe
Read pipe
Write pipe

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc88
mov eax, dword [0x4900e8]
test eax, eax
push esi
mov esi, dword [ebp + 8]
push edi
mov byte [esp + 0xb], 0
je 0x40eb2d
push esi
push str.WinMainClient_WtsStateProcessing_is_called_with_state__u
call fcn.0040aab0
add esp, 8
xor eax, eax
mov ecx, 0x188
lea edi, [esp + 0x50]
rep stosd dword es:[edi], eax
lea eax, [esi - 1]
cmp eax, 7
ja case.0x40eb46.3
jmp dword [eax*4 + 0x40eed8]
mov ecx, 0x491840
call fcn.00415a00
cmp dword [0x491098], 8
jb case.0x40eb46.3
call fcn.00409f10
jmp 0x40ec9c
cmp esi, 8
jne 0x40eb7d
mov ecx, 0x493450
call fcn.00415a00
mov ecx, dword [0x4910d8]
test ecx, ecx
je 0x40eb8c
call fcn.004177e0
cmp esi, 8
jne 0x40eb9e
call fcn.0044e940
test eax, eax
je case.0x40eb46.3
xor eax, eax
mov ecx, 0x188
lea edi, [esp + 0x670]
rep stosd dword es:[edi], eax
mov eax, dword [0x491164]
mov dword [esp + 0x680], eax
xor eax, eax
push eax
mov ecx, 0xb
mov dword [esp + 0x67c], ecx
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x24]
push ecx
push 0x2c
lea edx, [esp + 0x30]
push edx
push 0x620
lea eax, [esp + 0x684]
push eax
push str..pipeExtEventPipe_Service
mov dword [esp + 0x68c], 0x8001
mov dword [esp + 0x690], 0x620
call dword [sym.imp.KERNEL32.dll_CallNamedPipeA]
test eax, eax
je 0x40ec13
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 1
jne 0x40ec27
mov dword [0x491178], 0
call fcn.0040e8b0
mov eax, dword [0x491178]
test eax, eax
jne 0x40ec4c
cmp esi, 8
jne 0x40ec4c
test dword [0x49109c], 0x8000000
je 0x40ec4c
mov ecx, dword [0x4900f4]
call fcn.00436a60
cmp dword [0x491098], 8
jb case.0x40eb46.3
cmp esi, 1
jne 0x40ec63
call fcn.00409f10
xor ecx, ecx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], ecx
lea edx, [esp + 0xc]
mov dword [esp + 0x18], ecx
push edx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x10], 7
call fcn.0044a760
mov eax, dword [0x491098]
add esp, 4
cmp eax, 8
jb case.0x40eb46.3
mov eax, dword [0x491078]
test eax, eax
je case.0x40eb46.3
mov byte [esp + 0xb], 1
jmp case.0x40eb46.3
mov ecx, 0x491840
call fcn.00415a20
cmp esi, 2
mov dword [0x493688], esi
je 0x40ecea
cmp esi, 6
je 0x40ecea
mov ecx, 0x493450
call fcn.00415a20
mov ecx, dword [0x4910d8]
test ecx, ecx
je 0x40ed14
push 0
call fcn.00417820
jmp 0x40ed14
mov ecx, dword [0x4910d8]
test ecx, ecx
mov dword [0x491178], 1
je 0x40ed05
push 1
call fcn.00417820
mov ecx, dword [0x4910b8]
test ecx, ecx
je 0x40ed14
call fcn.00401fe0
cmp esi, 7
jne 0x40ed5a
call fcn.0044e940
test eax, eax
je 0x40ed5a
mov eax, dword [0x491164]
mov dword [esp + 0x60], eax
xor eax, eax
push 1
mov ecx, 0xb
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x24]
push ecx
push 0x2c
lea edx, [esp + 0x30]
push edx
push 0x620
lea eax, [esp + 0x64]
mov dword [esp + 0x6c], 0xd
push eax
jmp 0x40eda0
mov ecx, dword [0x4910d8]
test ecx, ecx
je 0x40ed69
call fcn.00417660
mov ecx, dword [0x491164]
push 1
mov dword [esp + 0x64], ecx
xor eax, eax
lea edx, [esp + 0x24]
push edx
mov ecx, 0xb
lea edi, [esp + 0x2c]
rep stosd dword es:[edi], eax
push 0x2c
lea eax, [esp + 0x30]
push eax
push 0x620
lea ecx, [esp + 0x64]
mov dword [esp + 0x6c], 0xc
push ecx
push str..pipeExtEventPipe_Service
mov dword [esp + 0x70], 0x620
mov dword [esp + 0x6c], 0x8001
call dword [sym.imp.KERNEL32.dll_CallNamedPipeA]
test eax, eax
je 0x40edc5
call dword [sym.imp.KERNEL32.dll_GetLastError]
call fcn.00428c40
mov al, byte [esp + 0xb]
test al, al
mov dword [0x493688], esi
je 0x40eeb8
mov eax, dword [0x4957fc]
test eax, eax
je 0x40eeb8
xor edx, edx
mov dword [esp + 0x10], edx
xor eax, eax
mov dword [esp + 0x14], edx
mov ecx, 0x188
lea edi, [esp + 0x670]
rep stosd dword es:[edi], eax
mov dword [esp + 0x18], edx
push edx
mov ecx, 0xb
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
mov eax, dword [0x491164]
lea ecx, [esp + 0x28]
mov dword [esp + 0x20], edx
push ecx
lea edx, [esp + 0x678]
push edx
push str..pipeExtEventPipe_Service
mov dword [esp + 0x1c], 0
mov dword [esp + 0x688], 0x3f
mov dword [esp + 0x690], eax
call fcn.00409bf0
add esp, 0x10
test eax, eax
jne 0x40ee6f
test dword [0x4900e8], 0x10000
je 0x40ee97
push str.PowerXpressSwitch:_get_defer_switch_from_global_service_fails__n
call fcn.0040aab0
add esp, 4
jmp 0x40ee97
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x10]
cmp eax, 2
je 0x40eea5
cmp eax, 1
jne 0x40eed1
lea edx, [esp + 0xc]
push edx
call fcn.00441dd0
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret
test dword [0x4900e8], 0x10000
je 0x40eed1
push str.Not_ready_to_switch_yet__will_switch_later_when_iGPU_driver_initialized__n
call fcn.0040aab0
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret