Хотел бы найти софт, способный обнаружить вебхук дискорд серверов
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <regex>
bool isWebhook(const std::string& str) {
std::regex regex("(https?://)?(www\\.)?(discord\\.(gg|com)/webhooks/)[a-zA-Z0-9-]+/[a -zA-Z0-9-_]+");
return std::regex_search(str, regex);
}
void searchWebhooksInFile(const std::string& filename) {
std::ifstream file(filename);
if (!file.is_open()) {
std::cerr << "Error: Unable to open file " << filename << std::endl;
return;
}
std::string line;
std::vector<std::string> webhooks;
while (std::getline(file, line)) {
if (isWebhook(line)) {
webhooks.push_back(line);
}
}
file.close();
if (!webhooks.empty()) {
std::cout << "Webhooks detected in file " << filename << ":" << std::endl;
for (const auto& webhook : webhooks) {
std::cout << webhook << std::endl;
}
} else {
std::cout << "No webhooks found in file " << filename << std::endl;
}
}
int main() {
std::string filename;
std::cout << "Enter the filename: ";
std::cin >> filename;
searchWebhooksInFile(filename);
return 0;
}
Hint is given apply it according to your needs. Compile the source.How does it work?
ThanksHint is given apply it according to your needs. Compile the source.