Changeset 467

Show
Ignore:
Timestamp:
04/03/06 22:55:06 (3 years ago)
Author:
common
Message:

shellcode-signatures
- the new yacc files

Files:

Legend:

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

    r462 r467  
    1 /* A Bison parser, made by GNU Bison 1.875d.  */ 
     1/* A Bison parser, made by GNU Bison 2.0.  */ 
    22 
    33/* Skeleton parser for Yacc-like parsing with Bison, 
     
    197197 
    198198 
    199 /* Line 214 of yacc.c.  */ 
     199/* Line 213 of yacc.c.  */ 
    200200#line 201 "y.tab.c" 
    201201 
     
    213213# ifdef YYSTACK_USE_ALLOCA 
    214214#  if YYSTACK_USE_ALLOCA 
    215 #   define YYSTACK_ALLOC alloca 
    216 #  endif 
    217 # else 
    218 #  if defined (alloca) || defined (_ALLOCA_H) 
    219 #   define YYSTACK_ALLOC alloca 
    220 #  else 
    221215#   ifdef __GNUC__ 
    222216#    define YYSTACK_ALLOC __builtin_alloca 
     217#   else 
     218#    define YYSTACK_ALLOC alloca 
    223219#   endif 
    224220#  endif 
     
    388384static const unsigned short int yyrline[] = 
    389385{ 
    390        0,    53,    53,    55,    59,    83,    92,    97,   102,   107
    391      112,   117,   122,   127,   132,   137,   142,   147,   153,   155
    392      159,   163,   164,   165,   169,   176,   180,   183,   185,   193
    393      197,   201,   205,   209,   213,   217,   221,   225,   229,   233
    394      237,   241,   245,   252,   260,   262 
     386       0,    53,    53,    55,    59,    84,    93,    98,   103,   108
     387     113,   118,   123,   128,   133,   138,   143,   148,   154,   156
     388     160,   164,   165,   166,   170,   177,   181,   184,   186,   194
     389     198,   202,   206,   210,   214,   218,   222,   226,   230,   234
     390     238,   242,   246,   253,   261,   263 
    395391}; 
    396392#endif 
     
    578574while (0) 
    579575 
     576 
    580577#define YYTERROR        1 
    581578#define YYERRCODE       256 
    582579 
    583 /* YYLLOC_DEFAULT -- Compute the default location (before the actions 
    584    are run).  */ 
    585  
     580 
     581/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 
     582   If N is 0, then set CURRENT to the empty location which ends 
     583   the previous symbol: RHS[0] (always defined).  */ 
     584 
     585#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 
    586586#ifndef YYLLOC_DEFAULT 
    587 # define YYLLOC_DEFAULT(Current, Rhs, N)                \ 
    588    ((Current).first_line   = (Rhs)[1].first_line,       \ 
    589     (Current).first_column = (Rhs)[1].first_column,     \ 
    590     (Current).last_line    = (Rhs)[N].last_line,        \ 
    591     (Current).last_column  = (Rhs)[N].last_column) 
    592 #endif 
     587# define YYLLOC_DEFAULT(Current, Rhs, N)                                \ 
     588    do                                                                  \ 
     589      if (N)                                                            \ 
     590        {                                                               \ 
     591          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \ 
     592          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \ 
     593          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \ 
     594          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \ 
     595        }                                                               \ 
     596      else                                                              \ 
     597        {                                                               \ 
     598          (Current).first_line   = (Current).last_line   =              \ 
     599            YYRHSLOC (Rhs, 0).last_line;                                \ 
     600          (Current).first_column = (Current).last_column =              \ 
     601            YYRHSLOC (Rhs, 0).last_column;                              \ 
     602        }                                                               \ 
     603    while (0) 
     604#endif 
     605 
     606 
     607/* YY_LOCATION_PRINT -- Print the location on the stream. 
     608   This macro was not mandated originally: define only if we know 
     609   we won't break user code: when these are the locations we know.  */ 
     610 
     611#ifndef YY_LOCATION_PRINT 
     612# if YYLTYPE_IS_TRIVIAL 
     613#  define YY_LOCATION_PRINT(File, Loc)                  \ 
     614     fprintf (File, "%d.%d-%d.%d",                      \ 
     615              (Loc).first_line, (Loc).first_column,     \ 
     616              (Loc).last_line,  (Loc).last_column) 
     617# else 
     618#  define YY_LOCATION_PRINT(File, Loc) ((void) 0) 
     619# endif 
     620#endif 
     621 
    593622 
    594623/* YYLEX -- calling `yylex' with the right arguments.  */ 
     
    614643} while (0) 
    615644 
    616 # define YYDSYMPRINT(Args)                      \ 
    617 do {                                            \ 
    618   if (yydebug)                                  \ 
    619     yysymprint Args;                            \ 
    620 } while (0) 
    621  
    622 # define YYDSYMPRINTF(Title, Token, Value, Location)            \ 
     645# define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \ 
    623646do {                                                            \ 
    624647  if (yydebug)                                                  \ 
     
    626649      YYFPRINTF (stderr, "%s ", Title);                         \ 
    627650      yysymprint (stderr,                                       \ 
    628                   Token, Value);      \ 
     651                  Type, Value);       \ 
    629652      YYFPRINTF (stderr, "\n");                                 \ 
    630653    }                                                           \ 
     
    693716#else /* !YYDEBUG */ 
    694717# define YYDPRINTF(Args) 
    695 # define YYDSYMPRINT(Args) 
    696 # define YYDSYMPRINTF(Title, Token, Value, Location) 
     718# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 
    697719# define YY_STACK_PRINT(Bottom, Top) 
    698720# define YY_REDUCE_PRINT(Rule) 
     
    711733   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 
    712734   evaluated with infinite-precision integer arithmetic.  */ 
    713  
    714 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 
    715 # undef YYMAXDEPTH 
    716 #endif 
    717735 
    718736#ifndef YYMAXDEPTH 
     
    797815 
    798816  if (yytype < YYNTOKENS) 
    799     { 
    800       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 
    801 # ifdef YYPRINT 
    802       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 
    803 # endif 
    804     } 
     817    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 
    805818  else 
    806819    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 
    807820 
     821 
     822# ifdef YYPRINT 
     823  if (yytype < YYNTOKENS) 
     824    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 
     825# endif 
    808826  switch (yytype) 
    809827    { 
     
    821839#if defined (__STDC__) || defined (__cplusplus) 
    822840static void 
    823 yydestruct (int yytype, YYSTYPE *yyvaluep) 
     841yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 
    824842#else 
    825843static void 
    826 yydestruct (yytype, yyvaluep) 
     844yydestruct (yymsg, yytype, yyvaluep) 
     845    const char *yymsg; 
    827846    int yytype; 
    828847    YYSTYPE *yyvaluep; 
     
    831850  /* Pacify ``unused variable'' warnings.  */ 
    832851  (void) yyvaluep; 
     852 
     853  if (!yymsg) 
     854    yymsg = "Deleting"; 
     855  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 
    833856 
    834857  switch (yytype) 
     
    859882 
    860883 
    861 /* The lookahead symbol.  */ 
     884/* The look-ahead symbol.  */ 
    862885int yychar; 
    863886 
    864 /* The semantic value of the lookahead symbol.  */ 
     887/* The semantic value of the look-ahead symbol.  */ 
    865888YYSTYPE yylval; 
    866889 
     
    898921  /* Number of tokens to shift before error messages enabled.  */ 
    899922  int yyerrstatus; 
    900   /* Lookahead token as an internal (translated) token number.  */ 
     923  /* Look-ahead token as an internal (translated) token number.  */ 
    901924  int yytoken = 0; 
    902925 
     
    949972  yyvsp = yyvs; 
    950973 
     974 
     975  yyvsp[0] = yylval; 
    951976 
    952977  goto yysetstate; 
     
    10391064 
    10401065/* Do appropriate processing given the current state.  */ 
    1041 /* Read a lookahead token if we need one and don't already have one.  */ 
     1066/* Read a look-ahead token if we need one and don't already have one.  */ 
    10421067/* yyresume: */ 
    10431068 
    1044   /* First try to decide what to do without reference to lookahead token.  */ 
     1069  /* First try to decide what to do without reference to look-ahead token.  */ 
    10451070 
    10461071  yyn = yypact[yystate]; 
     
    10481073    goto yydefault; 
    10491074 
    1050   /* Not known => get a lookahead token if don't already have one.  */ 
    1051  
    1052   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */ 
     1075  /* Not known => get a look-ahead token if don't already have one.  */ 
     1076 
     1077  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */ 
    10531078  if (yychar == YYEMPTY) 
    10541079    { 
     
    10651090    { 
    10661091      yytoken = YYTRANSLATE (yychar); 
    1067       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); 
     1092      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 
    10681093    } 
    10691094 
     
    10851110    YYACCEPT; 
    10861111 
    1087   /* Shift the lookahead token.  */ 
    1088   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); 
     1112  /* Shift the look-ahead token.  */ 
     1113  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 
    10891114 
    10901115  /* Discard the token being shifted unless it is eof.  */ 
     
    11471172                printf("\tmap                                    "); 
    11481173 
     1174      int i; 
    11491175                for( i = 0; i < shellcodes->map_items; i++ ) 
    11501176                { 
     
    11601186 
    11611187  case 5: 
    1162 #line 84 "parser.y" 
    1163     { 
    1164                 shellcodes->nspace = yyvsp[-3]
     1188#line 85 "parser.y" 
     1189    { 
     1190                shellcodes->nspace = (yyvsp[-3])
    11651191                shellcodes->name = strndup(string_get_buffer(), string_get_len()); 
    11661192                string_reset(); 
     
    11691195 
    11701196  case 6: 
    1171 #line 93 "parser.y" 
    1172     { 
    1173                 yyval = sc_xor; 
     1197#line 94 "parser.y" 
     1198    { 
     1199                (yyval) = sc_xor; 
    11741200        } 
    11751201    break; 
    11761202 
    11771203  case 7: 
    1178 #line 98 "parser.y" 
    1179     { 
    1180                 yyval = sc_linkxor; 
     1204#line 99 "parser.y" 
     1205    { 
     1206                (yyval) = sc_linkxor; 
    11811207        } 
    11821208    break; 
    11831209 
    11841210  case 8: 
    1185 #line 103 "parser.y" 
    1186     { 
    1187                 yyval = sc_konstanzxor; 
     1211#line 104 "parser.y" 
     1212    { 
     1213                (yyval) = sc_konstanzxor; 
    11881214        } 
    11891215    break; 
    11901216 
    11911217  case 9: 
    1192 #line 108 "parser.y" 
    1193     { 
    1194                 yyval = sc_leimbachxor; 
     1218#line 109 "parser.y" 
     1219    { 
     1220                (yyval) = sc_leimbachxor; 
    11951221        } 
    11961222    break; 
    11971223 
    11981224  case 10: 
    1199 #line 113 "parser.y" 
    1200     { 
    1201                 yyval = sc_bindshell; 
     1225#line 114 "parser.y" 
     1226    { 
     1227                (yyval) = sc_bindshell; 
    12021228        } 
    12031229    break; 
    12041230 
    12051231  case 11: 
    1206 #line 118 "parser.y" 
    1207     { 
    1208                 yyval = sc_connectbackshell; 
     1232#line 119 "parser.y" 
     1233    { 
     1234                (yyval) = sc_connectbackshell; 
    12091235        } 
    12101236    break; 
    12111237 
    12121238  case 12: 
    1213 #line 123 "parser.y" 
    1214     { 
    1215                 yyval = sc_connectbackfiletransfer; 
     1239#line 124 "parser.y" 
     1240    { 
     1241                (yyval) = sc_connectbackfiletransfer; 
    12161242        } 
    12171243    break; 
    12181244 
    12191245  case 13: 
    1220 #line 128 "parser.y" 
    1221     { 
    1222                 yyval = sc_execute; 
     1246#line 129 "parser.y" 
     1247    { 
     1248                (yyval) = sc_execute; 
    12231249        } 
    12241250    break; 
    12251251 
    12261252  case 14: 
    1227 #line 133 "parser.y" 
    1228     { 
    1229                 yyval = sc_download; 
     1253#line 134 "parser.y" 
     1254    { 
     1255                (yyval) = sc_download; 
    12301256        } 
    12311257    break; 
    12321258 
    12331259  case 15: 
    1234 #line 138 "parser.y" 
    1235     { 
    1236                 yyval = sc_url; 
     1260#line 139 "parser.y" 
     1261    { 
     1262                (yyval) = sc_url; 
    12371263        } 
    12381264    break; 
    12391265 
    12401266  case 16: 
    1241 #line 143 "parser.y" 
    1242     { 
    1243                 yyval = sc_bindfiletransfer; 
     1267#line 144 "parser.y" 
     1268    { 
     1269                (yyval) = sc_bindfiletransfer; 
    12441270        } 
    12451271    break; 
    12461272 
    12471273  case 17: 
    1248 #line 148 "parser.y" 
    1249     { 
    1250                 yyval = sc_base64; 
     1274#line 149 "parser.y" 
     1275    { 
     1276                (yyval) = sc_base64; 
    12511277        } 
    12521278    break; 
    12531279 
    12541280  case 24: 
    1255 #line 170 "parser.y" 
     1281#line 171 "parser.y" 
    12561282    { 
    12571283                printf("flags none...\n"); 
     
    12601286 
    12611287  case 28: 
    1262 #line 186 "parser.y" 
     1288#line 187 "parser.y" 
    12631289    { 
    12641290                if( shellcodes->map_items < (MAP_MAX - 1) ) 
    1265                         shellcodes->map[shellcodes->map_items++] = yyvsp[-2]
     1291                        shellcodes->map[shellcodes->map_items++] = (yyvsp[-1])
    12661292        } 
    12671293    break; 
    12681294 
    12691295  case 29: 
    1270 #line 194 "parser.y" 
    1271     { 
    1272                 yyval = sc_key; 
     1296#line 195 "parser.y" 
     1297    { 
     1298                (yyval) = sc_key; 
    12731299        } 
    12741300    break; 
    12751301 
    12761302  case 30: 
    1277 #line 198 "parser.y" 
    1278     { 
    1279                 yyval = sc_subkey; 
     1303#line 199 "parser.y" 
     1304    { 
     1305                (yyval) = sc_subkey; 
    12801306        } 
    12811307    break; 
    12821308 
    12831309  case 31: 
    1284 #line 202 "parser.y" 
    1285     { 
    1286                 yyval = sc_size; 
     1310#line 203 "parser.y" 
     1311    { 
     1312                (yyval) = sc_size; 
    12871313        } 
    12881314    break; 
    12891315 
    12901316  case 32: 
    1291 #line 206 "parser.y" 
    1292     { 
    1293                 yyval = sc_sizeinvert; 
     1317#line 207 "parser.y" 
     1318    { 
     1319                (yyval) = sc_sizeinvert; 
    12941320        } 
    12951321    break; 
    12961322 
    12971323  case 33: 
    1298 #line 210 "parser.y" 
     1324#line 211 "parser.y" 
    12991325    {    
    1300                 yyval = sc_port; 
     1326                (yyval) = sc_port; 
    13011327        } 
    13021328    break; 
    13031329 
    13041330  case 34: 
    1305 #line 214 "parser.y" 
    1306     { 
    1307                 yyval = sc_host; 
     1331#line 215 "parser.y" 
     1332    { 
     1333                (yyval) = sc_host; 
    13081334        } 
    13091335    break; 
    13101336 
    13111337  case 35: 
    1312 #line 218 "parser.y" 
    1313     { 
    1314                 yyval = sc_command; 
     1338#line 219 "parser.y" 
     1339    { 
     1340                (yyval) = sc_command; 
    13151341        } 
    13161342    break; 
    13171343 
    13181344  case 36: 
    1319 #line 222 "parser.y" 
    1320     { 
    1321                 yyval = sc_uri; 
     1345#line 223 "parser.y" 
     1346    { 
     1347                (yyval) = sc_uri; 
    13221348        } 
    13231349    break; 
    13241350 
    13251351  case 37: 
    1326 #line 226 "parser.y" 
    1327     { 
    1328                 yyval = sc_pcre; 
     1352#line 227 "parser.y" 
     1353    { 
     1354                (yyval) = sc_pcre; 
    13291355        } 
    13301356    break; 
    13311357 
    13321358  case 38: 
    1333 #line 230 "parser.y" 
    1334     { 
    1335                 yyval = sc_pre; 
     1359#line 231 "parser.y" 
     1360    { 
     1361                (yyval) = sc_pre; 
    13361362        } 
    13371363    break; 
    13381364 
    13391365  case 39: 
    1340 #line 234 "parser.y" 
    1341     { 
    1342                 yyval = sc_post; 
     1366#line 235 "parser.y" 
     1367    { 
     1368                (yyval) = sc_post; 
    13431369        } 
    13441370    break; 
    13451371 
    13461372  case 40: 
    1347 #line 238 "parser.y" 
    1348     { 
    1349                 yyval = sc_none; 
     1373#line 239 "parser.y" 
     1374    { 
     1375                (yyval) = sc_none; 
    13501376        } 
    13511377    break; 
    13521378 
    13531379  case 41: 
    1354 #line 242 "parser.y" 
    1355     { 
    1356                 yyval = sc_hostkey; 
     1380#line 243 "parser.y" 
     1381    { 
     1382                (yyval) = sc_hostkey; 
    13571383        } 
    13581384    break; 
    13591385 
    13601386  case 42: 
    1361 #line 246 "parser.y" 
    1362     { 
    1363                 yyval = sc_portkey; 
     1387#line 247 "parser.y" 
     1388    { 
     1389                (yyval) = sc_portkey; 
    13641390        } 
    13651391    break; 
    13661392 
    13671393  case 43: 
    1368 #line 253 "parser.y" 
     1394#line 254 "parser.y" 
    13691395    { 
    13701396                shellcodes->pattern = strndup(string_get_buffer(), string_get_len()); 
     
    13771403    } 
    13781404 
    1379 /* Line 1010 of yacc.c.  */ 
    1380 #line 1381 "y.tab.c" 
     1405/* Line 1037 of yacc.c.  */ 
     1406#line 1407 "y.tab.c" 
    13811407  
    13821408  yyvsp -= yylen; 
     
    14781504  if (yyerrstatus == 3) 
    14791505    { 
    1480       /* If just tried and failed to reuse lookahead token after an 
     1506      /* If just tried and failed to reuse look-ahead token after an 
    14811507         error, discard it.  */ 
    14821508 
     
    14881514             for (;;) 
    14891515               { 
     1516 
    14901517                 YYPOPSTACK; 
    14911518                 if (yyssp == yyss) 
    14921519                   YYABORT; 
    1493                  YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 
    1494                 yydestruct (yystos[*yyssp], yyvsp); 
     1520                 yydestruct ("Error: popping", 
     1521                             yystos[*yyssp], yyvsp); 
    14951522               } 
    14961523        } 
    14971524      else 
    14981525        { 
    1499           YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); 
    1500           yydestruct (yytoken, &yylval); 
     1526          yydestruct ("Error: discarding", yytoken, &yylval); 
    15011527          yychar = YYEMPTY; 
    1502  
    15031528        } 
    15041529    } 
    15051530 
    1506   /* Else will try to reuse lookahead token after shifting the error 
     1531  /* Else will try to reuse look-ahead token after shifting the error 
    15071532     token.  */ 
    15081533  goto yyerrlab1; 
     
    15211546#endif 
    15221547 
    1523   yyvsp -= yylen; 
     1548yyvsp -= yylen; 
    15241549  yyssp -= yylen; 
    15251550  yystate = *yyssp; 
     
    15511576        YYABORT; 
    15521577 
    1553       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 
    1554       yydestruct (yystos[yystate], yyvsp); 
     1578 
     1579      yydestruct ("Error: popping", yystos[yystate], yyvsp); 
    15551580      YYPOPSTACK; 
    15561581      yystate = *yyssp; 
     
    15611586    YYACCEPT; 
    15621587 
    1563   YYDPRINTF ((stderr, "Shifting error token, ")); 
    1564  
    15651588  *++yyvsp = yylval; 
    15661589 
     1590 
     1591  /* Shift the error token. */ 
     1592  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 
    15671593 
    15681594  yystate = yyn; 
     
    15811607`-----------------------------------*/ 
    15821608yyabortlab: 
     1609  yydestruct ("Error: discarding lookahead", 
     1610              yytoken, &yylval); 
     1611  yychar = YYEMPTY; 
    15831612  yyresult = 1; 
    15841613  goto yyreturn; 
     
    16031632 
    16041633 
    1605 #line 265 "parser.y" 
     1634#line 266 "parser.y" 
    16061635 
    16071636 
  • nepenthes/trunk/modules/shellcode-signatures/y.tab.h

    r462 r467  
    1 /* A Bison parser, made by GNU Bison 1.875d.  */ 
     1/* A Bison parser, made by GNU Bison 2.0.  */ 
    22 
    33/* Skeleton parser for Yacc-like parsing with Bison,