Changeset 470

Show
Ignore:
Timestamp:
04/04/06 09:23:41 (3 years ago)
Author:
dp
Message:

shellcode-signatures

  • remove the inverse workaround after parsing the file and fix the grammar to establish the correct order in the first place.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/shellcode-signatures/parser.y

    r468 r470  
    5959        : identifier SC_LBR statements SC_RBR SC_SEMI 
    6060        { 
    61  
    62       int mapinverse[MAP_MAX]; 
    63       int i,j; 
    64  
    65                 for( i = 0, j=shellcodes->map_items-1; i < shellcodes->map_items; i++,j-- ) 
    66                 { 
    67 //         printf(" i = %i j = %i value %i\n",i,j,shellcodes->map[i]); 
    68          mapinverse[j] = shellcodes->map[i]; 
    69       } 
    70  
    71       for( i = 0 ; i < shellcodes->map_items; i++) 
    72                 { 
    73          shellcodes->map[i] = mapinverse[i]; 
    74       } 
    75  
    76  
    7761/* 
    7862                printf("shellcode:\n"); 
     
    9276                printf("\n\n"); 
    9377*/ 
     78 
    9479                /* prepare for the next one */ 
    9580                init_shellcode(); 
     
    195180 
    196181map_values 
    197         : map_value map_value_comma_list 
    198         { 
    199                 shellcodes->map[shellcodes->map_items++] = $1
    200         } 
    201    
     182        : map_value_comma_list map_value 
     183        { 
     184                shellcodes->map[shellcodes->map_items++] = $2
     185        } 
     186       
    202187 
    203188map_value_comma_list 
    204189        : /* \epsilon */ 
    205         | SC_COMMA map_value map_value_comma_list 
     190        | map_value_comma_list map_value SC_COMMA 
    206191        { 
    207192                if( shellcodes->map_items < (MAP_MAX - 1) ) 
  • nepenthes/trunk/modules/shellcode-signatures/y.tab.c

    r469 r470  
    1 /* A Bison parser, made by GNU Bison 2.0.  */ 
     1/* A Bison parser, made by GNU Bison 2.1.  */ 
    22 
    33/* Skeleton parser for Yacc-like parsing with Bison, 
    4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 
     4   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 
    55 
    66   This program is free software; you can redistribute it and/or modify 
     
    1616   You should have received a copy of the GNU General Public License 
    1717   along with this program; if not, write to the Free Software 
    18    Foundation, Inc., 59 Temple Place - Suite 330
    19    Boston, MA 02111-1307, USA.  */ 
     18   Foundation, Inc., 51 Franklin Street, Fifth Floor
     19   Boston, MA 02110-1301, USA.  */ 
    2020 
    2121/* As a special exception, when this file is copied by Bison into a 
     
    3636/* Identify Bison output.  */ 
    3737#define YYBISON 1 
     38 
     39/* Bison version.  */ 
     40#define YYBISON_VERSION "2.1" 
    3841 
    3942/* Skeleton name.  */ 
     
    9598   }; 
    9699#endif 
     100/* Tokens.  */ 
    97101#define SC_ID 258 
    98102#define SC_LPAR 259 
     
    185189#endif 
    186190 
     191/* Enabling the token table.  */ 
     192#ifndef YYTOKEN_TABLE 
     193# define YYTOKEN_TABLE 0 
     194#endif 
     195 
    187196#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 
    188197typedef int YYSTYPE; 
     
    197206 
    198207 
    199 /* Line 213 of yacc.c.  */ 
    200 #line 201 "y.tab.c" 
     208/* Line 219 of yacc.c.  */ 
     209#line 210 "y.tab.c" 
     210 
     211#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 
     212# define YYSIZE_T __SIZE_TYPE__ 
     213#endif 
     214#if ! defined (YYSIZE_T) && defined (size_t) 
     215# define YYSIZE_T size_t 
     216#endif 
     217#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) 
     218# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 
     219# define YYSIZE_T size_t 
     220#endif 
     221#if ! defined (YYSIZE_T) 
     222# define YYSIZE_T unsigned int 
     223#endif 
     224 
     225#ifndef YY_ 
     226# if YYENABLE_NLS 
     227#  if ENABLE_NLS 
     228#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 
     229#   define YY_(msgid) dgettext ("bison-runtime", msgid) 
     230#  endif 
     231# endif 
     232# ifndef YY_ 
     233#  define YY_(msgid) msgid 
     234# endif 
     235#endif 
    201236 
    202237#if ! defined (yyoverflow) || YYERROR_VERBOSE 
    203  
    204 # ifndef YYFREE 
    205 #  define YYFREE free 
    206 # endif 
    207 # ifndef YYMALLOC 
    208 #  define YYMALLOC malloc 
    209 # endif 
    210238 
    211239/* The parser invokes alloca or malloc; define the necessary symbols.  */ 
     
    217245#   else 
    218246#    define YYSTACK_ALLOC alloca 
     247#    if defined (__STDC__) || defined (__cplusplus) 
     248#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 
     249#     define YYINCLUDED_STDLIB_H 
     250#    endif 
    219251#   endif 
    220252#  endif 
     
    224256   /* Pacify GCC's `empty if-body' warning. */ 
    225257#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 
     258#  ifndef YYSTACK_ALLOC_MAXIMUM 
     259    /* The OS might guarantee only one guard page at the bottom of the stack, 
     260       and a page size can be as small as 4096 bytes.  So we cannot safely 
     261       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number 
     262       to allow for a few compiler-allocated temporary stack slots.  */ 
     263#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ 
     264#  endif 
    226265# else 
    227 #  if defined (__STDC__) || defined (__cplusplus) 
    228 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 
    229 #   define YYSIZE_T size_t 
    230 #  endif 
    231266#  define YYSTACK_ALLOC YYMALLOC 
    232267#  define YYSTACK_FREE YYFREE 
     268#  ifndef YYSTACK_ALLOC_MAXIMUM 
     269#   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) 
     270#  endif 
     271#  ifdef __cplusplus 
     272extern "C" { 
     273#  endif 
     274#  ifndef YYMALLOC 
     275#   define YYMALLOC malloc 
     276#   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ 
     277        && (defined (__STDC__) || defined (__cplusplus))) 
     278void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 
     279#   endif 
     280#  endif 
     281#  ifndef YYFREE 
     282#   define YYFREE free 
     283#   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ 
     284        && (defined (__STDC__) || defined (__cplusplus))) 
     285void free (void *); /* INFRINGES ON USER NAME SPACE */ 
     286#   endif 
     287#  endif 
     288#  ifdef __cplusplus 
     289} 
     290#  endif 
    233291# endif 
    234292#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 
     
    265323      do                                        \ 
    266324        {                                       \ 
    267           register YYSIZE_T yyi;              \ 
     325          YYSIZE_T yyi;                               \ 
    268326          for (yyi = 0; yyi < (Count); yyi++)   \ 
    269327            (To)[yyi] = (From)[yyi];            \ 
     
    300358#define YYFINAL  2 
    301359/* YYLAST -- Last index in YYTABLE.  */ 
    302 #define YYLAST   47 
     360#define YYLAST   44 
    303361 
    304362/* YYNTOKENS -- Number of terminals. */ 
     
    309367#define YYNRULES  45 
    310368/* YYNRULES -- Number of states. */ 
    311 #define YYNSTATES  62 
     369#define YYNSTATES  60 
    312370 
    313371/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */ 
     
    315373#define YYMAXUTOK   296 
    316374 
    317 #define YYTRANSLATE(YYX)                                              \ 
     375#define YYTRANSLATE(YYX)                                              \ 
    318376  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 
    319377 
     
    374432      28,    -1,    -1,    48,    47,    -1,    49,     9,    -1,    55, 
    375433      -1,    50,    -1,    51,    -1,    12,    11,    -1,    15,     4, 
    376       52,     5,    -1,    54,    53,    -1,    -1,     8,    54,    53
     434      52,     5,    -1,    53,    54,    -1,    -1,    53,    54,     8
    377435      -1,    29,    -1,    30,    -1,    31,    -1,    32,    -1,    34, 
    378436      -1,    33,    -1,    35,    -1,    36,    -1,    37,    -1,    38, 
     
    384442static const unsigned short int yyrline[] = 
    385443{ 
    386        0,    53,    53,    55,    59,   100,   109,   114,   119,   124
    387      129,   134,   139,   144,   149,   154,   159,   164,   170,   172
    388      176,   180,   181,   182,   186,   193,   197,   204,   206,   214
    389      218,   222,   226,   230,   234,   238,   242,   246,   250,   254
    390      258,   262,   266,   273,   281,   283 
     444       0,    53,    53,    55,    59,    85,    94,    99,   104,   109
     445     114,   119,   124,   129,   134,   139,   144,   149,   155,   157
     446     161,   165,   166,   167,   171,   178,   182,   188,   190,   198
     447     202,   206,   210,   214,   218,   222,   226,   230,   234,   238
     448     242,   246,   250,   257,   265,   267 
    391449}; 
    392450#endif 
    393451 
    394 #if YYDEBUG || YYERROR_VERBOSE 
    395 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 
     452#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 
     453/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 
    396454   First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 
    397455static const char *const yytname[] = 
     
    453511      16,    13,    14,    15,    17,     3,     0,     0,    18,     0, 
    454512       0,     0,     0,     0,    18,     0,    22,    23,    21,     0, 
    455       24,    44,     0,     0,    19,    20,     5,    44,    43,    40, 
    456       29,    30,    31,    32,    34,    33,    35,    36,    37,    38, 
    457       39,    41,    42,     0,    27,     4,    45,    25,     0,    26, 
    458       27,    28 
     513      24,    44,    27,     0,    19,    20,     5,    44,    43,     0, 
     514       0,     4,    45,    25,    40,    29,    30,    31,    32,    34, 
     515      33,    35,    36,    37,    38,    39,    41,    42,    26,    28 
    459516}; 
    460517 
     
    463520{ 
    464521      -1,     1,    15,    16,    17,    23,    24,    25,    26,    27, 
    465       53,    59,    54,    28,    38 
     522      39,    40,    58,    28,    38 
    466523}; 
    467524 
    468525/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 
    469526   STATE-NUM.  */ 
    470 #define YYPACT_NINF -17 
     527#define YYPACT_NINF -12 
    471528static const yysigned_char yypact[] = 
    472529{ 
    473      -17,    14,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17, 
    474      -17,   -17,   -17,   -17,   -17,   -17,    -5,    -6,   -10,    -4, 
    475       -3,    -9,     5,     3,   -10,     2,   -17,   -17,   -17,     9, 
    476      -17,    -1,   -11,     4,   -17,   -17,   -17,    -1,   -17,   -17, 
    477      -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17, 
    478      -17,   -17,   -17,    11,    35,   -17,   -17,   -17,   -11,   -17, 
    479       35,   -17 
     530     -12,    14,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12, 
     531     -12,   -12,   -12,   -12,   -12,   -12,    -5,    -6,   -10,    -4, 
     532      -3,    -9,     5,     3,   -10,     2,   -12,   -12,   -12,     9, 
     533     -12,    -1,   -12,     4,   -12,   -12,   -12,    -1,   -12,    11, 
     534     -11,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12, 
     535     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,    35,   -12 
    480536}; 
    481537 
     
    483539static const yysigned_char yypgoto[] = 
    484540{ 
    485      -17,   -17,   -17,   -17,   -17,    -7,   -17,   -17,   -17,   -17
    486      -17,   -16,   -13,   -17,    10 
     541     -12,   -12,   -12,   -12,   -12,    -7,   -12,   -12,   -12,   -12
     542     -12,   -12,   -12,   -12,     7 
    487543}; 
    488544 
     
    494550static const unsigned char yytable[] = 
    495551{ 
    496       39,    18,    20,    21,    19,    22,    29,    31,    30,    32, 
    497       33,    35,    36,    55,     2,    37,    57,    34,    40,    41
    498       42,    43,    44,    45,    46,    47,    48,    49,    50,    51
    499       52,     3,     4,     5,     6,     7,     8,     9,    10,    11, 
    500       12,    13,    14,    58,    61,    60,     0,    56 
     552      44,    18,    20,    21,    19,    22,    29,    31,    30,    32, 
     553      33,    35,    36,    41,     2,    37,    43,    34,    45,    46
     554      47,    48,    49,    50,    51,    52,    53,    54,    55,    56
     555      57,     3,     4,     5,     6,     7,     8,     9,    10,    11, 
     556      12,    13,    14,    59,    42 
    501557}; 
    502558 
    503 static const yysigned_char yycheck[] = 
     559static const unsigned char yycheck[] = 
    504560{ 
    505561      11,     6,    12,    13,    10,    15,    10,    16,    11,     4, 
     
    507563      31,    32,    33,    34,    35,    36,    37,    38,    39,    40, 
    508564      41,    17,    18,    19,    20,    21,    22,    23,    24,    25, 
    509       26,    27,    28,     8,    60,    58,    -1,    37 
     565      26,    27,    28,     8,    37 
    510566}; 
    511567 
     
    517573      24,    25,    26,    27,    28,    44,    45,    46,     6,    10, 
    518574      12,    13,    15,    47,    48,    49,    50,    51,    55,    10, 
    519       11,    16,     4,     7,    47,     9,     3,    16,    56,    11, 
    520       29,    30,    31,    32,    33,    34,    35,    36,    37,    38, 
    521       39,    40,    41,    52,    54,     9,    56,     5,     8,    53, 
    522       54,    53 
     575      11,    16,     4,     7,    47,     9,     3,    16,    56,    52, 
     576      53,     9,    56,     5,    11,    29,    30,    31,    32,    33, 
     577      34,    35,    36,    37,    38,    39,    40,    41,    54,     8 
    523578}; 
    524  
    525 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 
    526 # define YYSIZE_T __SIZE_TYPE__ 
    527 #endif 
    528 #if ! defined (YYSIZE_T) && defined (size_t) 
    529 # define YYSIZE_T size_t 
    530 #endif 
    531 #if ! defined (YYSIZE_T) 
    532 # if defined (__STDC__) || defined (__cplusplus) 
    533 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 
    534 #  define YYSIZE_T size_t 
    535 # endif 
    536 #endif 
    537 #if ! defined (YYSIZE_T) 
    538 # define YYSIZE_T unsigned int 
    539 #endif 
    540579 
    541580#define yyerrok         (yyerrstatus = 0) 
     
    568607    }                                                           \ 
    569608  else                                                          \ 
    570     {                                                                 \ 
    571       yyerror ("syntax error: cannot back up");
     609    {                                                         \ 
     610      yyerror (YY_("syntax error: cannot back up"));
    572611      YYERROR;                                                  \ 
    573612    }                                                           \ 
     
    648687    {                                                           \ 
    649688      YYFPRINTF (stderr, "%s ", Title);                         \ 
    650       yysymprint (stderr,                                     \ 
     689      yysymprint (stderr,                                     \ 
    651690                  Type, Value); \ 
    652691      YYFPRINTF (stderr, "\n");                                 \ 
     
    696735{ 
    697736  int yyi; 
    698   unsigned int yylno = yyrline[yyrule]; 
    699   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", 
     737  unsigned long int yylno = yyrline[yyrule]; 
     738  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", 
    700739             yyrule - 1, yylno); 
    701740  /* Print the symbols being reduced, and their result.  */ 
    702741  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) 
    703     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); 
    704   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); 
     742    YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); 
     743  YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); 
    705744} 
    706745 
     
    731770 
    732771   Do not make this value too large; the results are undefined if 
    733    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 
     772   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 
    734773   evaluated with infinite-precision integer arithmetic.  */ 
    735774 
     
    755794#   endif 
    756795{ 
    757   register const char *yys = yystr; 
     796  const char *yys = yystr; 
    758797 
    759798  while (*yys++ != '\0') 
     
    780819#   endif 
    781820{ 
    782   register char *yyd = yydest; 
    783   register const char *yys = yysrc; 
     821  char *yyd = yydest; 
     822  const char *yys = yysrc; 
    784823 
    785824  while ((*yyd++ = *yys++) != '\0') 
     
    791830# endif 
    792831 
    793 #endif /* !YYERROR_VERBOSE */ 
     832# ifndef yytnamerr 
     833/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 
     834   quotes and backslashes, so that it's suitable for yyerror.  The 
     835   heuristic is that double-quoting is unnecessary unless the string 
     836   contains an apostrophe, a comma, or backslash (other than 
     837   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is 
     838   null, do not copy; instead, return the length of what the result 
     839   would have been.  */ 
     840static YYSIZE_T 
     841yytnamerr (char *yyres, const char *yystr) 
     842
     843  if (*yystr == '"') 
     844    { 
     845      size_t yyn = 0; 
     846      char const *yyp = yystr; 
     847 
     848      for (;;) 
     849        switch (*++yyp) 
     850          { 
     851          case '\'': 
     852          case ',': 
     853            goto do_not_strip_quotes; 
     854 
     855          case '\\': 
     856            if (*++yyp != '\\') 
     857              goto do_not_strip_quotes; 
     858            /* Fall through.  */ 
     859          default: 
     860            if (yyres) 
     861              yyres[yyn] = *yyp; 
     862            yyn++; 
     863            break; 
     864 
     865          case '"': 
     866            if (yyres) 
     867              yyres[yyn] = '\0'; 
     868            return yyn; 
     869          } 
     870    do_not_strip_quotes: ; 
     871    } 
     872 
     873  if (! yyres) 
     874    return yystrlen (yystr); 
     875 
     876  return yystpcpy (yyres, yystr) - yyres; 
     877
     878# endif 
     879 
     880#endif /* YYERROR_VERBOSE */ 
    794881 
    795882  
     
    911998int 
    912999yyparse () 
    913  
     1000    ; 
    9141001#endif 
    9151002#endif 
    9161003{ 
    9171004   
    918   register int yystate; 
    919   register int yyn; 
     1005  int yystate; 
     1006  int yyn; 
    9201007  int yyresult; 
    9211008  /* Number of tokens to shift before error messages enabled.  */ 
     
    9351022  short int yyssa[YYINITDEPTH]; 
    9361023  short int *yyss = yyssa; 
    937   register short int *yyssp; 
     1024  short int *yyssp; 
    9381025 
    9391026  /* The semantic value stack.  */ 
    9401027  YYSTYPE yyvsa[YYINITDEPTH]; 
    9411028  YYSTYPE *yyvs = yyvsa; 
    942   register YYSTYPE *yyvsp; 
     1029  YYSTYPE *yyvsp; 
    9431030 
    9441031 
     
    9711058  yyssp = yyss; 
    9721059  yyvsp = yyvs; 
    973  
    974  
    975   yyvsp[0] = yylval; 
    9761060 
    9771061  goto yysetstate; 
     
    10071091           conditional around just the two extra args, but that might 
    10081092           be undefined if yyoverflow is a macro.  */ 
    1009         yyoverflow ("parser stack overflow"
     1093        yyoverflow (YY_("memory exhausted")
    10101094                    &yyss1, yysize * sizeof (*yyssp), 
    10111095                    &yyvs1, yysize * sizeof (*yyvsp), 
     
    10181102#else /* no yyoverflow */ 
    10191103# ifndef YYSTACK_RELOCATE 
    1020       goto yyoverflowlab; 
     1104      goto yyexhaustedlab; 
    10211105# else 
    10221106      /* Extend the stack our own way.  */ 
    10231107      if (YYMAXDEPTH <= yystacksize) 
    1024         goto yyoverflowlab; 
     1108        goto yyexhaustedlab; 
    10251109      yystacksize *= 2; 
    10261110      if (YYMAXDEPTH < yystacksize) 
     
    10321116          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 
    10331117        if (! yyptr) 
    1034           goto yyoverflowlab; 
     1118          goto yyexhaustedlab; 
    10351119        YYSTACK_RELOCATE (yyss); 
    10361120        YYSTACK_RELOCATE (yyvs); 
     
    11631247#line 60 "parser.y" 
    11641248    { 
    1165  
    1166       int mapinverse[MAP_MAX]; 
    1167       int i,j; 
    1168  
    1169                 for( i = 0, j=shellcodes->map_items-1; i < shellcodes->map_items; i++,j-- ) 
    1170                 { 
    1171          printf(" i = %i j = %i value %i\n",i,j,shellcodes->map[i]); 
    1172          mapinverse[j] = shellcodes->map[i]; 
    1173       } 
    1174  
    1175       for( i = 0 ; i < shellcodes->map_items; i++) 
    1176                 { 
    1177          shellcodes->map[i] = mapinverse[i]; 
    1178       } 
    1179  
    1180  
    1181  
     1249/* 
    11821250                printf("shellcode:\n"); 
    11831251 
     
    11951263 
    11961264                printf("\n\n"); 
     1265*/ 
    11971266 
    11981267                /* prepare for the next one */ 
     
    12021271 
    12031272  case 5: 
    1204 #line 101 "parser.y" 
     1273#line 86 "parser.y" 
    12051274    { 
    12061275                shellcodes->nspace = (yyvsp[-3]); 
     
    12111280 
    12121281  case 6: 
     1282#line 95 "parser.y" 
     1283    { 
     1284                (yyval) = sc_xor; 
     1285        } 
     1286    break; 
     1287 
     1288  case 7: 
     1289#line 100 "parser.y" 
     1290    { 
     1291                (yyval) = sc_linkxor; 
     1292        } 
     1293    break; 
     1294 
     1295  case 8: 
     1296#line 105 "parser.y" 
     1297    { 
     1298                (yyval) = sc_konstanzxor; 
     1299        } 
     1300    break; 
     1301 
     1302  case 9: 
    12131303#line 110 "parser.y" 
    12141304    { 
    1215                 (yyval) = sc_xor; 
    1216         } 
    1217     break; 
    1218  
    1219   case 7
     1305                (yyval) = sc_leimbachxor; 
     1306        } 
     1307    break; 
     1308 
     1309  case 10
    12201310#line 115 "parser.y" 
    12211311    { 
    1222                 (yyval) = sc_linkxor
    1223         } 
    1224     break; 
    1225  
    1226   case 8
     1312                (yyval) = sc_bindshell
     1313        } 
     1314    break; 
     1315 
     1316  case 11
    12271317#line 120 "parser.y" 
    12281318    { 
    1229                 (yyval) = sc_konstanzxor
    1230         } 
    1231     break; 
    1232  
    1233   case 9
     1319                (yyval) = sc_connectbackshell
     1320        } 
     1321    break; 
     1322 
     1323  case 12
    12341324#line 125 "parser.y" 
    12351325    { 
    1236                 (yyval) = sc_leimbachxor; 
    1237         } 
    1238     break; 
    1239  
    1240   case 10
     1326                (yyval) = sc_connectbackfiletransfer; 
     1327        } 
     1328    break; 
     1329 
     1330  case 13
    12411331#line 130 "parser.y" 
    12421332    { 
    1243                 (yyval) = sc_bindshell
    1244         } 
    1245     break; 
    1246  
    1247   case 11
     1333                (yyval) = sc_execute
     1334        } 
     1335    break; 
     1336 
     1337  case 14
    12481338#line 135 "parser.y" 
    12491339    { 
    1250                 (yyval) = sc_connectbackshell
    1251         } 
    1252     break; 
    1253  
    1254   case 12
     1340                (yyval) = sc_download
     1341        } 
     1342    break; 
     1343 
     1344  case 15
    12551345#line 140 "parser.y" 
    12561346    { 
    1257                 (yyval) = sc_connectbackfiletransfer
    1258         } 
    1259     break; 
    1260  
    1261   case 13
     1347                (yyval) = sc_url
     1348        } 
     1349    break; 
     1350 
     1351  case 16
    12621352#line 145 "parser.y" 
    12631353    { 
    1264                 (yyval) = sc_execute
    1265         } 
    1266     break; 
    1267  
    1268   case 14
     1354                (yyval) = sc_bindfiletransfer
     1355        } 
     1356    break; 
     1357 
     1358  case 17
    12691359#line 150 "parser.y" 
    12701360    { 
    1271                 (yyval) = sc_download; 
    1272         } 
    1273     break; 
    1274  
    1275   case 15: 
    1276 #line 155 "parser.y" 
    1277     { 
    1278                 (yyval) = sc_url; 
    1279         } 
    1280     break; 
    1281  
    1282   case 16: 
    1283 #line 160 "parser.y" 
    1284     { 
    1285                 (yyval) = sc_bindfiletransfer; 
    1286         } 
    1287     break; 
    1288  
    1289   case 17: 
    1290 #line 165 "parser.y" 
    1291     { 
    12921361                (yyval) = sc_base64; 
    12931362        } 
     
    12951364 
    12961365  case 24: 
    1297 #line 187 "parser.y" 
     1366#line 172 "parser.y" 
    12981367    { 
    12991368                printf("flags none...\n"); 
     
    13021371 
    13031372  case 26: 
    1304 #line 198 "parser.y" 
     1373#line 183 "parser.y" 
     1374    { 
     1375                shellcodes->map[shellcodes->map_items++] = (yyvsp[0]); 
     1376        } 
     1377    break; 
     1378 
     1379  case 28: 
     1380#line 191 "parser.y" 
    13051381    { 
    13061382                if( shellcodes->map_items < (MAP_MAX - 1) ) 
     
    13091385    break; 
    13101386 
    1311   case 28: 
     1387  case 29: 
     1388#line 199 "parser.y" 
     1389    { 
     1390                (yyval) = sc_key; 
     1391        } 
     1392    break; 
     1393 
     1394  case 30: 
     1395#line 203 "parser.y" 
     1396    { 
     1397                (yyval) = sc_subkey; 
     1398        } 
     1399    break; 
     1400 
     1401  case 31: 
    13121402#line 207 "parser.y" 
    13131403    { 
    1314                 if( shellcodes->map_items < (MAP_MAX - 1) ) 
    1315                         shellcodes->map[shellcodes->map_items++] = (yyvsp[-1]); 
    1316         } 
    1317     break; 
    1318  
    1319   case 29: 
     1404                (yyval) = sc_size; 
     1405        } 
     1406    break; 
     1407 
     1408  case 32: 
     1409#line 211 "parser.y" 
     1410    { 
     1411                (yyval) = sc_sizeinvert; 
     1412        } 
     1413    break; 
     1414 
     1415  case 33: 
    13201416#line 215 "parser.y" 
    1321     { 
    1322                 (yyval) = sc_key; 
    1323         } 
    1324     break; 
    1325  
    1326   case 30: 
    1327 #line 219 "parser.y" 
    1328     { 
    1329                 (yyval) = sc_subkey; 
    1330         } 
    1331     break; 
    1332  
    1333   case 31: 
    1334 #line 223 "parser.y" 
    1335     { 
    1336                 (yyval) = sc_size; 
    1337         } 
    1338     break; 
    1339  
    1340   case 32: 
    1341 #line 227 "parser.y" 
    1342     { 
    1343                 (yyval) = sc_sizeinvert; 
    1344         } 
    1345     break; 
    1346  
    1347   case 33: 
    1348 #line 231 "parser.y" 
    13491417    {    
    13501418                (yyval) = sc_port; 
     
    13531421 
    13541422  case 34: 
     1423#line 219 "parser.y" 
     1424    { 
     1425                (yyval) = sc_host; 
     1426        } 
     1427    break; 
     1428 
     1429  case 35: 
     1430#line 223 "parser.y" 
     1431    { 
     1432                (yyval) = sc_command; 
     1433        } 
     1434    break; 
     1435 
     1436  case 36: 
     1437#line 227 "parser.y" 
     1438    { 
     1439                (yyval) = sc_uri; 
     1440        } 
     1441    break; 
     1442 
     1443  case 37: 
     1444#line 231 "parser.y" 
     1445    { 
     1446                (yyval) = sc_pcre; 
     1447        } 
     1448    break; 
     1449 
     1450  case 38: 
    13551451#line 235 "parser.y" 
    13561452    { 
    1357                 (yyval) = sc_host
    1358         } 
    1359     break; 
    1360  
    1361   case 35
     1453                (yyval) = sc_pre
     1454        } 
     1455    break; 
     1456 
     1457  case 39
    13621458#line 239 "parser.y" 
    13631459    { 
    1364                 (yyval) = sc_command
    1365         } 
    1366     break; 
    1367  
    1368   case 36
     1460                (yyval) = sc_post
     1461        } 
     1462    break; 
     1463 
     1464  case 40
    13691465#line 243 "parser.y" 
    13701466    { 
    1371                 (yyval) = sc_uri
    1372         } 
    1373     break; 
    1374  
    1375   case 37
     1467                (yyval) = sc_none
     1468        } 
     1469    break; 
     1470 
     1471  case 41
    13761472#line 247 "parser.y" 
    13771473    { 
    1378                 (yyval) = sc_pcre
    1379         } 
    1380     break; 
    1381  
    1382   case 38
     1474                (yyval) = sc_hostkey
     1475        } 
     1476    break; 
     1477 
     1478  case 42
    13831479#line 251 "parser.y" 
    13841480    { 
    1385                 (yyval) = sc_pre; 
    1386         } 
    1387     break; 
    1388  
    1389   case 39: 
    1390 #line 255 "parser.y" 
    1391     { 
    1392                 (yyval) = sc_post; 
    1393         } 
    1394     break; 
    1395  
    1396   case 40: 
    1397 #line 259 "parser.y" 
    1398     { 
    1399                 (yyval) = sc_none; 
    1400         } 
    1401     break; 
    1402  
    1403   case 41: 
    1404 #line 263 "parser.y" 
    1405     { 
    1406                 (yyval) = sc_hostkey; 
    1407         } 
    1408     break; 
    1409  
    1410   case 42: 
    1411 #line 267 "parser.y" 
    1412     { 
    14131481                (yyval) = sc_portkey; 
    14141482        } 
     
    14161484 
    14171485  case 43: 
    1418 #line 274 "parser.y" 
     1486#line 258 "parser.y" 
    14191487    { 
    14201488                shellcodes->pattern = strndup(string_get_buffer(), string_get_len()); 
     
    14251493 
    14261494 
     1495      default: break; 
    14271496    } 
    14281497 
    1429 /* Line 1037 of yacc.c.  */ 
    1430 #line 1431 "y.tab.c" 
     1498/* Line 1126 of yacc.c.  */ 
     1499#line 1500 "y.tab.c" 
    14311500  
    14321501  yyvsp -= yylen; 
     
    14671536      if (YYPACT_NINF < yyn && yyn < YYLAST) 
    14681537        { 
    1469           YYSIZE_T yysize = 0; 
    14701538          int yytype = YYTRANSLATE (yychar); 
    1471           const char* yyprefix; 
    1472           char *yymsg; 
     1539          YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 
     1540          YYSIZE_T yysize = yysize0; 
     1541          YYSIZE_T yysize1; 
     1542          int yysize_overflow = 0; 
     1543          char *yymsg = 0; 
     1544#         define YYERROR_VERBOSE_ARGS_MAXIMUM 5 
     1545          char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 
    14731546          int yyx; 
     1547 
     1548#if 0 
     1549          /* This is so xgettext sees the translatable formats that are 
     1550             constructed on the fly.  */ 
     1551          YY_("syntax error, unexpected %s"); 
     1552          YY_("syntax error, unexpected %s, expecting %s"); 
     1553          YY_("syntax error, unexpected %s, expecting %s or %s"); 
     1554          YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 
     1555          YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 
     1556#endif 
     1557          char *yyfmt; 
     1558          char const *yyf; 
     1559          static char const yyunexpected[] = "syntax error, unexpected %s"; 
     1560          static char const yyexpecting[] = ", expecting %s"; 
     1561          static char const yyor[] = " or %s"; 
     1562          char yyformat[sizeof yyunexpected 
     1563                        + sizeof yyexpecting - 1 
     1564                        + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 
     1565                           * (sizeof yyor - 1))]; 
     1566          char const *yyprefix = yyexpecting; 
    14741567 
    14751568          /* Start YYX at -YYN if negative to avoid negative indexes in 
     
    14801573          int yychecklim = YYLAST - yyn; 
    14811574          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 
    1482           int yycount = 0; 
    1483  
    1484           yyprefix = ", expecting "; 
     1575          int yycount = 1; 
     1576 
     1577          yyarg[0] = yytname[yytype]; 
     1578          yyfmt = yystpcpy (yyformat, yyunexpected); 
     1579 
    14851580          for (yyx = yyxbegin; yyx < yyxend; ++yyx) 
    14861581            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 
    14871582              { 
    1488                 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); 
    1489                 yycount += 1; 
    1490                 if (yycount == 5) 
     1583                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 
    14911584                  { 
    1492                     yysize = 0; 
     1585                    yycount = 1; 
     1586                    yysize = yysize0; 
     1587                    yyformat[sizeof yyunexpected - 1] = '\0'; 
    14931588                    break; 
    14941589                  } 
     1590                yyarg[yycount++] = yytname[yyx]; 
     1591                yysize1 = yysize + yytnamerr (0, yytname[yyx]); 
     1592                yysize_overflow |= yysize1 < yysize; 
     1593                yysize = yysize1; 
     1594                yyfmt = yystpcpy (yyfmt, yyprefix); 
     1595                yyprefix = yyor; 
    14951596              } 
    1496           yysize += (sizeof ("syntax error, unexpected ") 
    1497                      + yystrlen (yytname[yytype])); 
    1498           yymsg = (char *) YYSTACK_ALLOC (yysize); 
    1499           if (yymsg != 0) 
     1597 
     1598          yyf = YY_(yyformat); 
     1599          yysize1 = yysize + yystrlen (yyf); 
     1600          yysize_overflow |= yysize1 < yysize; 
     1601          yysize = yysize1; 
     1602 
     1603          if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) 
     1604            yymsg = (char *) YYSTACK_ALLOC (yysize); 
     1605          if (yymsg) 
    15001606            { 
    1501               char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); 
    1502               yyp = yystpcpy (yyp, yytname[yytype]); 
    1503  
    1504               if (yycount < 5) 
     1607              /* Avoid sprintf, as that infringes on the user's name space. 
     1608                 Don't have undefined behavior even if the translation 
     1609                 produced a string with the wrong number of "%s"s.  */ 
     1610              char *yyp = yymsg; 
     1611              int yyi = 0; 
     1612      &nbs