Changeset 448
- Timestamp:
- 03/30/06 01:49:17 (3 years ago)
- Files:
-
- nepenthes/trunk/modules/shellcode-signatures/parser.h (modified) (1 diff)
- nepenthes/trunk/modules/shellcode-signatures/parser.y (modified) (1 diff)
- nepenthes/trunk/modules/shellcode-signatures/sch_namespace.cpp (modified) (2 diffs)
- nepenthes/trunk/modules/shellcode-signatures/sch_namespace_bindfiletransfer.hpp (modified) (1 diff)
- nepenthes/trunk/modules/shellcode-signatures/shellcode-signatures.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/modules/shellcode-signatures/parser.h
r436 r448 56 56 57 57 extern struct sc_shellcode *sc_parse_file(const char *); 58 extern int sc_free_shellcodes(struct sc_shellcode *s); 58 59 extern char *sc_get_error(); 59 60 nepenthes/trunk/modules/shellcode-signatures/parser.y
r447 r448 280 280 } 281 281 282 int free_shellcode(struct sc_shellcode *s) 283 { 284 free(s->name); 285 free(s->author); 286 free(s->reference); 287 free(s->pattern); 288 return 0; 289 } 290 291 int sc_free_shellcodes(struct sc_shellcode *s) 292 { 293 struct sc_shellcode *next = s; 294 int i=0; 295 while ((next = s->next) != NULL) 296 { 297 free_shellcode(s); 298 s = next; 299 i++; 300 } 301 return i; 302 } 282 303 283 304 char *sc_get_namespace_by_numeric(int num) nepenthes/trunk/modules/shellcode-signatures/sch_namespace.cpp
r445 r448 64 64 m_MapItems = sc->map_items; 65 65 66 // m_Author = sc->author; 67 m_Pattern = sc->pattern; 68 // m_Reference = sc->reference; 66 if (sc->pattern != NULL) 67 { 68 m_Pattern = sc->pattern; 69 }else 70 { 71 m_Pattern = ""; 72 } 73 74 75 if (sc->author != NULL) 76 { 77 m_Author = sc->author; 78 }else 79 { 80 m_Author = "unknown"; 81 } 82 83 84 85 if (sc->reference != NULL) 86 { 87 m_Reference = sc->reference; 88 }else 89 { 90 m_Reference = "no docs"; 91 } 69 92 70 93 m_Pcre = NULL; … … 77 100 } 78 101 79 80 102 bool NamespaceShellcodeHandler::Init() 81 103 { 82 104 const char * pcreEerror; 83 105 int32_t pcreErrorPos; 106 84 107 if ( (m_Pcre = pcre_compile(m_Pattern.c_str(), PCRE_DOTALL, &pcreEerror, (int *)&pcreErrorPos, 0)) == NULL ) 85 108 { nepenthes/trunk/modules/shellcode-signatures/sch_namespace_bindfiletransfer.hpp
r445 r448 31 31 #define HAVE_NAMESPACE_BINDFILETRANSFER_HPP 32 32 33 #include <stdint.h> 33 34 34 #include "sch_namespace.hpp" 35 35 nepenthes/trunk/modules/shellcode-signatures/shellcode-signatures.cpp
r443 r448 52 52 #undef STDTAGS 53 53 #endif 54 #define STDTAGS l_mod | l_dia | l_hlr 55 54 #define STDTAGS l_mod | l_sc 56 55 57 56 … … 191 190 } 192 191 193 192 int freed_shellcode = sc_free_shellcodes(sc_free); 193 194 logSpam("Free'd %i shellcodes\n",freed_shellcode); 194 195 195 196 return load_success;
