commit 558c2fab6a503c71139d708e17abe38c055bbaaa Author: magnum Date: Tue Sep 13 01:21:58 2011 +0200 john-1.7.8-external-events.diff by Solar diff --git a/run/john.conf b/run/john.conf index 659346b..f853bfb 100644 --- a/run/john.conf +++ b/run/john.conf @@ -1385,6 +1385,13 @@ void filter() word[i] = map2[(o & 0xfff) + (e >> 12)]; } +[List.External:TestAbort] +void filter() +{ + if (word[0] == 'a') + event_pending = event_abort = 1; +} + # dumb-force UTF-16, in an external file .include "$JOHN/dumb16.conf" diff --git a/src/external.c b/src/external.c index 547ed58..45da49e 100644 --- a/src/external.c +++ b/src/external.c @@ -12,6 +12,7 @@ #include "compiler.h" #include "loader.h" #include "logger.h" +#include "signals.h" #include "status.h" #include "recovery.h" #include "config.h" @@ -29,8 +30,20 @@ char *ext_mode = NULL; static c_int ext_word[PLAINTEXT_BUFFER_SIZE]; -static struct c_ident ext_globals = { +static struct c_ident ext_event_pending = { NULL, + "event_pending", + (int *)&event_pending +}; + +static struct c_ident ext_event_abort = { + &ext_event_pending, + "event_abort", + (int *)&event_abort +}; + +static struct c_ident ext_globals = { + &ext_event_abort, "word", ext_word };