Changeset 591
- Timestamp:
- 07/21/06 22:00:24 (2 years ago)
- Files:
-
- nepenthes/trunk/modules/shellcode-signatures/Makefile.am (modified) (2 diffs)
- nepenthes/trunk/modules/shellcode-signatures/lex.nepenthes_shellcodesignatures_yy.c (deleted)
- nepenthes/trunk/modules/shellcode-signatures/signature_parser.y (moved) (moved from nepenthes/trunk/modules/shellcode-signatures/parser.y) (4 diffs)
- nepenthes/trunk/modules/shellcode-signatures/signature_scanner.l (moved) (moved from nepenthes/trunk/modules/shellcode-signatures/parser.l) (1 diff)
- nepenthes/trunk/modules/shellcode-signatures/y.tab.c (deleted)
- nepenthes/trunk/modules/shellcode-signatures/y.tab.h (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/modules/shellcode-signatures/Makefile.am
r556 r591 10 10 AM_LDFLAGS = $(LIB_PCRE) 11 11 12 YACC += -d 13 LEX += -d 14 12 15 pkglib_LTLIBRARIES = shellcodesignatures.la 13 16 14 17 15 18 shellcodesignatures_la_SOURCES = shellcode-signatures.sc 16 shellcodesignatures_la_SOURCES += y.tab.c lex.nepenthes_shellcodesignatures_yy.c y.tab.h19 shellcodesignatures_la_SOURCES += signature_parser.y signature_scanner.l 17 20 shellcodesignatures_la_SOURCES += parser.hpp parser.h 18 21 shellcodesignatures_la_SOURCES += shellcode-signatures.cpp shellcode-signatures.hpp … … 30 33 shellcodesignatures_la_SOURCES += sch_namespace_konstanzxor.cpp sch_namespace_konstanzxor.hpp 31 34 shellcodesignatures_la_SOURCES += sch_namespace_alphanumericxor.cpp sch_namespace_alphanumericxor.hpp 32 shellcodesignatures_la_LDFLAGS = -module -no-undefined -avoid-version33 35 36 shellcodesignatures_la_LDFLAGS = @LEXLIB@ -module -no-undefined -avoid-version 37 nepenthes/trunk/modules/shellcode-signatures/signature_parser.y
r529 r591 15 15 inline int string_get_len(); 16 16 17 extern char * nepenthes_shellcodesignatures_yytext;18 extern int nepenthes_shellcodesignatures_yyleng;19 extern FILE * nepenthes_shellcodesignatures_yyin;17 extern char *yytext; 18 extern int yyleng; 19 extern FILE *yyin; 20 20 21 21 static struct sc_shellcode *shellcodes = NULL; … … 383 383 384 384 385 int nepenthes_shellcodesignatures_yyerror(char* s)385 int yyerror(char* s) 386 386 { 387 387 snprintf(error_buffer, sizeof(error_buffer), 388 "%s at '%s' on line %d", s, nepenthes_shellcodesignatures_yytext, line_number);388 "%s at '%s' on line %d", s, yytext, line_number); 389 389 return 0; 390 390 } 391 391 392 392 393 int nepenthes_shellcodesignatures_yywrap()393 int yywrap() 394 394 { 395 395 return 1; … … 398 398 struct sc_shellcode *sc_parse_file(const char *filename) 399 399 { 400 nepenthes_shellcodesignatures_yyin = fopen(filename, "r");401 402 if ( nepenthes_shellcodesignatures_yyin == NULL )400 yyin = fopen(filename, "r"); 401 402 if ( yyin == NULL ) 403 403 { 404 404 snprintf(error_buffer, sizeof(error_buffer), "%s", strerror(errno)); … … 407 407 408 408 init_shellcode(); 409 if ( nepenthes_shellcodesignatures_yyparse() != 0 )410 { 411 fclose( nepenthes_shellcodesignatures_yyin);409 if ( yyparse() != 0 ) 410 { 411 fclose(yyin); 412 412 /* TODO free partially alloc'd shellcodes */ 413 413 return NULL; 414 414 } 415 fclose( nepenthes_shellcodesignatures_yyin);415 fclose(yyin); 416 416 // taken from shellcode-generic/sch_generic_stuttgart.cpp 417 417 return shellcodes; nepenthes/trunk/modules/shellcode-signatures/signature_scanner.l
r520 r591 2 2 %{ 3 3 #include <string.h> 4 #include " y.tab.h"4 #include "signature_parser.h" 5 5 6 6 inline void string_reset();
