Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.44 KB | None | 0 0
  1. #include <windows.h>
  2. #include <stdio.h>
  3. #include <curl/curl.h>
  4. #include <sys/stat.h>
  5.  
  6. size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
  7. {
  8.     size_t written;
  9.     written = fwrite(ptr, size, nmemb, stream);
  10.  
  11.     return written;
  12. }
  13.  
  14. int main (void)
  15. {
  16.     if ((_access("hl.exe", 0)) != 0)
  17.     {
  18.         printf("hl.exe file does not exist, paste fserverbrowser.exe in the folder of Counter-Strike. \n");
  19.         getchar();
  20.         return 0;
  21.     }
  22.  
  23.     FILE *fp;
  24.     CURL *curl;
  25.     CURLcode res;
  26.  
  27.     char patch[1028];
  28.     char country[5];
  29.     char patch_full[1028];
  30.     char url[70];
  31.  
  32.     GetCurrentDirectory(sizeof(patch), patch);
  33.     sprintf(patch_full, "%s/config.ini", patch);
  34.  
  35.     GetPrivateProfileString("Server", "country", "ve", country, sizeof(country), patch_full);
  36.     sprintf(url, "http://guzzanno.co.cc/CServer/new_server.php?country=%s", country);
  37.  
  38.     curl = curl_easy_init();
  39.  
  40.     printf("h00k.ve Dev Team\nCountry: %s Loading... please wait...", country);
  41.  
  42.     if (curl)
  43.     {
  44.         fp = fopen("platform/config/ServerBrowser.vdf", "wb");
  45.  
  46.         curl_easy_setopt(curl, CURLOPT_URL, url);
  47.         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
  48.         curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
  49.  
  50.         res = curl_easy_perform(curl);
  51.  
  52.         curl_easy_cleanup(curl);
  53.  
  54.         ShellExecuteA(NULL, "open", "hl.exe", "-game cstrike", NULL, SW_SHOW);
  55.     }
  56.  
  57.     return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement