Function at 0x40bdf0
Capabilities:
Check os version
Create pipe
Create process on windows
Create reverse shell
Create two anonymous pipes
Manipulate console buffer
Read file on windows
Read pipe
Write and execute a file
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x52c
mov dword [ebp - 0x74], 0
xor eax, eax
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x6c], eax
mov dword [ebp - 0x68], eax
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [ebp - 4], eax
mov dword [ebp - 8], 0
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x78], eax
mov edx, dword [ebp - 0x78]
add edx, 0x109
push edx
push 0
mov eax, dword [0x416870]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x484], 0xc
mov dword [ebp - 0x480], 0
mov dword [ebp - 0x47c], 1
mov ecx, dword [ebp - 0x5c]
push ecx
call fcn.00405dc0
add esp, 4
push str.__Command__
mov edx, dword [ebp - 0x5c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0
lea eax, [ebp - 0x484]
push eax
lea ecx, [ebp - 0x4a0]
push ecx
lea edx, [ebp - 0x48c]
push edx
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x40beba
mov eax, dword [ebp - 0x5c]
push eax
push 0
mov ecx, dword [0x416870]
push ecx
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, 1
jmp 0x40c823
push 0
lea edx, [ebp - 0x484]
push edx
lea eax, [ebp - 0x494]
push eax
lea ecx, [ebp - 0x49c]
push ecx
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x40bf11
mov edx, dword [ebp - 0x5c]
push edx
push 0
mov eax, dword [0x416870]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebp - 0x48c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x4a0]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
jmp 0x40c823
push 2
push 0
push 0
lea eax, [ebp - 0x488]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
mov ecx, dword [ebp - 0x48c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov edx, dword [ebp - 0x48c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
push 0
push 0
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
mov ecx, dword [ebp - 0x494]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov edx, dword [ebp - 0x494]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x44
push 0
lea eax, [ebp - 0x58]
push eax
call fcn.0040f550
add esp, 0xc
mov dword [ebp - 0x58], 0x44
mov dword [ebp - 0x2c], 0x100
mov ecx, dword [ebp - 0x4a0]
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x49c]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x4a0]
mov dword [ebp - 0x1c], eax
movzx ecx, byte [ebp + 0x10]
test ecx, ecx
je 0x40bfd5
cmp dword [ebp - 4], 0x80000000
jb 0x40bfca
xor edx, edx
mov word [ebp - 0x28], dx
jmp 0x40bfd5
mov eax, dword [ebp - 8]
or eax, 0x8000000
mov dword [ebp - 8], eax
lea ecx, [ebp - 0x74]
push ecx
lea edx, [ebp - 0x58]
push edx
push 0
push 0
mov eax, dword [ebp - 8]
push eax
push 1
push 0
push 0
mov ecx, dword [ebp - 0x5c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x40c048
mov edx, dword [ebp - 0x5c]
push edx
push 0
mov eax, dword [0x416870]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebp - 0x488]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x4a0]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x49c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
jmp 0x40c823
push 0
lea edx, [ebp - 0x60]
push edx
push 0xd
push str._arg_______r_n
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x78], 0
jle 0x40c1fc
lea ecx, [ebp - 0x4d8]
call fcn.004109c0
mov ecx, dword [ebp + 0xc]
push ecx
lea ecx, [ebp - 0x4d8]
call fcn.00407380
lea edx, [ebp - 0x4dc]
push edx
lea eax, [ebp - 0x4d8]
push eax
call fcn.004079e0
mov dword [ebp - 0x10], 0
jmp 0x40c0a8
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0x4dc]
jge 0x40c1f1
mov byte [ebp - 0x4e1], 1
lea eax, [ebp - 0x4e0]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
lea edx, [ebp - 0x4d8]
push edx
call fcn.00407940
mov eax, dword [ebp - 0x4e0]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 1
mov dword [ebp - 0x4e8], eax
push 0
lea ecx, [ebp - 0x60]
push ecx
push 9
push str._arg__
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x4e0]
movzx ecx, word [eax]
cmp ecx, 0x22
je 0x40c12e
push 0
lea edx, [ebp - 0x60]
push edx
push 1
push 0x411470
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov byte [ebp - 0x4e1], 0
mov ecx, dword [ebp - 0x4e8]
push ecx
push 0
mov edx, dword [0x416870]
push edx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x4ec], eax
push 0
push 0
mov eax, dword [ebp - 0x4e8]
push eax
mov ecx, dword [ebp - 0x4ec]
push ecx
push 0xffffffffffffffff
mov edx, dword [ebp - 0x4e0]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0
lea eax, [ebp - 0x60]
push eax
mov ecx, dword [ebp - 0x4e8]
sub ecx, 1
push ecx
mov edx, dword [ebp - 0x4ec]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x4ec]
push ecx
push 0
mov edx, dword [0x416870]
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
movzx eax, byte [ebp - 0x4e1]
test eax, eax
jne 0x40c1c8
push 0
lea ecx, [ebp - 0x60]
push ecx
push 1
push 0x411474
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x60]
push eax
push 2
push 0x411478
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x4e0]
push edx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
jmp 0x40c09f
lea ecx, [ebp - 0x4d8]
call fcn.00407730
mov eax, dword [ebp + 8]
mov dword [ebp - 0x64], eax
mov ecx, 1
test ecx, ecx
je 0x40c6ff
mov edx, dword [ebp - 0x64]
movsx eax, byte [edx]
test eax, eax
jne 0x40c21e
jmp 0x40c6ff
mov dword [ebp - 0x10], 0
jmp 0x40c230
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov al, byte [edx]
mov byte [ebp - 0x48d], al
movsx ecx, byte [ebp - 0x48d]
test ecx, ecx
je 0x40c261
movsx edx, byte [ebp - 0x48d]
cmp edx, 0xd
je 0x40c261
movsx eax, byte [ebp - 0x48d]
cmp eax, 0xa
jne 0x40c263
jmp 0x40c265
jmp 0x40c227
cmp dword [ebp - 0x10], 0
jne 0x40c276
mov ecx, dword [ebp - 0x64]
add ecx, 1
mov dword [ebp - 0x64], ecx
jmp 0x40c202
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov byte [edx], 0
mov dword [ebp - 0x4fc], 0
mov dword [ebp - 0x498], 0
jmp 0x40c2a4
mov eax, dword [ebp - 0x498]
add eax, 1
mov dword [ebp - 0x498], eax
mov ecx, dword [ebp - 0x498]
cmp ecx, dword [ebp - 0x10]
jge 0x40c443
mov edx, dword [ebp - 0x4fc]
mov dword [ebp - 0x52c], edx
cmp dword [ebp - 0x52c], 4
ja case.default.0x40c2d2
mov eax, dword [ebp - 0x52c]
jmp dword [eax*4 + 0x40c828]
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x24
jne 0x40c2fb
mov eax, dword [ebp - 0x4fc]
add eax, 1
mov dword [ebp - 0x4fc], eax
jmp 0x40c305
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c2d2
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x61
je 0x40c32c
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x41
jne 0x40c33d
mov edx, dword [ebp - 0x4fc]
add edx, 1
mov dword [ebp - 0x4fc], edx
jmp 0x40c347
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c2d2
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x72
je 0x40c36e
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
movsx eax, byte [edx]
cmp eax, 0x52
jne 0x40c37f
mov ecx, dword [ebp - 0x4fc]
add ecx, 1
mov dword [ebp - 0x4fc], ecx
jmp 0x40c389
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c2d2
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
movsx eax, byte [edx]
cmp eax, 0x67
je 0x40c3ad
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x47
jne 0x40c3be
mov eax, dword [ebp - 0x4fc]
add eax, 1
mov dword [ebp - 0x4fc], eax
jmp 0x40c3c8
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c2d2
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x73
je 0x40c3ec
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x53
jne 0x40c3fd
mov edx, dword [ebp - 0x4fc]
add edx, 1
mov dword [ebp - 0x4fc], edx
jmp case.default.0x40c2d2
mov dword [ebp - 0x4fc], 0
cmp dword [ebp - 0x4fc], 5
jne 0x40c43e
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movzx ecx, byte [eax + 1]
push ecx
call dword [sym.imp.USER32.dll_IsCharAlphaNumericA]
test eax, eax
jne 0x40c43e
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
mov byte [edx], 0x5f
mov dword [ebp - 0x4fc], 0
jmp 0x40c295
push 0
lea eax, [ebp - 0x60]
push eax
mov ecx, dword [ebp - 0x64]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [ebp - 0x60]
push ecx
push 2
push 0x41147c
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x60]
push eax
push 0
push 0
push 0
mov ecx, dword [ebp - 0x488]
push ecx
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x40c509
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x500], edx
cmp dword [ebp - 0x60], 0
jne 0x40c4a7
jmp 0x40c509
cmp dword [ebp - 0x500], 0x400
jle 0x40c4bd
mov dword [ebp - 0x500], 0x400
push 0
lea eax, [ebp - 0x60]
push eax
mov ecx, dword [ebp - 0x500]
push ecx
lea edx, [ebp - 0x478]
push edx
mov eax, dword [ebp - 0x488]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x60], 0
je 0x40c504
push 0
lea ecx, [ebp - 0x60]
push ecx
mov edx, dword [ebp - 0x60]
push edx
lea eax, [ebp - 0x478]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40c479
mov ecx, dword [ebp - 0x64]
push ecx
call dword [sym.imp.USER32.dll_CharLowerA]
push 0x22
mov edx, dword [ebp - 0x64]
push edx
call dword [sym.imp.SHLWAPI.dll_StrChrA]
mov dword [ebp - 0x4f8], eax
push 0x23
mov eax, dword [ebp - 0x64]
push eax
call dword [sym.imp.SHLWAPI.dll_StrChrA]
mov dword [ebp - 0x4f4], eax
push str.read_host
mov ecx, dword [ebp - 0x64]
push ecx
call dword [sym.imp.SHLWAPI.dll_StrStrA]
mov dword [ebp - 0x4f0], eax
mov edx, 1
test edx, edx
je 0x40c5e2
cmp dword [ebp - 0x4f0], 0
jne 0x40c564
jmp 0x40c5e2
cmp dword [ebp - 0x4f8], 0
je 0x40c57d
mov eax, dword [ebp - 0x4f0]
cmp eax, dword [ebp - 0x4f8]
jbe 0x40c57d
jmp 0x40c5e2
cmp dword [ebp - 0x4f4], 0
je 0x40c596
mov ecx, dword [ebp - 0x4f0]
cmp ecx, dword [ebp - 0x4f4]
jbe 0x40c596
jmp 0x40c5e2
push 0
lea edx, [ebp - 0x60]
push edx
push 0x400
lea eax, [ebp - 0x478]
push eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x60], 0
je 0x40c5db
push 0
lea ecx, [ebp - 0x60]
push ecx
mov edx, dword [ebp - 0x60]
push edx
lea eax, [ebp - 0x478]
push eax
mov ecx, dword [ebp - 0x4a0]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40c5e2
push str.clear_host
mov edx, dword [ebp - 0x64]
push edx
call dword [sym.imp.SHLWAPI.dll_StrStrA]
mov dword [ebp - 0x4f0], eax
mov eax, 1
test eax, eax
je 0x40c6d2
cmp dword [ebp - 0x4f0], 0
jne 0x40c612
jmp 0x40c6d2
cmp dword [ebp - 0x4f8], 0
je 0x40c62e
mov ecx, dword [ebp - 0x4f0]
cmp ecx, dword [ebp - 0x4f8]
jbe 0x40c62e
jmp 0x40c6d2
cmp dword [ebp - 0x4f4], 0
je 0x40c64a
mov edx, dword [ebp - 0x4f0]
cmp edx, dword [ebp - 0x4f4]
jbe 0x40c64a
jmp 0x40c6d2
mov dword [ebp - 0x508], 0
xor eax, eax
mov word [ebp - 0x504], ax
xor ecx, ecx
mov word [ebp - 0x502], cx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 0x50c], eax
lea edx, [ebp - 0x524]
push edx
mov eax, dword [ebp - 0x50c]
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
lea ecx, [ebp - 0x508]
push ecx
mov edx, dword [ebp - 0x504]
push edx
movsx eax, word [ebp - 0x524]
movsx ecx, word [ebp - 0x522]
imul eax, ecx
push eax
push 0x20
mov edx, dword [ebp - 0x50c]
push edx
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterA]
mov eax, dword [ebp - 0x504]
push eax
mov ecx, dword [ebp - 0x50c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
jmp 0x40c6d2
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
mov al, byte [ebp - 0x48d]
mov byte [edx], al
movsx ecx, byte [ebp - 0x48d]
test ecx, ecx
jne 0x40c6ed
jmp 0x40c6ff
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x64]
lea ecx, [eax + edx + 1]
mov dword [ebp - 0x64], ecx
jmp 0x40c202
push 0
lea edx, [ebp - 0x60]
push edx
push 2
push 0x411498
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [ebp - 0x60]
push ecx
push 4
push str.exit
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x60]
push eax
push 2
push 0x4114a4
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0xffffffffffffffff
mov edx, dword [ebp - 0x74]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0
lea eax, [ebp - 0x60]
push eax
push 0
push 0
push 0
mov ecx, dword [ebp - 0x488]
push ecx
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x40c7e0
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x528], edx
cmp dword [ebp - 0x60], 0
jne 0x40c77e
jmp 0x40c7e0
cmp dword [ebp - 0x528], 0x400
jle 0x40c794
mov dword [ebp - 0x528], 0x400
push 0
lea eax, [ebp - 0x60]
push eax
mov ecx, dword [ebp - 0x528]
push ecx
lea edx, [ebp - 0x478]
push edx
mov eax, dword [ebp - 0x488]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x60], 0
je 0x40c7db
push 0
lea ecx, [ebp - 0x60]
push ecx
mov edx, dword [ebp - 0x60]
push edx
lea eax, [ebp - 0x478]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40c750
mov ecx, dword [ebp - 0x5c]
push ecx
push 0
mov edx, dword [0x416870]
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp - 0x488]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x4a0]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x70]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x74]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov esp, ebp
pop ebp
ret