// File: /workspace/github_cpp_makefile_star2_O3/fuad00[P]wifitool/code.cpp
// Function: sniff_func()
bool sniff_func()	{
	for(int q = 0; q<=33; q++)	{  // При помощи данного цикла иммитируем полосу загрузки
		progress(3 * q);
		system("sleep 0.26");
	}
	progress(60);                      // Выводим строку прогресса
	cout << endl;                      // Каретка
	system("cat nets* | sed -n '/Station/q;p' | sed '/Last time seen/d' | awk -F',' '{print $14}' | awk '{$1=$1};1' | sed -r '/^\\s*$/d'"); // Считываем содержимое nets.csv-01.csv и выводим список сетей
	cout << "\n[?] Перепишите название вашей сети (регистр учитывается): ";
	getline(cin >> ws, target_name);   // Необычный способ считать данные (Название сети) с использованием getline. Источник:  

	progress(70);                      // Выводим строку прогресса

	string netname = "cat nets.csv-01.csv | sed -n '/Station/q;p' | sed '/Last time seen/d' | grep '" + target_name + "' | awk -F',' '{print $14}' > tmp/netname.txt";
	const char *netname_init = netname.c_str();

	string netbssid = "cat nets.csv-01.csv | sed -n '/Station/q;p' | sed '/Last time seen/d' | grep '" + target_name + "' | awk -F',' '{print $1}' > tmp/netbssid.txt";
	const char *netbssid_init = netbssid.c_str();

	string channel = "cat nets.csv-01.csv | sed -n '/Station/q;p' | sed '/Last time seen/d' | grep '" + target_name + "' | awk -F',' '{print $4}' > tmp/channel.txt";
	const char *channel_init = channel.c_str();


	system(netname_init);  // Считываем содержимое nets.csv-01.csv и выводим название выбранной сети.
	system(netbssid_init); // Считываем содержимое nets.csv-01.csv и выводим MAC-адрес выбранной сети.
	system(channel_init);  // Считываем содержимое nets.csv-01.csv и выводим канал выбранной сети.


	getline(ifstream("tmp/netname.txt"), target_name);           // Считываем содержимое файла по пути tmp/netname.txt
	getline(ifstream("tmp/netbssid.txt"), target_bssid);         // Считываем содержимое файла по пути tmp/netbssid.txt
	getline(ifstream("tmp/channel.txt"), target_channel_number); // Считываем содержимое файла по пути tmp/channel.txt

	cout << "\nВыбранная сеть: " << target_name << endl;
	cout << "MAC-адрес сети: " << target_bssid << endl;
	cout << "Канал сети: " << target_channel_number << endl;


	cout << "\n[+] Данные сохранены! Можно приступить к ловле хендшейка [4].\n" << endl;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
xorl %ebx, %ebx
leaq 0x25ab(%rip), %r14      # 0x570e
movl %ebx, %edi
callq 0x2bb3
movq %r14, %rdi
callq 0x20f0
addl $0x3, %ebx
cmpl $0x66, %ebx
jne 0x3163
movl $0x3c, %edi
callq 0x2bb3
movq 0x4e45(%rip), %rbx      # 0x7fd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
leaq 0x2560(%rip), %rdi      # 0x5719
callq 0x20f0
leaq 0x25d0(%rip), %rsi      # 0x5795
movl $0x68, %edx
movq %rbx, %rdi
callq 0x2150
movq 0x4e07(%rip), %rdi      # 0x7fe0
callq 0x20e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %edx
leaq 0x50a9(%rip), %r14      # 0x82a8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21f0
movl $0x46, %edi
callq 0x2bb3
leaq 0x25e3(%rip), %rsi      # 0x57fe
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x402f
leaq 0x261b(%rip), %rsi      # 0x584d
movq %rbx, %rdi
callq 0x2200
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3262
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x326a
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x70(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x329d
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x40(%rsp), %rbx
leaq 0x2555(%rip), %rsi      # 0x57fe
leaq 0x4ff8(%rip), %rdx      # 0x82a8
leaq 0x60(%rsp), %rdi
callq 0x402f
leaq 0x25ba(%rip), %rsi      # 0x587b
leaq 0x60(%rsp), %rdi
callq 0x2200
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x32f2
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x32fa
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x3329
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x20(%rsp), %r14
leaq 0x24c9(%rip), %rsi      # 0x57fe
leaq 0x4f6c(%rip), %rdx      # 0x82a8
leaq 0x60(%rsp), %rdi
callq 0x402f
leaq 0x255c(%rip), %rsi      # 0x58a9
leaq 0x60(%rsp), %rdi
callq 0x2200
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x337d
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x3384
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x33b3
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2140
movq (%rsp), %r15
movq %rbx, %rdi
callq 0x20f0
movq %r14, %rdi
callq 0x20f0
movq %r15, %rdi
callq 0x20f0
leaq 0x2495(%rip), %rsi      # 0x586b
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x21e0
movq 0x60(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %edx
leaq 0x4ea0(%rip), %rsi      # 0x82a8
leaq 0x60(%rsp), %rdi
callq 0x21f0
leaq 0x60(%rsp), %rdi
callq 0x2050
leaq 0x2475(%rip), %rsi      # 0x5898
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x21e0
movq 0x60(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %edx
leaq 0x4e13(%rip), %rsi      # 0x8268
leaq 0x60(%rsp), %rdi
callq 0x21f0
leaq 0x60(%rsp), %rdi
callq 0x2050
leaq 0x2456(%rip), %rsi      # 0x58c6
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x21e0
movq 0x60(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %edx
leaq 0x4d46(%rip), %rsi      # 0x81e8
leaq 0x60(%rsp), %rdi
callq 0x21f0
leaq 0x60(%rsp), %rdi
callq 0x2050
movq 0x4b13(%rip), %rdi      # 0x7fd0
leaq 0x2412(%rip), %rsi      # 0x58d6
movl $0x1e, %edx
callq 0x2150
movq 0x4dd3(%rip), %rsi      # 0x82a8
movq 0x4dd4(%rip), %rdx      # 0x82b0
movq 0x4aed(%rip), %rdi      # 0x7fd0
callq 0x2150
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x4ab7(%rip), %rdi      # 0x7fd0
leaq 0x23d5(%rip), %rsi      # 0x58f5
movl $0x19, %edx
callq 0x2150
movq 0x4d37(%rip), %rsi      # 0x8268
movq 0x4d38(%rip), %rdx      # 0x8270
movq 0x4a91(%rip), %rdi      # 0x7fd0
callq 0x2150
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x4a5b(%rip), %rdi      # 0x7fd0
leaq 0x2393(%rip), %rsi      # 0x590f
movl $0x15, %edx
callq 0x2150
movq 0x4c5b(%rip), %rsi      # 0x81e8
movq 0x4c5c(%rip), %rdx      # 0x81f0
movq 0x4a35(%rip), %rdi      # 0x7fd0
callq 0x2150
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x49ff(%rip), %rbx      # 0x7fd0
leaq 0x234d(%rip), %rsi      # 0x5925
movl $0x6c, %edx
movq %rbx, %rdi
callq 0x2150
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq 0x49cd(%rip), %rdi      # 0x7fd0
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x3626
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x363d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x3654
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2140
xorl %eax, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x36cb
jmp 0x36cb
jmp 0x36cb
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x36e4
movq 0x70(%rsp), %rsi
jmp 0x36dc
movq %rax, %rbx
jmp 0x36e4
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x36fb
movq 0x70(%rsp), %rsi
jmp 0x36f3
movq %rax, %rbx
jmp 0x36fb
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3712
movq 0x70(%rsp), %rsi
jmp 0x370a
jmp 0x36bc
jmp 0x36bc
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2050
jmp 0x36ce
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x36e4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x36fb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x3712
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21c0