#include <fstream> #include <vector> #include <iostream> #include <stdlib.h> #include…
- User
#include #include #include #include <stdlib.h> #include #include #include <Windows.h> #include using namespace std;
void openW(string url) { // import string url then pass command in prompt window to start chrome string command = "start chrome.exe " + url; system(command.c_str());
}
void openWM(string url) { string command3 = "start /min chrome.exe " + url; system(command3.c_str()); }
void startVid() { this_thread::sleep_for(std::chrono::seconds(2)); INPUT input[2]; input[0].type = INPUT_KEYBOARD; input[0].ki.wVk = VK_SPACE; input[0].ki.dwFlags = 0; input[1].type = INPUT_KEYBOARD; input[1].ki.wVk = VK_SPACE; input[1].ki.dwFlags = KEYEVENTF_KEYUP; SendInput(2, input, sizeof(INPUT)); }
void closeW() { // pass command to prompt to kill chrome system("taskkill /F /IM chrome.exe"); }
int main() {
string url, ipPath; int min, max, loop; char startV, shortW; cout << "Rentre le lien face de cul " << endl; cin >> url; cout << "Rentre le temps minimum " << endl; cin >> min; cout << "Rentre le temps maximum " << endl; cin >> max; cout << "From " << min << " to " << max << " selected." << endl; cout << "Sont ou tes ip le cave? " << endl; cin >> ipPath; cout << "Combien de vue tu veut?" << endl; cin >> loop; cout << "Fait juste faire oui? " << endl << endl << "Note that this will send the keyStroke (SPACE BAR) to the window to start the video" << endl << " y/n "; cin >> startV; cout << "Vx tu voir la fenetre ou pas ? si tu vx pas la voir fait oui " << endl << endl << "Note that this may only work if the window is not minimized." << endl << " y/n "; cin >> shortW; cout << endl << endl; vector<string> IPs; ifstream file(ipPath); if (file.is_open()) { string ip; while (getline(file, ip)) { IPs.push_back(ip); } file.close(); } else { cout << "Unable to open file at specified path." << endl; return 0; } for (int i = 0; i < loop; i++) { if (IPs.empty()) { cout << "No more IPs" << endl; break; } string newIP = IPs.back(); IPs.pop_back(); // this will change the internet settings interface used ip from list mask gateway ---- You can chage whatever you want here string command = "netsh interface ipv4 set address name=\"Interface Area Connection\" source=static " + newIP + " 255.255.255.0 192.168.1.1"; system(command.c_str()); // just remember line 92 is to reset your settings back to original, be sure to run program all the way through or you will have to manually reset if (startV == 'y') { // your internet settings, if you have to manually reset use commands in line 92 to do so startVid(); } if (shortW == 'y') { openWM(url); int random = rand() % (max - min + 1) + min; std::this_thread::sleep_for(std::chrono::seconds(random)); closeW(); } if(shortW == 'n') { openW(url); int random = rand() % (max - min + 1) + min; std::this_thread::sleep_for(std::chrono::seconds(random)); closeW(); } } // resets your original settings place original interface original IP, Mask Gateway string command2 = "netsh interface ipv4 set address name=\"Interface Area Connection\" source=static 'Original IP' 255.255.255.0 192.168.1.1"; system(command2.c_str()); // if you were using DHCP and want that back on use command "netsh interface ipv4 set address name=\"Local Area Connection\" source=dhcp" return main(); - Assistant
To use address:port format instead of only the address when setting the IP address in the
netshcommand, you need to understand that thenetshcommand doesn't directly support specifying a port when setting an IP address because ports are generally associated with specific services or applications that run on the IP address, not with the IP configuration of the network interface itself.However, if your intention is to direct traffic from a specific port on your local system to a new IP address (typically used for forwarding or proxy purposes), you would not do this through the commands, which are meant for configuring IP addresses, subnets, and gateways for network interfaces.
- User
trying to use IP and port together in the ipPath file
- Assistant
- User
Give me a new code that do the same thing but use ip:port format insted of only ip
- Assistant
- User
'ab_channel' is not recognized as an internal or external command, operable program or batch file. ERROR: Invalid argument/option - '/'. Type "TASKKILL /?" for usage.
- Assistant
- User
'ab_channel' is not recognized as an internal or external command, operable program or batch file.
- Assistant
The error message
'ab_channel' is not recognized as an internal or external command, operable program or batch file.suggests that there is an issue with how a command line instruction is formatted, specifically when trying to use the function in C++. The part mentioning seems to indicate that the system is trying to execute something that is not intended to be a command. - User
using Leaf.xNet; using Youtube_Viewers.Helpers; using HttpRequest = Leaf.xNet.HttpRequest; using HttpResponse = Leaf.xNet.HttpResponse; giving me error
- Assistant
- User
- Assistant