Function at 0x408e50
Capabilities:
Check for peb beingdebugged flag
Connect pipe
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
lea ecx, [ebp - 0x38]
sub esp, 0x7c
mov dword [ebp - 0x3c], 0
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x3c]
call fcn.00407b10
test eax, eax
mov ebx, eax
je 0x408e90
test byte [0x419090], 8
jne 0x4090fd
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp + 8]
test byte [0x419090], 8
mov edi, dword [eax + 0x10]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x50], eax
jne 0x409220
mov ebx, dword [ebp - 0x50]
mov eax, dword [ebx + 0x24]
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ConnectNamedPipe]
sub esp, 8
test eax, eax
je 0x409158
cmp word [edi], 0
je 0x409310
mov edx, edi
lea esi, [esi]
lea edi, [edi]
add edx, 2
cmp word [edx], 0
jne 0x408ef0
sub edx, edi
sar edx, 1
inc edx
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x408f37
mov ecx, dword [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
lea esi, [ecx + ebx*4]
nop
mov ebx, dword [ecx]
cmp word [ebx], 0
je 0x409138
mov eax, ebx
nop
add eax, 2
cmp word [eax], 0
jne 0x408f20
sub eax, ebx
sar eax, 1
inc eax
add ecx, 4
add edx, eax
cmp esi, ecx
jne 0x408f10
lea eax, [edx + edx + 2]
mov dword [ebp - 0x58], eax
mov esi, eax
mov dword [esp + 8], esi
xor esi, esi
mov dword [esp + 4], esi
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov esi, eax
sub esp, 0xc
xor eax, eax
test esi, esi
je 0x409320
nop
movzx edx, word [edi + eax]
mov word [esi + eax], dx
add eax, 2
test edx, edx
jne 0x408f70
cmp word [edi], 0
je 0x409340
mov eax, edi
nop
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x408f90
sub eax, edi
add eax, 2
mov ebx, dword [ebp + 0xc]
add eax, esi
test ebx, ebx
je 0x40900b
mov dword [ebp - 0x5c], edi
mov edx, dword [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
lea ebx, [edx + ebx*4]
mov dword [ebp - 0x4c], ebx
lea esi, [esi]
lea edi, [edi]
mov edi, dword [edx]
xor ecx, ecx
lea esi, [esi]
lea edi, [edi]
movzx ebx, word [edi + ecx]
mov word [eax + ecx], bx
add ecx, 2
test ebx, ebx
jne 0x408fd0
cmp word [eax], 0
je 0x409148
mov ecx, eax
nop
lea esi, [esi]
add ecx, 2
cmp word [ecx], 0
jne 0x408ff0
sub ecx, eax
add ecx, 2
add edx, 4
add eax, ecx
cmp dword [ebp - 0x4c], edx
jne 0x408fc0
mov edi, dword [ebp - 0x5c]
mov word [eax], 0
lea eax, [ebp - 0x34]
xor ecx, ecx
mov dword [esp + 0x18], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x54]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call fcn.00403530
test eax, eax
jne 0x409049
mov dword [ebp - 0x34], 0x41d
mov dword [esp + 8], esi
xor edx, edx
mov dword [esp + 4], edx
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov ebx, dword [ebp - 0x34]
sub esp, 0xc
test ebx, ebx
je 0x409190
mov edi, dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov esi, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov dword [ebp - 0x4c], eax
add eax, 0x18
mov dword [esp], eax
call edi
mov eax, dword [ebp + 8]
mov edi, dword [eax + 0x68]
sub esp, 4
test edi, edi
je 0x4090c2
mov dword [eax + 0x18], 1
mov edx, dword [ebp - 0x3c]
mov dword [eax + 0x68], 0
dec dword [edx + 0x10]
je 0x409350
mov dword [esp], edx
call fcn.00406bd0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
add eax, 0x18
mov dword [esp], eax
call esi
sub esp, 4
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 0x1c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x3c]
sub esp, 4
mov dword [esp], eax
call fcn.00406bd0
test byte [0x419090], 8
je 0x408e81
mov eax, str.returning__d_n
mov edx, str.service_start
mov dword [esp + 0x10], ebx
mov ecx, 0x419090
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], 3
call fcn.00406030
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 1
jmp 0x408f2e
mov ecx, 2
jmp 0x408ffe
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x409280
cmp dword [eax + 0x34], 0x217
je 0x408ed6
test byte [0x419090], 2
jne 0x409360
mov ebx, 0x41d
jmp 0x409076
mov eax, dword [ebp - 0x3c]
mov edi, dword [ebp + 8]
mov eax, dword [eax + 0x18]
mov edx, dword [edi + 0x30]
mov dword [esp], 2
mov dword [ebp - 0x28], eax
mov eax, dword [0x41908c]
mov dword [ebp - 0x2c], edx
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_WaitForMultipleObjects]
sub esp, 0x10
test eax, eax
jne 0x409270
mov eax, dword [ebp + 8]
mov edi, dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [eax + 8]
mov dword [ebp - 0x4c], eax
add eax, 0x18
mov dword [esp], eax
call edi
mov eax, dword [ebp + 8]
mov esi, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov ebx, dword [eax + 0x18]
mov eax, dword [eax + 8]
sub esp, 4
sub ebx, 2
mov dword [ebp - 0x4c], eax
add eax, 0x18
mov dword [esp], eax
call esi
sub esp, 4
and ebx, 0xfffffffd
je 0x4090d3
mov ebx, 0x41d
jmp 0x409082
mov eax, edi
call fcn.00406120
mov esi, dword [ebp + 0xc]
mov dword [esp], 3
mov dword [esp + 0x1c], esi
mov esi, dword [ebp + 0x10]
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x50]
mov dword [esp + 0x18], esi
mov esi, str._p__s__p__d_n
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], eax
mov eax, str.process_send_start_message
mov dword [esp + 8], eax
mov eax, 0x419090
mov dword [esp + 4], eax
call fcn.00406030
jmp 0x408eaf
mov edi, dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov esi, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
jmp 0x409213
mov ebx, dword [ebp - 0x50]
mov eax, dword [ebx + 0x24]
mov dword [ebp - 0x34], eax
mov eax, dword [ebx + 0x18]
xor ebx, ebx
mov dword [esp + 8], ebx
mov dword [esp], 2
mov dword [ebp - 0x30], eax
mov eax, dword [0x41908c]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x34]
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_WaitForMultipleObjects]
sub esp, 0x10
test eax, eax
jne 0x409390
cmp dword [ebp - 0x2c], 0x103
jne 0x408ed6
test byte [0x419090], 2
je 0x409185
mov eax, edi
call fcn.00406120
mov edx, str.process_send_start_message
mov ecx, 0x419090
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], 1
mov dword [esp + 0x10], eax
mov eax, str.service__s_failed_to_start_n
mov dword [esp + 0xc], eax
call fcn.00406030
jmp 0x409185
mov edx, 1
jmp 0x408efe
mov edi, dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov ebx, 0x46a
mov esi, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
jmp 0x409082
mov eax, 2
jmp 0x408f9e
mov dword [esp], edx
call fcn.00407a80
mov edx, dword [ebp - 0x3c]
jmp 0x4090ba
mov dword [esp], 1
mov eax, str.pipe_connect_failed_n
mov dword [esp + 0xc], eax
mov eax, str.process_send_start_message
mov dword [esp + 8], eax
mov eax, 0x419090
mov dword [esp + 4], eax
call fcn.00406030
jmp 0x409185
mov eax, dword [ebp - 0x50]
mov eax, dword [eax + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CancelIo]
sub esp, 4
jmp 0x4092bd