// File: /workspace/github_cpp_makefile_star2_O1/JohnWoodman[P]SHellNo/main.cpp
// Function: main
int main() 
{ 
	string buff;
	while(true){
		cout<<"ShellNo->";
		getline(cin,buff);
		// 49152-65535
		regex param("list -c ([1-5]?[0-9]?[0-9]?[0-9]?[0-9]|[6][0-5][0-5][0-3][0-5])");
		if(regex_match(buff,param)){
			smatch match;
			regex numb("[1-5]?[0-9]?[0-9]?[0-9]?[0-9]|[6][0-5][0-5][0-3][0-5]");
			regex_search(buff,match,numb);
			int port = stoi(match[0],nullptr,10);
			listManager->addListener(port);
			//t1.join();
		}
		if(regex_match(buff,regex("list -a"))){
			listManager->listListeners();
		}
		if(regex_match(buff,regex("list -l [1-9]?[1-9]"))){
			smatch match;
			regex numb("[1-9]?[1-9]");
			regex_search(buff,match,numb);
			int id = stoi(match[0],nullptr,10);
			postExploitMenu(listManager->getListener(id-1));
		}
		if (regex_match(buff, regex("exit"))) {
			break;
		}
		if(regex_match(buff, regex("help"))){
			printf("HELP MENU\n");
			printf("<========>\n");
			printf("list -c <port number>: listen on port\n");
			printf("list -a: list all listeners\n");
			printf("list -l <id>: connect to specific listener\n");
			printf("exit: exit ShellNo\n");
		}

	}

	return 0; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x80(%rbp), %r14
movq 0x194aa(%rip), %rbx     # 0x1efd8
leaq -0xd8(%rbp), %r15
leaq -0x50(%rbp), %r13
leaq -0xb8(%rbp), %r12
movl $0x9, %edx
movq 0x1945c(%rip), %rdi     # 0x1efa8
leaq 0x105a5(%rip), %rsi     # 0x160f8
callq 0x5400
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5350
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
callq 0x5680
movq %r15, %rdi
leaq 0x1057d(%rip), %rsi     # 0x16102
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r13, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x11ada
movl %eax, %ebx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5bca
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
testb %bl, %bl
je 0x5d25
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r12, %rdi
leaq 0x1055b(%rip), %rsi     # 0x16142
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x13c43
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq %rdx, %rax
subq %rcx, %rax
leaq -0x48(%rdx), %rsi
cmpq $0x48, %rax
movq %rcx, %rax
cmoveq %rsi, %rax
cmpq %rcx, %rdx
cmoveq %rsi, %rax
cmpb $0x1, 0x10(%rax)
jne 0x5c50
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x13ec6
jmp 0x5c66
movq %r14, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%rbp)
movq -0x90(%rbp), %r15
callq 0x5060
movq %rax, %r13
movl (%rax), %r14d
movl $0x0, (%rax)
movq %r15, %rdi
leaq -0x98(%rbp), %rsi
movl $0xa, %edx
callq 0x5510
cmpq %r15, -0x98(%rbp)
je 0x60bf
movq %rax, %rbx
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x60cb
movl (%r13), %eax
cmpl $0x22, %eax
je 0x60cb
testl %eax, %eax
leaq -0xd8(%rbp), %r15
jne 0x5cd7
movl %r14d, (%r13)
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %r14
cmpq %r14, %rdi
je 0x5cf3
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x5370
leaq 0x19afe(%rip), %rax     # 0x1f7f8
movq (%rax), %rdi
movl %ebx, %esi
callq 0x15398
leaq -0x50(%rbp), %r13
movq %r12, %rdi
callq 0x6226
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5d25
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
movq %r12, %rdi
leaq 0x10449(%rip), %rsi     # 0x16178
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x11ada
movl %eax, %ebx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5d74
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
movq %r12, %rdi
callq 0x6226
testb %bl, %bl
je 0x5d8f
leaq 0x19a71(%rip), %rax     # 0x1f7f8
movq (%rax), %rdi
callq 0x15456
movq %r12, %rdi
leaq 0x103e7(%rip), %rsi     # 0x16180
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x11ada
movl %eax, %ebx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5dde
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
movq %r12, %rdi
callq 0x6226
testb %bl, %bl
je 0x5f4b
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r12, %rdi
leaq 0x10385(%rip), %rsi     # 0x16188
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x13c43
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq %rdx, %rax
subq %rcx, %rax
leaq -0x48(%rdx), %rsi
cmpq $0x48, %rax
movq %rcx, %rax
cmoveq %rsi, %rax
cmpq %rcx, %rdx
cmoveq %rsi, %rax
cmpb $0x1, 0x10(%rax)
jne 0x5e6c
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x13ec6
jmp 0x5e82
movq %r14, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%rbp)
movq -0x90(%rbp), %r15
callq 0x5060
movq %rax, %r13
movl (%rax), %r14d
movl $0x0, (%rax)
movq %r15, %rdi
leaq -0x98(%rbp), %rsi
movl $0xa, %edx
callq 0x5510
cmpq %r15, -0x98(%rbp)
je 0x60a7
movq %rax, %rbx
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x60b3
movl (%r13), %eax
cmpl $0x22, %eax
je 0x60b3
testl %eax, %eax
leaq -0xd8(%rbp), %r15
jne 0x5ef3
movl %r14d, (%r13)
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %r14
cmpq %r14, %rdi
je 0x5f0f
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x5370
leaq 0x198e2(%rip), %rax     # 0x1f7f8
movq (%rax), %rdi
decl %ebx
movl %ebx, %esi
callq 0x1552e
leaq -0x50(%rbp), %r13
movq %rax, %rdi
callq 0x14f7c
movq %r12, %rdi
callq 0x6226
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5f4b
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
movq %r12, %rdi
leaq 0x1023f(%rip), %rsi     # 0x16194
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x11ada
movl %eax, %r13d
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5f9b
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
movq %r12, %rdi
callq 0x6226
testb %r13b, %r13b
jne 0x606e
movq %r12, %rdi
leaq 0x101e3(%rip), %rsi     # 0x16199
movl $0x10, %edx
callq 0x61ba
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
leaq -0x50(%rbp), %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x11ada
movl %eax, %ebx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5ffc
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
movq %r12, %rdi
callq 0x6226
testb %bl, %bl
je 0x6050
leaq 0x10a6e(%rip), %rdi     # 0x16a7d
callq 0x55a0
leaq 0x10a6c(%rip), %rdi     # 0x16a87
callq 0x55a0
leaq 0x10a6b(%rip), %rdi     # 0x16a92
callq 0x55a0
leaq 0x10a85(%rip), %rdi     # 0x16ab8
callq 0x55a0
leaq 0x10a95(%rip), %rdi     # 0x16ad4
callq 0x55a0
leaq 0x10ab4(%rip), %rdi     # 0x16aff
callq 0x55a0
movq %r15, %rdi
callq 0x6226
testb %r13b, %r13b
movq 0x18f76(%rip), %rbx     # 0x1efd8
leaq -0x50(%rbp), %r13
je 0x5b40
jmp 0x607a
leaq -0xd8(%rbp), %rdi
callq 0x6226
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6093
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x5370
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x100f0(%rip), %rdi     # 0x1619e
callq 0x5240
leaq 0x100e4(%rip), %rdi     # 0x1619e
callq 0x5560
leaq 0x100d8(%rip), %rdi     # 0x1619e
callq 0x5240
leaq 0x100cc(%rip), %rdi     # 0x1619e
callq 0x5560
jmp 0x60f3
jmp 0x60f3
jmp 0x60f3
jmp 0x6140
jmp 0x60f3
jmp 0x60f3
jmp 0x6140
jmp 0x6180
jmp 0x6180
jmp 0x615a
jmp 0x615a
movq %rax, %rbx
jmp 0x6130
jmp 0x6180
jmp 0x6195
jmp 0x6180
jmp 0x6106
movq %rax, %rbx
cmpl $0x0, (%r13)
jne 0x6114
movl %r14d, (%r13)
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x6130
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x5370
leaq -0xb8(%rbp), %rdi
callq 0x6226
jmp 0x6143
jmp 0x615a
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x6183
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
jmp 0x6183
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x6172
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x5370
leaq -0xb8(%rbp), %rdi
callq 0x6226
jmp 0x6183
movq %rax, %rbx
leaq -0x60(%rbp), %r14
leaq -0xd8(%rbp), %rdi
callq 0x6226
jmp 0x619c
movq %rax, %rbx
leaq -0x60(%rbp), %r14
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x61b1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x5370
movq %rbx, %rdi
callq 0x5630
nop