Results 1 to 2 of 2

Thread: Compileing metsvc.cpp

  1. #1
    Member cr1spyj0nes's Avatar
    Join Date
    Sep 2008
    Posts
    164

    Default Compileing metsvc.cpp

    hey im trying to compile metsvc.cpp with gcc and i get this error output
    gcc metsvc.cpp
    metsvc.cpp:33:21: error: windows.h: No such file or directory
    metsvc.cpp:41: error: ‘SERVICE_STATUS’ does not name a type
    metsvc.cpp:42: error: ‘SERVICE_STATUS_HANDLE’ does not name a type
    metsvc.cpp: In function ‘int start_meterpreter()’:
    metsvc.cpp:50: error: ‘SOCKET’ was not declared in this scope
    metsvc.cpp:50: error: expected `;' before ‘sock’
    metsvc.cpp:51: error: ‘DWORD’ was not declared in this scope
    metsvc.cpp:51: error: expected `;' before ‘err’
    metsvc.cpp:55: error: ‘MAX_PATH’ was not declared in this scope
    metsvc.cpp:58: error: ‘path’ was not declared in this scope
    metsvc.cpp:58: error: ‘GetModuleFileName’ was not declared in this scope
    metsvc.cpp:59: error: ‘err’ was not declared in this scope
    metsvc.cpp:59: error: ‘GetLastError’ was not declared in this scope
    metsvc.cpp:64: error: ‘path’ was not declared in this scope
    metsvc.cpp:65: error: ‘err’ was not declared in this scope
    metsvc.cpp:74: error: ‘path’ was not declared in this scope
    metsvc.cpp:75: error: ‘err’ was not declared in this scope
    metsvc.cpp:80: error: ‘path’ was not declared in this scope
    metsvc.cpp:85: error: ‘WSADATA’ was not declared in this scope
    metsvc.cpp:85: error: expected `;' before ‘wsa_data’
    metsvc.cpp:87: error: ‘err’ was not declared in this scope
    metsvc.cpp:87: error: ‘MAKEWORD’ was not declared in this scope
    metsvc.cpp:87: error: ‘wsa_data’ was not declared in this scope
    metsvc.cpp:87: error: ‘WSAStartup’ was not declared in this scope
    metsvc.cpp:95: error: ‘sock’ was not declared in this scope
    metsvc.cpp:95: error: ‘AF_INET’ was not declared in this scope
    metsvc.cpp:95: error: ‘SOCK_STREAM’ was not declared in this scope
    metsvc.cpp:95: error: ‘IPPROTO_TCP’ was not declared in this scope
    metsvc.cpp:95: error: ‘socket’ was not declared in this scope
    metsvc.cpp:95: error: ‘INVALID_SOCKET’ was not declared in this scope
    metsvc.cpp:96: error: ‘WSAGetLastError’ was not declared in this scope
    metsvc.cpp:103: error: aggregate ‘sockaddr_in sockaddr’ has incomplete type and cannot be defined
    metsvc.cpp:105: error: ‘AF_INET’ was not declared in this scope
    metsvc.cpp:106: error: ‘htons’ was not declared in this scope
    metsvc.cpp:107: error: ‘INADDR_ANY’ was not declared in this scope
    metsvc.cpp:109: error: ‘sock’ was not declared in this scope
    metsvc.cpp:109: error: expected primary-expression before ‘struct’
    metsvc.cpp:109: error: expected `)' before ‘struct’
    metsvc.cpp:123: error: expected `)' before ‘;’ token
    metsvc.cpp:128: error: ‘TRUE’ was not declared in this scope
    metsvc.cpp:130: error: expected `;' before ‘conn’
    metsvc.cpp:131: error: aggregate ‘sockaddr_in peer’ has incomplete type and cannot be defined
    metsvc.cpp:134: error: ‘conn’ was not declared in this scope
    metsvc.cpp:134: error: ‘sock’ was not declared in this scope
    metsvc.cpp:134: error: ‘accept’ was not declared in this scope
    metsvc.cpp:134: error: ‘INVALID_SOCKET’ was not declared in this scope
    metsvc.cpp:135: error: ‘WSAGetLastError’ was not declared in this scope
    metsvc.cpp:135: error: ‘WSAECONNRESET’ was not declared in this scope
    metsvc.cpp:142: error: ‘inet_ntoa’ was not declared in this scope
    metsvc.cpp:148: error: ‘cmd’ was not declared in this scope
    metsvc.cpp:148: error: ‘conn’ was not declared in this scope
    metsvc.cpp:148: error: ‘_snprintf’ was not declared in this scope
    metsvc.cpp:158: error: ‘STARTUPINFO’ was not declared in this scope
    metsvc.cpp:158: error: expected `;' before ‘startup_info’
    metsvc.cpp:159: error: ‘PROCESS_INFORMATION’ was not declared in this scope
    metsvc.cpp:159: error: expected `;' before ‘process_information’
    metsvc.cpp:161: error: ‘startup_info’ was not declared in this scope
    metsvc.cpp:161: error: ‘ZeroMemory’ was not declared in this scope
    metsvc.cpp:164: error: ‘process_information’ was not declared in this scope
    metsvc.cpp:166: error: ‘CREATE_NO_WINDOW’ was not declared in this scope
    metsvc.cpp:167: error: ‘CreateProcess’ was not declared in this scope
    metsvc.cpp:169: error: ‘GetLastError’ was not declared in this scope
    metsvc.cpp:176: error: ‘closesocket’ was not declared in this scope
    metsvc.cpp:183: error: ‘sock’ was not declared in this scope
    metsvc.cpp:183: error: ‘INVALID_SOCKET’ was not declared in this scope
    metsvc.cpp:184: error: ‘closesocket’ was not declared in this scope
    metsvc.cpp: At global scope:
    metsvc.cpp:194: error: ‘VOID’ does not name a type
    metsvc.cpp:219: error: ‘VOID’ does not name a type
    metsvc.cpp:267: error: ‘BOOL’ does not name a type
    metsvc.cpp:363: error: ‘BOOL’ does not name a type
    metsvc.cpp: In function ‘void start_service()’:
    metsvc.cpp:436: error: ‘SERVICE_TABLE_ENTRY’ was not declared in this scope
    metsvc.cpp:436: error: expected `;' before ‘ServiceTable’
    metsvc.cpp:486: error: expected `}' at end of input
    I would rather be hated for what i am,
    Then loved for what i am not.

  2. #2
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    I haven't got a clue what "metsvc.cpp" is, but I see two problems in what you're doing:

    1) The file is ".cpp", so you should be using a C++ compiler (as opposed to a C compiler)

    2) It looks like an MS Windows program, but you're running Linux, which does not have a port of the Microsoft Win32 API, meaning you're not gonna have the windows.h header file.

    Either find some way of cross-compiling (i.e. using Linux to compile a Windows program), or open up Windows in VMWare, or use wine with a Windows version of G++ to compile it.
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •