-
Notifications
You must be signed in to change notification settings - Fork 0
/
httpget.cpp
55 lines (50 loc) · 1.86 KB
/
httpget.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
static int httpget(DWORD getdeeznuts)//fixed
{
string url = r_lua_tostring(-1, getdeeznuts);//need tostring or tolstring for this
string dwn = DownloadURL(url);//let it download
Sleep(0x50);//dont know
Execute(dwn + "\n\nprint'support clxyify by crediting him u skid'");//download url (replace Execute() with your exec function)
url = "";//clear the url queue (we dont even need it)
return getdeeznuts;//i hate to return nuts
}
//if any error on the Execute() code just put Execute(dwn); and their ya go
//TODO: register httpget() inside of lua enviroment
//main url functions (DONT TOUCH)!
#include <Windows.h>
#include <string>
#include <WinInet.h>
#pragma comment(lib,"ws2_32.lib")
#pragma comment(lib, "wininet.lib")
std::string replaceAll(std::string subject, const std::string& search,
const std::string& replace) {
size_t pos = 0;//dont use NULL becuz homo
while ((pos = subject.find(search, pos)) != std::string::npos) {
subject.replace(pos, search.length(), replace);//replace
pos += replace.length();
}
return subject;
}
std::string DownloadURL(const char* URL) {//URL downloader (similar to DownloadString)
HINTERNET interwebs = InternetOpenA("Mozilla/5.0", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL);//cmon this is homo
HINTERNET urlFile;
std::string rtn;
if (interwebs) {//if
urlFile = InternetOpenUrlA(interwebs, URL, NULL, NULL, NULL, NULL);//open
if (urlFile) {
char buffer[2000];//buff deez nuts
DWORD bytesRead;
do {//do
InternetReadFile(urlFile, buffer, 2000, &bytesRead);//read
rtn.append(buffer, bytesRead);
memset(buffer, 0, 2000);//cop
} while (bytesRead);
InternetCloseHandle(interwebs);
InternetCloseHandle(urlFile);
std::string p = replaceAll(rtn, "|n", "\r\n");
return p;//return
}
}
InternetCloseHandle(interwebs);
std::string p = replaceAll(rtn, "|n", "\r\n");//ik spliting is gay
return p;
}