Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <stdio.h>
- #include <curl/curl.h>
- #include <sys/stat.h>
- size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
- {
- size_t written;
- written = fwrite(ptr, size, nmemb, stream);
- return written;
- }
- int main (void)
- {
- if ((_access("hl.exe", 0)) != 0)
- {
- printf("hl.exe file does not exist, paste fserverbrowser.exe in the folder of Counter-Strike. \n");
- getchar();
- return 0;
- }
- FILE *fp;
- CURL *curl;
- CURLcode res;
- char patch[1028];
- char country[5];
- char patch_full[1028];
- char url[70];
- GetCurrentDirectory(sizeof(patch), patch);
- sprintf(patch_full, "%s/config.ini", patch);
- GetPrivateProfileString("Server", "country", "ve", country, sizeof(country), patch_full);
- sprintf(url, "http://guzzanno.co.cc/CServer/new_server.php?country=%s", country);
- curl = curl_easy_init();
- printf("h00k.ve Dev Team\nCountry: %s Loading... please wait...", country);
- if (curl)
- {
- fp = fopen("platform/config/ServerBrowser.vdf", "wb");
- curl_easy_setopt(curl, CURLOPT_URL, url);
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
- res = curl_easy_perform(curl);
- curl_easy_cleanup(curl);
- ShellExecuteA(NULL, "open", "hl.exe", "-game cstrike", NULL, SW_SHOW);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement