Returncode: Added dedicated returncode (see docs/status_codes.txt) for shutdowns caused by --runtime and checkpoint keypress
This commit is contained in:
parent
ae5b75d65c
commit
c7999c66bc
@ -61,6 +61,7 @@
|
|||||||
- OpenCL Runtime: Updated hashcat.hctune for Iris Pro GPU on OSX
|
- OpenCL Runtime: Updated hashcat.hctune for Iris Pro GPU on OSX
|
||||||
- Potfile: In v3.10 already, the default potfile suffix changed but the note about was missing. The "hashcat.pot" became "hashcat.potfile"
|
- Potfile: In v3.10 already, the default potfile suffix changed but the note about was missing. The "hashcat.pot" became "hashcat.potfile"
|
||||||
- Potfile: Added old potfile detection, show warning message
|
- Potfile: Added old potfile detection, show warning message
|
||||||
|
- Returncode: Added dedicated returncode (see docs/status_codes.txt) for shutdowns caused by --runtime and checkpoint keypress
|
||||||
- Sanity: Added sanity check to disallow --speed-only in combination with -i
|
- Sanity: Added sanity check to disallow --speed-only in combination with -i
|
||||||
- Sanity: Added sanity check to disallow --loopback in combination with --runtime
|
- Sanity: Added sanity check to disallow --loopback in combination with --runtime
|
||||||
- Threads: Replaced all calls to ctime() with ctime_r() to ensure thread safety
|
- Threads: Replaced all calls to ctime() with ctime_r() to ensure thread safety
|
||||||
|
|||||||
@ -6,3 +6,5 @@ status codes on exit:
|
|||||||
0 = OK/cracked
|
0 = OK/cracked
|
||||||
1 = exhausted
|
1 = exhausted
|
||||||
2 = aborted
|
2 = aborted
|
||||||
|
3 = aborted by checkpoint
|
||||||
|
4 = aborted by runtime
|
||||||
|
|||||||
@ -57,6 +57,8 @@ void hc_signal (void (callback) (int));
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int mycracked (hashcat_ctx_t *hashcat_ctx);
|
int mycracked (hashcat_ctx_t *hashcat_ctx);
|
||||||
|
int myabort_runtime (hashcat_ctx_t *hashcat_ctx);
|
||||||
|
int myabort_checkpoint (hashcat_ctx_t *hashcat_ctx);
|
||||||
int myabort (hashcat_ctx_t *hashcat_ctx);
|
int myabort (hashcat_ctx_t *hashcat_ctx);
|
||||||
int myquit (hashcat_ctx_t *hashcat_ctx);
|
int myquit (hashcat_ctx_t *hashcat_ctx);
|
||||||
int bypass (hashcat_ctx_t *hashcat_ctx);
|
int bypass (hashcat_ctx_t *hashcat_ctx);
|
||||||
|
|||||||
@ -169,6 +169,8 @@ typedef enum status_rc
|
|||||||
STATUS_ABORTED = 6,
|
STATUS_ABORTED = 6,
|
||||||
STATUS_QUIT = 7,
|
STATUS_QUIT = 7,
|
||||||
STATUS_BYPASS = 8,
|
STATUS_BYPASS = 8,
|
||||||
|
STATUS_ABORTED_CHECKPOINT = 9,
|
||||||
|
STATUS_ABORTED_RUNTIME = 10,
|
||||||
|
|
||||||
} status_rc_t;
|
} status_rc_t;
|
||||||
|
|
||||||
|
|||||||
@ -241,8 +241,15 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
hcfree (threads_param);
|
hcfree (threads_param);
|
||||||
|
|
||||||
|
if ((status_ctx->devices_status == STATUS_RUNNING) && (status_ctx->checkpoint_shutdown == true))
|
||||||
|
{
|
||||||
|
myabort_checkpoint (hashcat_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
if ((status_ctx->devices_status != STATUS_CRACKED)
|
if ((status_ctx->devices_status != STATUS_CRACKED)
|
||||||
&& (status_ctx->devices_status != STATUS_ABORTED)
|
&& (status_ctx->devices_status != STATUS_ABORTED)
|
||||||
|
&& (status_ctx->devices_status != STATUS_ABORTED_CHECKPOINT)
|
||||||
|
&& (status_ctx->devices_status != STATUS_ABORTED_RUNTIME)
|
||||||
&& (status_ctx->devices_status != STATUS_QUIT)
|
&& (status_ctx->devices_status != STATUS_QUIT)
|
||||||
&& (status_ctx->devices_status != STATUS_BYPASS))
|
&& (status_ctx->devices_status != STATUS_BYPASS))
|
||||||
{
|
{
|
||||||
@ -1112,6 +1119,8 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
if (rc_final == 0)
|
if (rc_final == 0)
|
||||||
{
|
{
|
||||||
|
if (status_ctx->devices_status == STATUS_ABORTED_RUNTIME) rc_final = 4;
|
||||||
|
if (status_ctx->devices_status == STATUS_ABORTED_CHECKPOINT) rc_final = 3;
|
||||||
if (status_ctx->devices_status == STATUS_ABORTED) rc_final = 2;
|
if (status_ctx->devices_status == STATUS_ABORTED) rc_final = 2;
|
||||||
if (status_ctx->devices_status == STATUS_QUIT) rc_final = 2;
|
if (status_ctx->devices_status == STATUS_QUIT) rc_final = 2;
|
||||||
if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = 1;
|
if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = 1;
|
||||||
|
|||||||
@ -290,7 +290,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
|||||||
{
|
{
|
||||||
EVENT_DATA (EVENT_MONITOR_RUNTIME_LIMIT, NULL, 0);
|
EVENT_DATA (EVENT_MONITOR_RUNTIME_LIMIT, NULL, 0);
|
||||||
|
|
||||||
myabort (hashcat_ctx);
|
myabort_runtime (hashcat_ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,8 @@ static const char ST_0005[] = "Cracked";
|
|||||||
static const char ST_0006[] = "Aborted";
|
static const char ST_0006[] = "Aborted";
|
||||||
static const char ST_0007[] = "Quit";
|
static const char ST_0007[] = "Quit";
|
||||||
static const char ST_0008[] = "Bypass";
|
static const char ST_0008[] = "Bypass";
|
||||||
|
static const char ST_0009[] = "Aborted (Checkpoint)";
|
||||||
|
static const char ST_0010[] = "Aborted (Runtime)";
|
||||||
static const char ST_9999[] = "Unknown! Bug!";
|
static const char ST_9999[] = "Unknown! Bug!";
|
||||||
|
|
||||||
static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' };
|
static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' };
|
||||||
@ -205,6 +207,8 @@ char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
|
|||||||
case STATUS_ABORTED: return ((char *) ST_0006);
|
case STATUS_ABORTED: return ((char *) ST_0006);
|
||||||
case STATUS_QUIT: return ((char *) ST_0007);
|
case STATUS_QUIT: return ((char *) ST_0007);
|
||||||
case STATUS_BYPASS: return ((char *) ST_0008);
|
case STATUS_BYPASS: return ((char *) ST_0008);
|
||||||
|
case STATUS_ABORTED_CHECKPOINT: return ((char *) ST_0009);
|
||||||
|
case STATUS_ABORTED_RUNTIME: return ((char *) ST_0010);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((char *) ST_9999);
|
return ((char *) ST_9999);
|
||||||
|
|||||||
32
src/thread.c
32
src/thread.c
@ -120,8 +120,6 @@ int mycracked (hashcat_ctx_t *hashcat_ctx)
|
|||||||
{
|
{
|
||||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||||
|
|
||||||
//if (status_ctx->devices_status != STATUS_RUNNING) return;
|
|
||||||
|
|
||||||
status_ctx->devices_status = STATUS_CRACKED;
|
status_ctx->devices_status = STATUS_CRACKED;
|
||||||
|
|
||||||
status_ctx->run_main_level1 = false;
|
status_ctx->run_main_level1 = false;
|
||||||
@ -133,6 +131,36 @@ int mycracked (hashcat_ctx_t *hashcat_ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int myabort_checkpoint (hashcat_ctx_t *hashcat_ctx)
|
||||||
|
{
|
||||||
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||||
|
|
||||||
|
status_ctx->devices_status = STATUS_ABORTED_CHECKPOINT;
|
||||||
|
|
||||||
|
status_ctx->run_main_level1 = false;
|
||||||
|
status_ctx->run_main_level2 = false;
|
||||||
|
status_ctx->run_main_level3 = false;
|
||||||
|
status_ctx->run_thread_level1 = false;
|
||||||
|
status_ctx->run_thread_level2 = false;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int myabort_runtime (hashcat_ctx_t *hashcat_ctx)
|
||||||
|
{
|
||||||
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||||
|
|
||||||
|
status_ctx->devices_status = STATUS_ABORTED_RUNTIME;
|
||||||
|
|
||||||
|
status_ctx->run_main_level1 = false;
|
||||||
|
status_ctx->run_main_level2 = false;
|
||||||
|
status_ctx->run_main_level3 = false;
|
||||||
|
status_ctx->run_thread_level1 = false;
|
||||||
|
status_ctx->run_thread_level2 = false;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int myabort (hashcat_ctx_t *hashcat_ctx)
|
int myabort (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user