Changeset 470
- Timestamp:
- 04/04/06 09:23:41 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/modules/shellcode-signatures/parser.y
r468 r470 59 59 : identifier SC_LBR statements SC_RBR SC_SEMI 60 60 { 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 77 61 /* 78 62 printf("shellcode:\n"); … … 92 76 printf("\n\n"); 93 77 */ 78 94 79 /* prepare for the next one */ 95 80 init_shellcode(); … … 195 180 196 181 map_values 197 : map_value map_value_comma_list198 { 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 ; 202 187 203 188 map_value_comma_list 204 189 : /* \epsilon */ 205 | SC_COMMA map_value map_value_comma_list190 | map_value_comma_list map_value SC_COMMA 206 191 { 207 192 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. */ 2 2 3 3 /* 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. 5 5 6 6 This program is free software; you can redistribute it and/or modify … … 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 5 9 Temple Place - Suite 330,19 Boston, MA 0211 1-1307, USA. */18 Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 Boston, MA 02110-1301, USA. */ 20 20 21 21 /* As a special exception, when this file is copied by Bison into a … … 36 36 /* Identify Bison output. */ 37 37 #define YYBISON 1 38 39 /* Bison version. */ 40 #define YYBISON_VERSION "2.1" 38 41 39 42 /* Skeleton name. */ … … 95 98 }; 96 99 #endif 100 /* Tokens. */ 97 101 #define SC_ID 258 98 102 #define SC_LPAR 259 … … 185 189 #endif 186 190 191 /* Enabling the token table. */ 192 #ifndef YYTOKEN_TABLE 193 # define YYTOKEN_TABLE 0 194 #endif 195 187 196 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 188 197 typedef int YYSTYPE; … … 197 206 198 207 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 201 236 202 237 #if ! defined (yyoverflow) || YYERROR_VERBOSE 203 204 # ifndef YYFREE205 # define YYFREE free206 # endif207 # ifndef YYMALLOC208 # define YYMALLOC malloc209 # endif210 238 211 239 /* The parser invokes alloca or malloc; define the necessary symbols. */ … … 217 245 # else 218 246 # 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 219 251 # endif 220 252 # endif … … 224 256 /* Pacify GCC's `empty if-body' warning. */ 225 257 # 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 226 265 # else 227 # if defined (__STDC__) || defined (__cplusplus)228 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */229 # define YYSIZE_T size_t230 # endif231 266 # define YYSTACK_ALLOC YYMALLOC 232 267 # define YYSTACK_FREE YYFREE 268 # ifndef YYSTACK_ALLOC_MAXIMUM 269 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) 270 # endif 271 # ifdef __cplusplus 272 extern "C" { 273 # endif 274 # ifndef YYMALLOC 275 # define YYMALLOC malloc 276 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ 277 && (defined (__STDC__) || defined (__cplusplus))) 278 void *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))) 285 void free (void *); /* INFRINGES ON USER NAME SPACE */ 286 # endif 287 # endif 288 # ifdef __cplusplus 289 } 290 # endif 233 291 # endif 234 292 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ … … 265 323 do \ 266 324 { \ 267 register YYSIZE_T yyi;\325 YYSIZE_T yyi; \ 268 326 for (yyi = 0; yyi < (Count); yyi++) \ 269 327 (To)[yyi] = (From)[yyi]; \ … … 300 358 #define YYFINAL 2 301 359 /* YYLAST -- Last index in YYTABLE. */ 302 #define YYLAST 4 7360 #define YYLAST 44 303 361 304 362 /* YYNTOKENS -- Number of terminals. */ … … 309 367 #define YYNRULES 45 310 368 /* YYNRULES -- Number of states. */ 311 #define YYNSTATES 6 2369 #define YYNSTATES 60 312 370 313 371 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ … … 315 373 #define YYMAXUTOK 296 316 374 317 #define YYTRANSLATE(YYX) \375 #define YYTRANSLATE(YYX) \ 318 376 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 319 377 … … 374 432 28, -1, -1, 48, 47, -1, 49, 9, -1, 55, 375 433 -1, 50, -1, 51, -1, 12, 11, -1, 15, 4, 376 52, 5, -1, 5 4, 53, -1, -1, 8, 54, 53,434 52, 5, -1, 53, 54, -1, -1, 53, 54, 8, 377 435 -1, 29, -1, 30, -1, 31, -1, 32, -1, 34, 378 436 -1, 33, -1, 35, -1, 36, -1, 37, -1, 38, … … 384 442 static const unsigned short int yyrline[] = 385 443 { 386 0, 53, 53, 55, 59, 100, 109, 114, 119, 124,387 1 29, 134, 139, 144, 149, 154, 159, 164, 170, 172,388 1 76, 180, 181, 182, 186, 193, 197, 204, 206, 214,389 2 18, 222, 226, 230, 234, 238, 242, 246, 250, 254,390 2 58, 262, 266, 273, 281, 283444 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 391 449 }; 392 450 #endif 393 451 394 #if YYDEBUG || YYERROR_VERBOSE 395 /* YYTN ME[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. 396 454 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 397 455 static const char *const yytname[] = … … 453 511 16, 13, 14, 15, 17, 3, 0, 0, 18, 0, 454 512 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 459 516 }; 460 517 … … 463 520 { 464 521 -1, 1, 15, 16, 17, 23, 24, 25, 26, 27, 465 53, 59, 54, 28, 38522 39, 40, 58, 28, 38 466 523 }; 467 524 468 525 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 469 526 STATE-NUM. */ 470 #define YYPACT_NINF -1 7527 #define YYPACT_NINF -12 471 528 static const yysigned_char yypact[] = 472 529 { 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 480 536 }; 481 537 … … 483 539 static const yysigned_char yypgoto[] = 484 540 { 485 -1 7, -17, -17, -17, -17, -7, -17, -17, -17, -17,486 -1 7, -16, -13, -17, 10541 -12, -12, -12, -12, -12, -7, -12, -12, -12, -12, 542 -12, -12, -12, -12, 7 487 543 }; 488 544 … … 494 550 static const unsigned char yytable[] = 495 551 { 496 39, 18, 20, 21, 19, 22, 29, 31, 30, 32,497 33, 35, 36, 55, 2, 37, 57, 34, 40, 41,498 4 2, 43, 44, 45, 46, 47, 48, 49, 50, 51,499 5 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,500 12, 13, 14, 5 8, 61, 60, 0, 56552 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 501 557 }; 502 558 503 static const yysigned_char yycheck[] =559 static const unsigned char yycheck[] = 504 560 { 505 561 11, 6, 12, 13, 10, 15, 10, 16, 11, 4, … … 507 563 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 508 564 41, 17, 18, 19, 20, 21, 22, 23, 24, 25, 509 26, 27, 28, 8, 60, 58, -1,37565 26, 27, 28, 8, 37 510 566 }; 511 567 … … 517 573 24, 25, 26, 27, 28, 44, 45, 46, 6, 10, 518 574 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 523 578 }; 524 525 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)526 # define YYSIZE_T __SIZE_TYPE__527 #endif528 #if ! defined (YYSIZE_T) && defined (size_t)529 # define YYSIZE_T size_t530 #endif531 #if ! defined (YYSIZE_T)532 # if defined (__STDC__) || defined (__cplusplus)533 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */534 # define YYSIZE_T size_t535 # endif536 #endif537 #if ! defined (YYSIZE_T)538 # define YYSIZE_T unsigned int539 #endif540 579 541 580 #define yyerrok (yyerrstatus = 0) … … 568 607 } \ 569 608 else \ 570 { \571 yyerror ( "syntax error: cannot back up");\609 { \ 610 yyerror (YY_("syntax error: cannot back up")); \ 572 611 YYERROR; \ 573 612 } \ … … 648 687 { \ 649 688 YYFPRINTF (stderr, "%s ", Title); \ 650 yysymprint (stderr, \689 yysymprint (stderr, \ 651 690 Type, Value); \ 652 691 YYFPRINTF (stderr, "\n"); \ … … 696 735 { 697 736 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), ", 700 739 yyrule - 1, yylno); 701 740 /* Print the symbols being reduced, and their result. */ 702 741 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]]); 705 744 } 706 745 … … 731 770 732 771 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) 734 773 evaluated with infinite-precision integer arithmetic. */ 735 774 … … 755 794 # endif 756 795 { 757 registerconst char *yys = yystr;796 const char *yys = yystr; 758 797 759 798 while (*yys++ != '\0') … … 780 819 # endif 781 820 { 782 registerchar *yyd = yydest;783 registerconst char *yys = yysrc;821 char *yyd = yydest; 822 const char *yys = yysrc; 784 823 785 824 while ((*yyd++ = *yys++) != '\0') … … 791 830 # endif 792 831 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. */ 840 static YYSIZE_T 841 yytnamerr (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 */ 794 881 795 882 … … 911 998 int 912 999 yyparse () 913 1000 ; 914 1001 #endif 915 1002 #endif 916 1003 { 917 1004 918 registerint yystate;919 registerint yyn;1005 int yystate; 1006 int yyn; 920 1007 int yyresult; 921 1008 /* Number of tokens to shift before error messages enabled. */ … … 935 1022 short int yyssa[YYINITDEPTH]; 936 1023 short int *yyss = yyssa; 937 registershort int *yyssp;1024 short int *yyssp; 938 1025 939 1026 /* The semantic value stack. */ 940 1027 YYSTYPE yyvsa[YYINITDEPTH]; 941 1028 YYSTYPE *yyvs = yyvsa; 942 registerYYSTYPE *yyvsp;1029 YYSTYPE *yyvsp; 943 1030 944 1031 … … 971 1058 yyssp = yyss; 972 1059 yyvsp = yyvs; 973 974 975 yyvsp[0] = yylval;976 1060 977 1061 goto yysetstate; … … 1007 1091 conditional around just the two extra args, but that might 1008 1092 be undefined if yyoverflow is a macro. */ 1009 yyoverflow ( "parser stack overflow",1093 yyoverflow (YY_("memory exhausted"), 1010 1094 &yyss1, yysize * sizeof (*yyssp), 1011 1095 &yyvs1, yysize * sizeof (*yyvsp), … … 1018 1102 #else /* no yyoverflow */ 1019 1103 # ifndef YYSTACK_RELOCATE 1020 goto yy overflowlab;1104 goto yyexhaustedlab; 1021 1105 # else 1022 1106 /* Extend the stack our own way. */ 1023 1107 if (YYMAXDEPTH <= yystacksize) 1024 goto yy overflowlab;1108 goto yyexhaustedlab; 1025 1109 yystacksize *= 2; 1026 1110 if (YYMAXDEPTH < yystacksize) … … 1032 1116 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1033 1117 if (! yyptr) 1034 goto yy overflowlab;1118 goto yyexhaustedlab; 1035 1119 YYSTACK_RELOCATE (yyss); 1036 1120 YYSTACK_RELOCATE (yyvs); … … 1163 1247 #line 60 "parser.y" 1164 1248 { 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 /* 1182 1250 printf("shellcode:\n"); 1183 1251 … … 1195 1263 1196 1264 printf("\n\n"); 1265 */ 1197 1266 1198 1267 /* prepare for the next one */ … … 1202 1271 1203 1272 case 5: 1204 #line 101"parser.y"1273 #line 86 "parser.y" 1205 1274 { 1206 1275 shellcodes->nspace = (yyvsp[-3]); … … 1211 1280 1212 1281 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: 1213 1303 #line 110 "parser.y" 1214 1304 { 1215 (yyval) = sc_ xor;1216 } 1217 break; 1218 1219 case 7:1305 (yyval) = sc_leimbachxor; 1306 } 1307 break; 1308 1309 case 10: 1220 1310 #line 115 "parser.y" 1221 1311 { 1222 (yyval) = sc_ linkxor;1223 } 1224 break; 1225 1226 case 8:1312 (yyval) = sc_bindshell; 1313 } 1314 break; 1315 1316 case 11: 1227 1317 #line 120 "parser.y" 1228 1318 { 1229 (yyval) = sc_ konstanzxor;1230 } 1231 break; 1232 1233 case 9:1319 (yyval) = sc_connectbackshell; 1320 } 1321 break; 1322 1323 case 12: 1234 1324 #line 125 "parser.y" 1235 1325 { 1236 (yyval) = sc_ leimbachxor;1237 } 1238 break; 1239 1240 case 1 0:1326 (yyval) = sc_connectbackfiletransfer; 1327 } 1328 break; 1329 1330 case 13: 1241 1331 #line 130 "parser.y" 1242 1332 { 1243 (yyval) = sc_ bindshell;1244 } 1245 break; 1246 1247 case 1 1:1333 (yyval) = sc_execute; 1334 } 1335 break; 1336 1337 case 14: 1248 1338 #line 135 "parser.y" 1249 1339 { 1250 (yyval) = sc_ connectbackshell;1251 } 1252 break; 1253 1254 case 1 2:1340 (yyval) = sc_download; 1341 } 1342 break; 1343 1344 case 15: 1255 1345 #line 140 "parser.y" 1256 1346 { 1257 (yyval) = sc_ connectbackfiletransfer;1258 } 1259 break; 1260 1261 case 1 3:1347 (yyval) = sc_url; 1348 } 1349 break; 1350 1351 case 16: 1262 1352 #line 145 "parser.y" 1263 1353 { 1264 (yyval) = sc_ execute;1265 } 1266 break; 1267 1268 case 1 4:1354 (yyval) = sc_bindfiletransfer; 1355 } 1356 break; 1357 1358 case 17: 1269 1359 #line 150 "parser.y" 1270 1360 { 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 {1292 1361 (yyval) = sc_base64; 1293 1362 } … … 1295 1364 1296 1365 case 24: 1297 #line 1 87"parser.y"1366 #line 172 "parser.y" 1298 1367 { 1299 1368 printf("flags none...\n"); … … 1302 1371 1303 1372 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" 1305 1381 { 1306 1382 if( shellcodes->map_items < (MAP_MAX - 1) ) … … 1309 1385 break; 1310 1386 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: 1312 1402 #line 207 "parser.y" 1313 1403 { 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: 1320 1416 #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"1349 1417 { 1350 1418 (yyval) = sc_port; … … 1353 1421 1354 1422 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: 1355 1451 #line 235 "parser.y" 1356 1452 { 1357 (yyval) = sc_ host;1358 } 1359 break; 1360 1361 case 3 5:1453 (yyval) = sc_pre; 1454 } 1455 break; 1456 1457 case 39: 1362 1458 #line 239 "parser.y" 1363 1459 { 1364 (yyval) = sc_ command;1365 } 1366 break; 1367 1368 case 36:1460 (yyval) = sc_post; 1461 } 1462 break; 1463 1464 case 40: 1369 1465 #line 243 "parser.y" 1370 1466 { 1371 (yyval) = sc_ uri;1372 } 1373 break; 1374 1375 case 37:1467 (yyval) = sc_none; 1468 } 1469 break; 1470 1471 case 41: 1376 1472 #line 247 "parser.y" 1377 1473 { 1378 (yyval) = sc_ pcre;1379 } 1380 break; 1381 1382 case 38:1474 (yyval) = sc_hostkey; 1475 } 1476 break; 1477 1478 case 42: 1383 1479 #line 251 "parser.y" 1384 1480 { 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 {1413 1481 (yyval) = sc_portkey; 1414 1482 } … … 1416 1484 1417 1485 case 43: 1418 #line 2 74"parser.y"1486 #line 258 "parser.y" 1419 1487 { 1420 1488 shellcodes->pattern = strndup(string_get_buffer(), string_get_len()); … … 1425 1493 1426 1494 1495 default: break; 1427 1496 } 1428 1497 1429 /* Line 1 037of yacc.c. */1430 #line 1 431"y.tab.c"1498 /* Line 1126 of yacc.c. */ 1499 #line 1500 "y.tab.c" 1431 1500 1432 1501 yyvsp -= yylen; … … 1467 1536 if (YYPACT_NINF < yyn && yyn < YYLAST) 1468 1537 { 1469 YYSIZE_T yysize = 0;1470 1538 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]; 1473 1546 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; 1474 1567 1475 1568 /* Start YYX at -YYN if negative to avoid negative indexes in … … 1480 1573 int yychecklim = YYLAST - yyn; 1481 1574 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 1485 1580 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1486 1581 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1487 1582 { 1488 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); 1489 yycount += 1; 1490 if (yycount == 5) 1583 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1491 1584 { 1492 yysize = 0; 1585 yycount = 1; 1586 yysize = yysize0; 1587 yyformat[sizeof yyunexpected - 1] = '\0'; 1493 1588 break; 1494 1589 } 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; 1495 1596 } 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) 1500 1606 { 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
