Results 1 to 3 of 3

Thread: Help!! Compiler Troubles!!!

  1. #1
    Senior Member wolfman1984's Avatar
    Join Date
    Aug 2007
    Location
    fangtastic.org
    Posts
    191

    Help!! Compiler Troubles!!!

    Ok. For those of you cool cats playing the hax.tor.hu hacker challenge, some of you may recognize this code. For those of you who are past this challenge, you will probably laugh at how newbish this questions is going to be.

    The Wolfman needs your help trying to compile the following C program in windows:

    I have followed the instructions in the comments, more specifically this:
    Code:
    // To compile: cl.exe /DWIN32 /DHAVE_REMOTE crack-mssql.c /link wpcap.lib 
    wsock32.lib
    //You need a Windows C Compiler, I use MS Visual C++ Toolkit 2003
    //You must have Microsoft Platform SDK and WinPCap Libraries installed.
    When I compile, I receive the following errors:

    Code:
    C:\PROGRA~1\MIA4C6~1\bin>cl.exe /DWIN32 /DHAVE_REMOT crack-mssql.c /link wpcap.lib
    
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
    Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
    
    
    crack-mssql.c
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(1) : error C2059: syntax error : 'constant'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(38) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(39) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(41) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(42) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(42) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(43) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(44) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(46) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(48) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(50) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(51) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(52) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(53) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(53) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(56) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(59) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(59) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(60) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(74) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(75) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(78) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(79) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(84) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(85) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(86) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(88) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(91) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(92) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(99) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(101) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(109) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(110) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(110) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(113) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(114) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(116) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(118) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(119) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(120) : error C2041: illegal digit '9' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(120) : error C2059: syntax error : 'constant'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(120) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(121) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(122) : error C2041: illegal digit '8' for base '8'
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(122) : error C2014: preprocessor command must start as first nonwhite space
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(123) : error C2041: illegal digit '8' for base '8'
    crack-mssql.c(14) : error C2061: syntax error : identifier 'u_char'
    crack-mssql.c(15) : error C2059: syntax error : 'constant'
    crack-mssql.c(17) : error C2061: syntax error : identifier 'tlen'
    crack-mssql.c(17) : error C2059: syntax error : ';'
    crack-mssql.c(18) : error C2061: syntax error : identifier 'identification'
    crack-mssql.c(18) : error C2059: syntax error : ';'
    crack-mssql.c(19) : error C2061: syntax error : identifier 'flags_fo'
    crack-mssql.c(19) : error C2059: syntax error : ';'
    crack-mssql.c(20) : error C2061: syntax error : identifier 'ttl'
    crack-mssql.c(20) : error C2059: syntax error : ';'
    crack-mssql.c(21) : error C2061: syntax error : identifier 'proto'
    crack-mssql.c(21) : error C2059: syntax error : ';'
    crack-mssql.c(22) : error C2061: syntax error : identifier 'crc'
    crack-mssql.c(22) : error C2059: syntax error : ';'
    crack-mssql.c(23) : error C2061: syntax error : identifier 'saddr'
    crack-mssql.c(23) : error C2059: syntax error : ';'
    crack-mssql.c(24) : error C2061: syntax error : identifier 'daddr'
    crack-mssql.c(24) : error C2059: syntax error : ';'
    crack-mssql.c(25) : error C2061: syntax error : identifier 'op_pad'
    crack-mssql.c(25) : error C2059: syntax error : ';'
    crack-mssql.c(26) : error C2059: syntax error : '}'
    crack-mssql.c(30) : error C2061: syntax error : identifier 'u_short'
    crack-mssql.c(31) : error C2061: syntax error : identifier 'dport'
    crack-mssql.c(31) : error C2059: syntax error : ';'
    crack-mssql.c(32) : error C2061: syntax error : identifier 'len'
    crack-mssql.c(32) : error C2059: syntax error : ';'
    crack-mssql.c(33) : error C2061: syntax error : identifier 'crc'
    crack-mssql.c(33) : error C2059: syntax error : ';'
    crack-mssql.c(34) : error C2059: syntax error : '}'
    crack-mssql.c(37) : error C2061: syntax error : identifier 'u_char'
    crack-mssql.c(38) : error C2061: syntax error : identifier 'byte2'
    crack-mssql.c(38) : error C2059: syntax error : ';'
    crack-mssql.c(39) : error C2059: syntax error : '}'
    crack-mssql.c(42) : error C2061: syntax error : identifier 'u_char'
    crack-mssql.c(43) : error C2061: syntax error : identifier 'byte2'
    crack-mssql.c(43) : error C2059: syntax error : ';'
    crack-mssql.c(44) : error C2059: syntax error : '}'
    crack-mssql.c(47) : error C2061: syntax error : identifier 'u_char'
    crack-mssql.c(48) : error C2061: syntax error : identifier 'byte2'
    crack-mssql.c(48) : error C2059: syntax error : ';'
    crack-mssql.c(49) : error C2059: syntax error : '}'
    crack-mssql.c(52) : error C2061: syntax error : identifier 'u_char'
    crack-mssql.c(53) : error C2061: syntax error : identifier 'byte2'
    crack-mssql.c(53) : error C2059: syntax error : ';'
    crack-mssql.c(54) : error C2059: syntax error : '}'
    crack-mssql.c(56) : error C2143: syntax error : missing '{' before '*'
    crack-mssql.c(59) : error C2143: syntax error : missing ')' before '*'
    crack-mssql.c(59) : error C2143: syntax error : missing '{' before '*'
    crack-mssql.c(59) : error C2059: syntax error : 'type'
    crack-mssql.c(60) : error C2059: syntax error : ')'
    crack-mssql.c(77) : error C2065: 'pcap_if_t' : undeclared identifier
    crack-mssql.c(77) : error C2065: 'alldevs' : undeclared identifier
    crack-mssql.c(77) : warning C4552: '*' : operator has no effect; expected operator with side-effect
    crack-mssql.c(78) : error C2065: 'd' : undeclared identifier
    crack-mssql.c(78) : warning C4552: '*' : operator has no effect; expected operator with side-effect
    crack-mssql.c(79) : error C2143: syntax error : missing ';' before 'type'
    crack-mssql.c(80) : error C2143: syntax error : missing ';' before 'type'
    crack-mssql.c(80) : fatal error C1003: error count exceeds 100; stopping compilation
    I have attached both the crack-mssql.c file and my pcap.h header file.

    Any suggestions would be greatly appreciated.
    Attached Files Attached Files
    I AM... THE WOLFMAN!!
    The Wolfman's Homepage: http://www.fangtastic.org
    Do you dig the Wolfman?? Sign his Ghoulbook or listen to him Howl

  2. #2
    Senior Member
    Join Date
    Dec 2007
    Posts
    132
    If your doing a hacker challenge then you're not going to learn anything if you ask others to solve the problem for you. While you didn't come right out and say it, it's pretty obvious you didn't do any research on the problem at all. I don't mean to sound rude or anything, but most hackers wont help someone go from A to D and skip B & C. You have to at least show that you're making some kind of effort beyond getting frustrated after tried to compile a program.

    First, I don't think you have any programming experience at all, so trying to compile a program you don't understand is like trying to drive a car with a blacked out windshield. Look at your first error:

    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(1) : error C2059: syntax error : 'constant'

    Try googling some of the key words there and see what the problem could be. However, you may need to take a basic course in C++ before hand. Yes, there is some work involved in compromising security.

    *edit* Here's a question, are you trying to compile pcap exactly as it is in the file you attached??

    It's not uncommon for hackers to put out exploit code out there with blatently obvious syntax errors. This keeps the script kiddies from being able to just pick up the ball and start running with it. In your situation, that's exactly what's happened here. A script kiddie is someone who uses hacking tools and exploits without even understanding how or why they work.

    Sit down tomorrow and put some good effort into what I just glazed over, and if you still have troubles post an update tomorrow and we'll see what we can do
    Last edited by xiphias360; December 8th, 2007 at 08:05 AM. Reason: n/a

  3. #3
    Senior Member wolfman1984's Avatar
    Join Date
    Aug 2007
    Location
    fangtastic.org
    Posts
    191
    Quote Originally Posted by xiphias360
    If your doing a hacker challenge then you're not going to learn anything if you ask others to solve the problem for you.
    I'm not asking you for the answer to the hacker challenge. I'm simply looking for advice as to why my compiler won't compile the script.

    Quote Originally Posted by xiphias360
    While you didn't come right out and say it, it's pretty obvious you didn't do any research on the problem at all. I don't mean to sound rude or anything, but most hackers wont help someone go from A to D and skip B & C. You have to at least show that you're making some kind of effort beyond getting frustrated after tried to compile a program.
    I did do a lot of research on this problem. I do have limited time to work on this stuff, but when the time permits, I am doing the research.

    I do agree with you. I did not show any effort on my part. My original post should have showed what I had done and what I know.

    Quote Originally Posted by xiphias360
    First, I don't think you have any programming experience at all, so trying to compile a program you don't understand is like trying to drive a car with a blacked out windshield. Look at your first error:
    I know exactly what I am compiling and what the purpose of this program is. Some lines in the code I am having difficultly with. That is why I was asking for help.

    Quote Originally Posted by xiphias360
    c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\pcap.h(1) : error C2059: syntax error : 'constant'

    Try googling some of the key words there and see what the problem could be. However, you may need to take a basic course in C++ before hand. Yes, there is some work involved in compromising security.
    I had already done this before posting. I found and read tons of information, but nothing that pointed me into the right direction.

    Quote Originally Posted by xiphias360
    *edit* Here's a question, are you trying to compile pcap exactly as it is in the file you attached??
    Bingo! And here is the problem. The pcap header file I was using had numbers to indicate each line. I have no idea how this happened?? What makes this even stranger is I was using textpad the whole time and these numbers didn't show up.

    I think this may have to do with Vista blocking my saves to a directory I was trying to write to in c:\program files.

    Quote Originally Posted by xiphias360
    It's not uncommon for hackers to put out exploit code out there with blatently obvious syntax errors. This keeps the script kiddies from being able to just pick up the ball and start running with it. In your situation, that's exactly what's happened here. A script kiddie is someone who uses hacking tools and exploits without even understanding how or why they work.
    I actually don't see any errors in the exploit code that I attached yesterday. My pcap header file was all screwy, but other then that, there are no errors in the exploit code itself.

    I do agree with you that exploit code can contain errors that prevent the script kiddie from compiling it. This has never stopped me in the past.

    I think in this case, Vista was preventing me from doing the work correctly. By trying to compile the program outside of my user space, it was causing me to see things that weren't actually there!!!!

    Quote Originally Posted by xiphias360
    Sit down tomorrow and put some good effort into what I just glazed over, and if you still have troubles post an update tomorrow and we'll see what we can do
    Thanks for the help Xiphias360. I have almost got this thing working. I just need to find the winsock/windows.h header files and I should be good to go.

    - The Wolfman
    I AM... THE WOLFMAN!!
    The Wolfman's Homepage: http://www.fangtastic.org
    Do you dig the Wolfman?? Sign his Ghoulbook or listen to him Howl

Similar Threads

  1. Criminal IT: Should you trust the Internet?
    By SDK in forum Miscellaneous Security Discussions
    Replies: 4
    Last Post: January 28th, 2005, 05:54 PM
  2. Advanced C++, generic programming & STL
    By progme in forum Other Tutorials Forum
    Replies: 11
    Last Post: November 2nd, 2003, 04:43 PM
  3. Help with C++ compiler (newbie)
    By corndog420 in forum Programming Security
    Replies: 10
    Last Post: August 22nd, 2003, 04:37 AM
  4. C++ portability guide
    By tampabay420 in forum Programming Security
    Replies: 2
    Last Post: February 14th, 2003, 02:36 PM
  5. windres resource compiler
    By ele5125 in forum Programming Security
    Replies: 1
    Last Post: November 3rd, 2002, 11:29 PM

Posting Permissions

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