Compiling SPIKE
Results 1 to 7 of 7

Thread: Compiling SPIKE

  1. #1
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,324

    Compiling SPIKE

    I've been looking at playing with SPIKE but am running into a weird error.

    mittens@MsMittens:~/SPIKE/v2.8/src$ make
    gcc -Wall -funsigned-char -c -fPIC -ggdb -I/usr/local/include -I../include -Ilibntlm-0.21/ spike_dcerpc.c
    spike_dcerpc.c: In function `s_dce_unistring':
    spike_dcerpc.c:289: warning: unused variable `i'
    spike_dcerpc.c:640:12: missing terminating " character
    spike_dcerpc.c: In function `s_smb_negotiate':
    spike_dcerpc.c:641: error: parse error before numeric constant
    spike_dcerpc.c:641:22: invalid suffix "D" on integer constant
    spike_dcerpc.c:646:13: exponent has no digits
    spike_dcerpc.c:646:25: invalid suffix "F" on integer constant
    spike_dcerpc.c:646:31: invalid suffix "B" on integer constant
    spike_dcerpc.c:647:19: invalid suffix "F" on integer constant
    spike_dcerpc.c:647:31: invalid suffix "D" on integer constant
    spike_dcerpc.c:648:16: exponent has no digits
    spike_dcerpc.c:648:28: invalid suffix "D" on integer constant
    ...
    <snip>
    I've removed the repeated errors for the sake of brevity. I've looked at the code and it seems fine in the area in question. The error/complaint about "missing terminating" character doesn't seem valid. (at least to my old eyes). The section in question is listed below:

    Code:
    This is the unsigned integer of i
    
    int
    s_dce_unistring(unsigned char *mystring)
    {
    
      unsigned int size;
      unsigned int size2;
      unsigned int i;
    
      size=strlen(mystring)+1;
      if (size > (unsigned int)0xffffffff-(unsigned int)12)
        printf("Warning, dce_wordstring() length overflowed!\n");
      size2=size;
    Code:
     missing terminating "
    
    {
     if(login != NULL && password != NULL)
    
      s_binary(" 00 00
             00 89 FF 53 4D 42 72 00
             00 00 00 18 01 20 00 00
             00 00 00 00 00 00 00 00
             00 00 00 00 00 28 00 00
             00 00 00 66 00 02 50 43
             20 4E 45 54 57 4F 52 4B
             20 50 52 4F 47 52 41 4D
             20 31 2E 30 00 02 4D 49
             43 52 4F 53 4F 46 54 20
             4E 45 54 57 4F 52 4B 53
             20 31 2E 30 33 00 02 4D
             49 43 52 4F 53 4F 46 54
             20 4E 45 54 57 4F 52 4B
             53 20 33 2e 30 00 02 4c
             41 4e 4d 41 4e 31 2e 30
             00 02 4c 4d 31 2e 32 58
             30 30 32 00 02 53 61 6d
             62 61 00");
    
    else
      s_binary("
      00 00 00 a4 ff 53  4d 42 72 00 00 00 00 08
      01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
      01 26 00 00 01 00 00 81  00 02 50 43 20 4e 45 54
      57 4f 52 4b 20 50 52 4f  47 52 41 4d 20 31 2e 30
      00 02 4d 49 43 52 4f 53  4f 46 54 20 4e 45 54 57
      4f 52 4b 53 20 31 2e 30  33 00 02 4d 49 43 52 4f
      53 4f 46 54 20 4e 45 54  57 4f 52 4b 53 20 33 2e
      30 00 02 4c 41 4e 4d 41  4e 31 2e 30 00 02 4c 4d
      31 2e 32 58 30 30 32 00  02 53 61 6d 62 61 00 02
      4e 54 20 4c 41 4e 4d 41  4e 20 31 2e 30 00 02 4e
      54 20 4c 4d 20 30 2e 31  32 00 ");
    Help?
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  2. #2
    Senior Member
    Join Date
    Jan 2002
    Posts
    1,207
    It looks like they're using multiline literal strings and the compiler does not support them.

    I have never used multiline strings in C so I don't know whether they're supported. Possibly the program was written for an (old) compiler which did support multiline strings in violation of some standard?

    The line 289 is merely a warning. It doesn't look important.

  3. #3
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,324
    So if I stuck them all on one line should be ok? or am I risking that the prog won't respond the way it was intended?
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  4. #4
    Senior Member
    Join Date
    Jul 2002
    Posts
    339
    I think it should be ok (if you haven't done that). In fact, the new line characters in the original strings are simply ignored by the s_binary() function. Have a look at it in the src/spike.c source file. It expects a string of 2-digit hex numbers. Any whitespaces will be ignored, and any other characters will trigger an error.

    BTW, slarty is right on. Multiple line strings are generally deprecated now. Some compilers only give you a warning, but it looks like yours is pickier.

    Peace always,
    <jdenny>
    Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
    I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds


  5. #5
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    $ gcc -dumpversion
    3.3.3


    I'm guessing you have a GCC 3.3.x, which is quite strict..

    Are there any other problems that occur after fixing the lines (removing line breaks and weird whitespaces ?? )
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  6. #6
    Member
    Join Date
    Dec 2001
    Posts
    87
    I get exactly the same errors compiling spike on fedora - gcc version 3.3.2

  7. #7
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,324
    Thanks guys! Got it to work. In the end I had to remove the line breaks from the following files:

    spike_dcerpc.c
    quake.c
    quakeserver.c
    halflife.c
    citrix.c

    Damn picky! Now I can play!
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

Posting Permissions

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