Forum > Coding >

Auto-Update source code (C++)

Posts: 9

Threads: 2

Joined: Mar, 2018

Reputation: 0

Posted

Hello, 

the following script is written in C++ and is compatible with Visual Studios. Â 

std::string DownloadURL(const char* URL) {
VMProtectBeginMutation("Sea: DownloadURL");
HINTERNET interwebs = InternetOpenA("Mozilla/5.0", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL);
HINTERNET urlFile;
std::string rtn;
if (interwebs) {
urlFile = InternetOpenUrlA(interwebs, URL, 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;
}
}

Replace "InternetOpenUrlA" by "urlFile = InternetOpenUrlA(interwebs, URL, NULL, NULL, NULL, NULL);"
  • 0

Posts: 3

Threads: 1

Joined: Aug, 2018

Reputation: 0

Replied

nice but where do i put it?
  • 0

Posts: 9

Threads: 2

Joined: Mar, 2018

Reputation: 0

Replied

anywhere in your code.  It's in C++ so you could put it in your Functions header if you want, doesn't matter as long as you've got a site to download off of
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )