Function at 0x407460
Capabilities:
Create pipe
Terminate process

Disassembly:
sub esp, 0x87c
push ebx
push ebp
push esi
mov esi, dword [0x41c274]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x1c]
xor ebp, ebp
or edi, 0xffffffff
cmp eax, ebp
je 0x4074b7
lea ecx, [esp + 0x2c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov edx, dword [esi + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x2c], 0x103
jne 0x4074ae
mov eax, dword [esi + 0x1c]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov dword [esi + 0x1c], ebp
mov dword [esi + 0x18], ebp
mov dword [esi + 0x20], ebp
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], ebp
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], edi
xor bl, bl
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0x41a238
lea ecx, [esp + 0x90]
push 0x40929c
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [0x41c27c]
push eax
lea edx, [esp + 0x9c]
push edx
call fcn.00407a20
add esp, 0x18
push eax
push ebp
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
cmp esi, ebp
je 0x40766a
lea eax, [esp + 0x14]
push eax
push 0x2000000
push esi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x40766a
mov edi, 0xc
push edi
lea ecx, [esp + 0x24]
push ebp
push ecx
call fcn.00401100
mov ecx, dword [esp + 0x20]
add esp, 0xc
lea edx, [esp + 0x10]
push edx
push 1
push 2
lea eax, [esp + 0x2c]
push eax
push 0x2000000
push ecx
mov dword [esp + 0x38], edi
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x40766a
push edi
lea edx, [esp + 0x24]
push ebp
push edx
call fcn.00401100
add esp, 0xc
push ebp
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
mov dword [esp + 0x30], edi
mov dword [esp + 0x38], 1
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x40766a
push 0x10
lea eax, [esp + 0x34]
push ebp
push eax
call fcn.00401100
push 0x44
lea ecx, [esp + 0x50]
push ebp
push ecx
call fcn.00401100
mov eax, dword [esp + 0x30]
add esp, 0x18
lea edx, [esp + 0x30]
push edx
mov edx, dword [esp + 0x14]
mov dword [esp + 0x84], eax
mov dword [esp + 0x80], eax
lea eax, [esp + 0x44]
push eax
push ebp
push ebp
push ebp
lea ecx, [esp + 0x9c]
push ecx
push ebp
push ebp
push edx
mov dword [esp + 0x64], 0x44
mov dword [esp + 0x90], 0x100
call dword [0x41c254]
test eax, eax
setne bl
test bl, bl
je 0x407653
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
push eax
push ecx
push edx
call fcn.00407a20
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x28]
add esp, 0xc
push eax
push ecx
push edx
call fcn.00401060
mov eax, dword [esp + 0x34]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call edi
jmp 0x407670
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x8c]
push ecx
call fcn.00407a20
add esp, 8
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
cmp eax, ebp
je 0x40767b
push eax
call edi
mov eax, dword [esp + 0x14]
cmp eax, ebp
je 0x407686
push eax
call edi
cmp esi, ebp
je 0x40768d
push esi
call edi
pop edi
pop esi
pop ebp
mov al, bl
pop ebx
add esp, 0x87c
ret