-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathwinwebcheck.cpp
64 lines (58 loc) · 1.79 KB
/
winwebcheck.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include <Windows.h>
#include <WinINet.h>
#include <IOStream>
#include <String>
#pragma comment(lib, "WinINet.lib")
std::string replaceAll(std::string subject, const std::string& search,
const std::string& replace) {
size_t pos = 0;
while ((pos = subject.find(search, pos)) != std::string::npos) {
subject.replace(pos, search.length(), replace);
pos += replace.length();
};
return subject;
};
std::string DownloadURL(std::string URL) {
HINTERNET interwebs = InternetOpenA("Mozilla/5.0", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL);
HINTERNET urlFile;
std::string rtn;
if (interwebs) {
urlFile = InternetOpenUrlA(interwebs, URL.c_str(), NULL, NULL, NULL, NULL);
if (urlFile) {
char buffer[2000];
DWORD bytesRead;
do {
InternetReadFile(urlFile, buffer, 2000, &bytesRead);
rtn.append(buffer, bytesRead);
memset(buffer, 0, 2000);
} while (bytesRead);
InternetCloseHandle(interwebs);
InternetCloseHandle(urlFile);
std::string p = replaceAll(rtn, "|n", "\r\n");
return p;
};
};
InternetCloseHandle(interwebs);
std::string p = replaceAll(rtn, "|n", "\r\n");
return p;
};
std::string keychecker() {
std::string key;
std::cout << "Enter Key: ";
std::cin >> key;
return key;
};
void auth() {
std::string hostfile = ""; //Hwid check site [Pastebin etc.]
std::string hot = keychecker();
std::string result = DownloadURL(hostfile += hot);
if (result == "1") {
std::cout << "Whitelisted Key: " + hot, +"\n"; //Success message.
}
else {
std::cout << "Key Not Found\n" << hot.c_str();
Sleep(10000);
exit(10);
};
};