Function at 0x4017a0
Capabilities:
Create pipe
Create process on windows
Read file on windows
Write and execute a file
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x588
push ebx
push esi
push edi
mov dword [ebp - 0x588], edx
mov dword [ebp - 0x584], ecx
push 0
push pe_nt_image_headers32
push 2
push 0
push 1
push 0x40000000
mov eax, dword [ebp - 0x584]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x560], eax
cmp dword [ebp - 0x560], 0xffffffff
jne 0x401813
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.004016cf
push eax
mov eax, dword [ebp - 0x584]
push eax
push str.System_Error_:_Cannot_open_work_file__s_:__s_n
call fcn.00401d0a
add esp, 0xc
xor eax, eax
jmp 0x401b4f
mov eax, dword [ebp - 0x588]
push eax
push str.___s___r_n_r_n
lea eax, [ebp - 0x108]
push eax
call fcn.00401c6f
add esp, 0xc
mov dword [ebp - 4], eax
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push eax
lea eax, [ebp - 0x108]
push eax
mov eax, dword [ebp - 0x560]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x570], 0xc
mov dword [ebp - 0x56c], 0
mov dword [ebp - 0x568], 1
push 0
lea eax, [ebp - 0x570]
push eax
lea eax, [ebp - 0x564]
push eax
lea eax, [ebp - 0x510]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x4018b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.004016cf
push eax
push str.System_Error_:_Cannot_open_pipe_:__s_n
call fcn.00401d0a
add esp, 8
xor eax, eax
jmp 0x401b4f
push 2
push 1
push 0
lea eax, [ebp - 0x518]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
mov eax, dword [ebp - 0x564]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x401906
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.004016cf
push eax
push str.System_Error_:_Cannot_duplicate_handle_:__s_n
call fcn.00401d0a
add esp, 8
xor eax, eax
jmp 0x401b4f
mov eax, dword [ebp - 0x564]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_SetStdHandle]
test eax, eax
je 0x401934
mov eax, dword [ebp - 0x518]
push eax
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_SetStdHandle]
test eax, eax
jne 0x401956
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.004016cf
push eax
push str.System_Error_:_Cannot_redirect_output_:__s_n
call fcn.00401d0a
add esp, 8
xor eax, eax
jmp 0x401b4f
push 0x44
push 0
lea eax, [ebp - 0x55c]
push eax
call fcn.00401cc8
add esp, 0xc
mov dword [ebp - 0x55c], 0x44
lea eax, [ebp - 0x580]
push eax
lea eax, [ebp - 0x55c]
push eax
push 0
push 0
push 0
push 1
push 0
push 0
mov eax, dword [ebp + 8]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov dword [ebp - 0x50c], eax
cmp dword [ebp - 0x50c], 0
jne 0x4019d8
lea eax, [ebp - 0x580]
push eax
lea eax, [ebp - 0x55c]
push eax
push 0
push 0
push 0
push 1
push 0
push 0
mov eax, dword [ebp + 0xc]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov dword [ebp - 0x50c], eax
cmp dword [ebp - 0x50c], 0
jne 0x401a40
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.004016cf
push eax
push str.Cannot_run_command_:__s_r_n
lea eax, [ebp - 0x108]
push eax
call fcn.00401c6f
add esp, 0xc
mov dword [ebp - 4], eax
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push eax
lea eax, [ebp - 0x108]
push eax
mov eax, dword [ebp - 0x560]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x108]
push eax
call fcn.00401d0a
add esp, 4
xor edx, edx
xor ecx, ecx
call fcn.00401736
mov eax, dword [ebp - 0x57c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x580]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x564]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x518]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
lea eax, [ebp - 4]
push eax
push 0x400
lea eax, [ebp - 0x508]
push eax
mov eax, dword [ebp - 0x510]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x50c], eax
cmp dword [ebp - 0x50c], 0
jne 0x401af0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x514], eax
cmp dword [ebp - 0x514], 0x6d
jne 0x401ac9
jmp 0x401b2b
mov ecx, dword [ebp - 0x514]
call fcn.004016cf
push eax
push str._n_nSystem_Error_:_Pipe_read_failed_:__s_n
lea eax, [ebp - 0x108]
push eax
call fcn.00401c6f
add esp, 0xc
xor eax, eax
jmp 0x401b4f
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push eax
lea eax, [ebp - 0x508]
push eax
mov eax, dword [ebp - 0x560]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x508]
push eax
mov eax, dword [ebp - 4]
push eax
push str._.s
call fcn.00401d0a
add esp, 0xc
jmp 0x401a74
mov eax, dword [ebp - 0x560]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x510]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
jmp 0x401b4f
pop edi
pop esi
pop ebx
leave
ret 8