afl: fix various --afl-* options

pull/2143/head
Victor Julien 10 years ago
parent d4f8445564
commit b673e14411

@ -1384,26 +1384,41 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
} }
#ifdef AFLFUZZ_RULES #ifdef AFLFUZZ_RULES
} else if(strcmp((long_opts[option_index]).name, "afl-rules") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-rules") == 0) {
MpmTableSetup();
SpmTableSetup();
exit(RuleParseDataFromFile(optarg)); exit(RuleParseDataFromFile(optarg));
#endif #endif
#ifdef AFLFUZZ_APPLAYER #ifdef AFLFUZZ_APPLAYER
} else if(strcmp((long_opts[option_index]).name, "afl-http-request") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-http-request") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterHTPParsers(); RegisterHTPParsers();
exit(AppLayerParserRequestFromFile(ALPROTO_HTTP, optarg)); exit(AppLayerParserRequestFromFile(ALPROTO_HTTP, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-http") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-http") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterHTPParsers(); RegisterHTPParsers();
exit(AppLayerParserFromFile(ALPROTO_HTTP, optarg)); exit(AppLayerParserFromFile(ALPROTO_HTTP, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-tls-request") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-tls-request") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup();
RegisterSSLParsers(); RegisterSSLParsers();
exit(AppLayerParserRequestFromFile(ALPROTO_TLS, optarg)); exit(AppLayerParserRequestFromFile(ALPROTO_TLS, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-tls") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-tls") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterSSLParsers(); RegisterSSLParsers();
exit(AppLayerParserFromFile(ALPROTO_TLS, optarg)); exit(AppLayerParserFromFile(ALPROTO_TLS, optarg));
@ -1420,20 +1435,33 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
} else if(strcmp((long_opts[option_index]).name, "afl-ssh-request") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-ssh-request") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
RegisterSSHParsers(); RegisterSSHParsers();
exit(AppLayerParserRequestFromFile(ALPROTO_SSH, optarg)); exit(AppLayerParserRequestFromFile(ALPROTO_SSH, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-ssh") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-ssh") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterSSHParsers(); RegisterSSHParsers();
exit(AppLayerParserFromFile(ALPROTO_SSH, optarg)); exit(AppLayerParserFromFile(ALPROTO_SSH, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-ftp-request") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-ftp-request") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup();
RegisterFTPParsers(); RegisterFTPParsers();
exit(AppLayerParserRequestFromFile(ALPROTO_FTP, optarg)); exit(AppLayerParserRequestFromFile(ALPROTO_FTP, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-ftp") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-ftp") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterFTPParsers(); RegisterFTPParsers();
exit(AppLayerParserFromFile(ALPROTO_FTP, optarg)); exit(AppLayerParserFromFile(ALPROTO_FTP, optarg));
@ -1441,22 +1469,32 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
} else if(strcmp((long_opts[option_index]).name, "afl-smtp-request") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-smtp-request") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup(); MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterSMTPParsers(); RegisterSMTPParsers();
exit(AppLayerParserRequestFromFile(ALPROTO_SMTP, optarg)); exit(AppLayerParserRequestFromFile(ALPROTO_SMTP, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-smtp") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-smtp") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup(); MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterSMTPParsers(); RegisterSMTPParsers();
exit(AppLayerParserFromFile(ALPROTO_SMTP, optarg)); exit(AppLayerParserFromFile(ALPROTO_SMTP, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-smb-request") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-smb-request") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
RegisterSMBParsers(); RegisterSMBParsers();
exit(AppLayerParserRequestFromFile(ALPROTO_SMB, optarg)); exit(AppLayerParserRequestFromFile(ALPROTO_SMB, optarg));
} else if(strcmp((long_opts[option_index]).name, "afl-smb") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-smb") == 0) {
//printf("arg: //%s\n", optarg); //printf("arg: //%s\n", optarg);
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
AppLayerParserSetup(); AppLayerParserSetup();
RegisterSMBParsers(); RegisterSMBParsers();
exit(AppLayerParserFromFile(ALPROTO_SMB, optarg)); exit(AppLayerParserFromFile(ALPROTO_SMB, optarg));
@ -1481,6 +1519,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
} else if(strcmp((long_opts[option_index]).name, "afl-decoder-ppp") == 0) { } else if(strcmp((long_opts[option_index]).name, "afl-decoder-ppp") == 0) {
StatsInit(); StatsInit();
MpmTableSetup(); MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup(); AppLayerProtoDetectSetup();
DefragInit(); DefragInit();
FlowInitConfig(FLOW_QUIET); FlowInitConfig(FLOW_QUIET);

Loading…
Cancel
Save