Function at 0x40bda0
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 0x40be6a
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 0x40c7d3
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 0x40bec1
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 0x40c7d3
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.0040f4e0
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 0x40bf85
cmp dword [ebp - 4], 0x80000000
jb 0x40bf7a
xor edx, edx
mov word [ebp - 0x28], dx
jmp 0x40bf85
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 0x40bff8
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 0x40c7d3
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 0x40c1ac
lea ecx, [ebp - 0x4d8]
call fcn.00410950
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 0x40c058
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0x4dc]
jge 0x40c1a1
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 0x40c0de
push 0
lea edx, [ebp - 0x60]
push edx
push 1
push 0x411468
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 0x40c178
push 0
lea ecx, [ebp - 0x60]
push ecx
push 1
push 0x41146c
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 0x411470
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 0x40c04f
lea ecx, [ebp - 0x4d8]
call fcn.00407730
mov eax, dword [ebp + 8]
mov dword [ebp - 0x64], eax
mov ecx, 1
test ecx, ecx
je 0x40c6af
mov edx, dword [ebp - 0x64]
movsx eax, byte [edx]
test eax, eax
jne 0x40c1ce
jmp 0x40c6af
mov dword [ebp - 0x10], 0
jmp 0x40c1e0
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 0x40c211
movsx edx, byte [ebp - 0x48d]
cmp edx, 0xd
je 0x40c211
movsx eax, byte [ebp - 0x48d]
cmp eax, 0xa
jne 0x40c213
jmp 0x40c215
jmp 0x40c1d7
cmp dword [ebp - 0x10], 0
jne 0x40c226
mov ecx, dword [ebp - 0x64]
add ecx, 1
mov dword [ebp - 0x64], ecx
jmp 0x40c1b2
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 0x40c254
mov eax, dword [ebp - 0x498]
add eax, 1
mov dword [ebp - 0x498], eax
mov ecx, dword [ebp - 0x498]
cmp ecx, dword [ebp - 0x10]
jge 0x40c3f3
mov edx, dword [ebp - 0x4fc]
mov dword [ebp - 0x52c], edx
cmp dword [ebp - 0x52c], 4
ja case.default.0x40c282
mov eax, dword [ebp - 0x52c]
jmp dword [eax*4 + 0x40c7d8]
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x24
jne 0x40c2ab
mov eax, dword [ebp - 0x4fc]
add eax, 1
mov dword [ebp - 0x4fc], eax
jmp 0x40c2b5
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c282
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x61
je 0x40c2dc
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x41
jne 0x40c2ed
mov edx, dword [ebp - 0x4fc]
add edx, 1
mov dword [ebp - 0x4fc], edx
jmp 0x40c2f7
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c282
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x72
je 0x40c31e
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
movsx eax, byte [edx]
cmp eax, 0x52
jne 0x40c32f
mov ecx, dword [ebp - 0x4fc]
add ecx, 1
mov dword [ebp - 0x4fc], ecx
jmp 0x40c339
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c282
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
movsx eax, byte [edx]
cmp eax, 0x67
je 0x40c35d
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x47
jne 0x40c36e
mov eax, dword [ebp - 0x4fc]
add eax, 1
mov dword [ebp - 0x4fc], eax
jmp 0x40c378
mov dword [ebp - 0x4fc], 0
jmp case.default.0x40c282
mov ecx, dword [ebp - 0x64]
add ecx, dword [ebp - 0x498]
movsx edx, byte [ecx]
cmp edx, 0x73
je 0x40c39c
mov eax, dword [ebp - 0x64]
add eax, dword [ebp - 0x498]
movsx ecx, byte [eax]
cmp ecx, 0x53
jne 0x40c3ad
mov edx, dword [ebp - 0x4fc]
add edx, 1
mov dword [ebp - 0x4fc], edx
jmp case.default.0x40c282
mov dword [ebp - 0x4fc], 0
cmp dword [ebp - 0x4fc], 5
jne 0x40c3ee
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 0x40c3ee
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x498]
mov byte [edx], 0x5f
mov dword [ebp - 0x4fc], 0
jmp 0x40c245
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 0x411474
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 0x40c4b9
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x500], edx
cmp dword [ebp - 0x60], 0
jne 0x40c457
jmp 0x40c4b9
cmp dword [ebp - 0x500], 0x400
jle 0x40c46d
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 0x40c4b4
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 0x40c429
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 0x40c592
cmp dword [ebp - 0x4f0], 0
jne 0x40c514
jmp 0x40c592
cmp dword [ebp - 0x4f8], 0
je 0x40c52d
mov eax, dword [ebp - 0x4f0]
cmp eax, dword [ebp - 0x4f8]
jbe 0x40c52d
jmp 0x40c592
cmp dword [ebp - 0x4f4], 0
je 0x40c546
mov ecx, dword [ebp - 0x4f0]
cmp ecx, dword [ebp - 0x4f4]
jbe 0x40c546
jmp 0x40c592
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 0x40c58b
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 0x40c592
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 0x40c682
cmp dword [ebp - 0x4f0], 0
jne 0x40c5c2
jmp 0x40c682
cmp dword [ebp - 0x4f8], 0
je 0x40c5de
mov ecx, dword [ebp - 0x4f0]
cmp ecx, dword [ebp - 0x4f8]
jbe 0x40c5de
jmp 0x40c682
cmp dword [ebp - 0x4f4], 0
je 0x40c5fa
mov edx, dword [ebp - 0x4f0]
cmp edx, dword [ebp - 0x4f4]
jbe 0x40c5fa
jmp 0x40c682
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 0x40c682
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 0x40c69d
jmp 0x40c6af
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x64]
lea ecx, [eax + edx + 1]
mov dword [ebp - 0x64], ecx
jmp 0x40c1b2
push 0
lea edx, [ebp - 0x60]
push edx
push 2
push 0x411490
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 0x41149c
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 0x40c790
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x528], edx
cmp dword [ebp - 0x60], 0
jne 0x40c72e
jmp 0x40c790
cmp dword [ebp - 0x528], 0x400
jle 0x40c744
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 0x40c78b
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 0x40c700
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