Function at 0x40bba0
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 0x40bc6a
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 0x40c5d3
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 0x40bcc1
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 0x40c5d3
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.0040f260
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 0x40bd85
cmp dword [ebp - 4], 0x80000000
jb 0x40bd7a
xor edx, edx
mov word [ebp - 0x28], dx
jmp 0x40bd85
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 0x40bdf8
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 0x40c5d3
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 0x40bfac
lea ecx, [ebp - 0x4d8]
call fcn.004106d0
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 0x40be58
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0x4dc]
jge 0x40bfa1
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 0x40bede
push 0
lea edx, [ebp - 0x60]
push edx
push 1
push 0x411434
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 0x40bf78
push 0
lea ecx, [ebp - 0x60]
push ecx
push 1
push 0x411438
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 0x41143c
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 0x40be4f
lea ecx, [ebp - 0x4d8]
call fcn.00407730
mov eax, dword [ebp + 8]
mov dword [ebp - 0x64], eax
mov ecx, 1
test ecx, ecx
je 0x40c4af
mov edx, dword [ebp - 0x64]
movsx eax, byte [edx]
test eax, eax
jne 0x40bfce
jmp 0x40c4af
mov dword [ebp - 0x10], 0
jmp 0x40bfe0
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 0x40c011
movsx edx, byte [ebp - 0x48d]
cmp edx, 0xd
je 0x40c011
movsx eax, byte [ebp - 0x48d]
cmp eax, 0xa
jne 0x40c013
jmp 0x40c015
jmp 0x40bfd7
cmp dword [ebp - 0x10], 0
jne 0x40c026
mov ecx, dword [ebp - 0x64]
add ecx, 1
mov dword [ebp - 0x64], ecx
jmp 0x40bfb2
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 0x40c054
mov eax, dword [ebp - 0x498]
add eax, 1
mov dword [ebp - 0x498], eax
mov ecx, dword [ebp - 0x498]
cmp ecx, dword [ebp - 0x10]
jge 0x40c1f3
mov edx, dword [ebp - 0x4fc]
mov dword [ebp - 0x52c], edx
cmp dword [ebp - 0x52c], 4
ja case.default.0x40c082
mov eax, dword [ebp - 0x52c]
jmp dword [eax*4 + 0x40c5d8]
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x24
jne 0x40c0ab
mov eax, dword [ebp - 0x4fc]
add eax, 1
mov dword [ebp - 0x4fc], eax
jmp 0x40c0b5
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c082
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x61
je 0x40c0dc
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x41
jne 0x40c0ed
mov edx, dword [ebp - 0x4fc]
add edx, 1
mov dword [ebp - 0x4fc], edx
jmp 0x40c0f7
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c082
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x72
je 0x40c11e
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
movsx eax, byte [edx]
cmp eax, 0x52
jne 0x40c12f
mov ecx, dword [ebp - 0x4fc]
add ecx, 1
mov dword [ebp - 0x4fc], ecx
jmp 0x40c139
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c082
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
movsx eax, byte [edx]
cmp eax, 0x67
je 0x40c15d
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x47
jne 0x40c16e
mov eax, dword [ebp - 0x4fc]
add eax, 1
mov dword [ebp - 0x4fc], eax
jmp 0x40c178
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c082
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x73
je 0x40c19c
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x53
jne 0x40c1ad
mov edx, dword [ebp - 0x4fc]
add edx, 1
mov dword [ebp - 0x4fc], edx
jmp case.default.0x40c082
mov dword [ebp - 0x4fc], 0
cmp dword [ebp - 0x4fc], 5
jne 0x40c1ee
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 0x40c1ee
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
mov byte [edx], 0x5f
mov dword [ebp - 0x4fc], 0
jmp 0x40c045
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 0x411440
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 0x40c2b9
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x500], edx
cmp dword [ebp - 0x60], 0
jne 0x40c257
jmp 0x40c2b9
cmp dword [ebp - 0x500], 0x400
jle 0x40c26d
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 0x40c2b4
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 0x40c229
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 0x40c392
cmp dword [ebp - 0x4f0], 0
jne 0x40c314
jmp 0x40c392
cmp dword [ebp - 0x4f8], 0
je 0x40c32d
mov eax, dword [ebp - 0x4f0]
cmp eax, dword [ebp - 0x4f8]
jbe 0x40c32d
jmp 0x40c392
cmp dword [ebp - 0x4f4], 0
je 0x40c346
mov ecx, dword [ebp - 0x4f0]
cmp ecx, dword [ebp - 0x4f4]
jbe 0x40c346
jmp 0x40c392
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 0x40c38b
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 0x40c392
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 0x40c482
cmp dword [ebp - 0x4f0], 0
jne 0x40c3c2
jmp 0x40c482
cmp dword [ebp - 0x4f8], 0
je 0x40c3de
mov ecx, dword [ebp - 0x4f0]
cmp ecx, dword [ebp - 0x4f8]
jbe 0x40c3de
jmp 0x40c482
cmp dword [ebp - 0x4f4], 0
je 0x40c3fa
mov edx, dword [ebp - 0x4f0]
cmp edx, dword [ebp - 0x4f4]
jbe 0x40c3fa
jmp 0x40c482
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 0x40c482
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 0x40c49d
jmp 0x40c4af
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x64]
lea ecx, [eax + edx + 1]
mov dword [ebp - 0x64], ecx
jmp 0x40bfb2
push 0
lea edx, [ebp - 0x60]
push edx
push 2
push 0x41145c
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 0x411468
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 0x40c590
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x528], edx
cmp dword [ebp - 0x60], 0
jne 0x40c52e
jmp 0x40c590
cmp dword [ebp - 0x528], 0x400
jle 0x40c544
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 0x40c58b
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 0x40c500
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