Function at 0x408dd1
Capabilities:
Create pipe

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
xor esi, esi
push ebx
sub esp, 0x5c
mov eax, dword [ebp + 8]
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x34], 0xffffffff
mov dword [eax], 0xffffffff
mov dword [eax + 4], 0xffffffff
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x30], 0xffffffff
mov dword [eax], 0xffffffff
mov dword [ebp - 0x24], 0xc
mov dword [ebp - 0x1c], 1
mov dword [esp], 0xfffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push edi
mov ebx, eax
lea edi, [ebp - 0x34]
call esi
mov dword [ebp - 0x3c], eax
call esi
xor edx, edx
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edi
mov edx, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov dword [esp + 8], edx
mov dword [esp + 4], ebx
mov dword [ebp - 0x40], eax
call eax
sub esp, 0x1c
test eax, eax
jne 0x408f25
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c], eax
cmp eax, 6
jne 0x408f0b
xor ecx, ecx
xor ebx, ebx
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], 3
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], 0x42ae06
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x408f0b
call esi
mov dword [ebp - 0x44], eax
call esi
xor edx, edx
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edi
mov edx, dword [ebp - 0x44]
mov dword [esp + 4], ebx
mov dword [esp + 8], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x40]
call eax
sub esp, 0x1c
test eax, eax
jne 0x408f0b
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
cmp dword [ebp - 0x34], 0xffffffff
jne 0x408f25
mov eax, dword [ebp - 0x3c]
mov dword [esp + 8], str.windows32_openpipe:_DuplicateHandle_In__failed__e_lu__n
mov dword [esp + 0xc], eax
jmp 0x40902f
mov eax, dword [ebp + 0xc]
xor edi, edi
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__get_osfhandle]
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov ebx, eax
call esi
mov dword [ebp - 0x3c], eax
call esi
mov dword [esp + 0x10], edi
lea edi, [ebp - 0x30]
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 1
mov dword [esp + 0xc], edi
mov edx, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov dword [esp + 8], edx
mov dword [esp + 4], ebx
mov dword [ebp - 0x40], eax
call eax
sub esp, 0x1c
test eax, eax
jne 0x409049
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c], eax
cmp eax, 6
jne 0x40901a
xor ecx, ecx
xor ebx, ebx
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], 3
mov dword [esp + 8], 3
mov dword [esp + 4], 0x40000000
mov dword [esp], 0x42ae06
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x40901a
call esi
mov dword [ebp - 0x44], eax
call esi
xor edx, edx
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edi
mov edx, dword [ebp - 0x44]
mov dword [esp + 4], ebx
mov dword [esp + 8], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x40]
call eax
sub esp, 0x1c
test eax, eax
jne 0x40901a
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
cmp dword [ebp - 0x30], 0xffffffff
jne 0x409049
mov eax, dword [ebp - 0x3c]
mov dword [esp + 8], str.windows32_openpipe:_DuplicateHandle_Err__failed__e_lu__n
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 4], 0x16
mov dword [esp], eax
call fcn.00412148
or esi, 0xffffffff
jmp 0x409162
xor eax, eax
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x24]
mov dword [esp + 8], eax
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
lea eax, [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
sub esp, 0x10
test eax, eax
jne 0x409084
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 8], str.CreatePipe___failed__e_lu__n
mov dword [esp + 0xc], eax
jmp 0x40902f
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call fcn.0041e146
mov ebx, eax
test eax, eax
jne 0x4090bb
xor eax, eax
mov dword [esp + 8], str.windows32_openpipe__:_process_init_fd___failed_n
mov dword [esp + 4], eax
mov dword [esp], eax
call fcn.00412148
jmp 0x409041
xor eax, eax
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x14]
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.0041e184
mov dword [esp], ebx
mov esi, eax
test eax, eax
jne 0x409124
call fcn.0041df7e
mov eax, dword [ebp + 0x10]
xor edi, edi
mov dword [eax], ebx
mov ebx, dword [sym.imp.msvcrt.dll__open_osfhandle]
mov dword [esp + 4], edi
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call ebx
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
mov dword [esp + 4], 8
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call ebx
mov ecx, dword [ebp + 8]
mov dword [ecx + 4], eax
jmp 0x409162
call fcn.0041e9f3
mov eax, dword [ebp - 0x34]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, 0xffffffff
je 0x40913d
mov dword [esp], eax
call ebx
push esi
mov eax, dword [ebp - 0x30]
cmp eax, 0xffffffff
je 0x40914b
mov dword [esp], eax
call ebx
push ecx
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call ebx
push eax
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call ebx
push edx
jmp 0x409041
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret