mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-04 21:01:07 +00:00
Add [b] [c] and [f] functionality in pause state
Add the ability to [b]ypass, [c]heckpoint and [f]inish an attack while paused. I'm not too sure why it was limited to only [r]unning states but have not found any bugs in testing
This commit is contained in:
parent
6716447dfc
commit
475512a80e
16
src/status.c
16
src/status.c
@ -35,6 +35,8 @@ static const char *const ST_0013 = "Error";
|
||||
static const char *const ST_0014 = "Aborted (Finish)";
|
||||
static const char *const ST_0015 = "Running (Quit after attack requested)";
|
||||
static const char *const ST_0016 = "Autodetect";
|
||||
static const char *const ST_0017 = "Paused (Checkpoint Quit requested)";
|
||||
static const char *const ST_0018 = "Paused (Quit after attack requested)";
|
||||
static const char *const ST_9999 = "Unknown! Bug!";
|
||||
|
||||
static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' };
|
||||
@ -262,8 +264,6 @@ const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
const int devices_status = status_ctx->devices_status;
|
||||
|
||||
// special case: running but checkpoint quit requested
|
||||
|
||||
if (devices_status == STATUS_RUNNING)
|
||||
{
|
||||
if (status_ctx->checkpoint_shutdown == true)
|
||||
@ -276,6 +276,18 @@ const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
|
||||
return ST_0015;
|
||||
}
|
||||
}
|
||||
else if (devices_status == STATUS_PAUSED)
|
||||
{
|
||||
if (status_ctx->checkpoint_shutdown == true)
|
||||
{
|
||||
return ST_0017;
|
||||
}
|
||||
|
||||
if (status_ctx->finish_shutdown == true)
|
||||
{
|
||||
return ST_0018;
|
||||
}
|
||||
}
|
||||
|
||||
switch (devices_status)
|
||||
{
|
||||
|
@ -214,8 +214,6 @@ int bypass (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return -1;
|
||||
|
||||
status_ctx->devices_status = STATUS_BYPASS;
|
||||
|
||||
status_ctx->run_main_level1 = true;
|
||||
@ -262,8 +260,6 @@ int stop_at_checkpoint (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return -1;
|
||||
|
||||
// this feature only makes sense if --restore-disable was not specified
|
||||
|
||||
restore_ctx_t *restore_ctx = hashcat_ctx->restore_ctx;
|
||||
@ -305,8 +301,6 @@ int finish_after_attack (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return -1;
|
||||
|
||||
// Enable or Disable
|
||||
|
||||
if (status_ctx->finish_shutdown == false)
|
||||
|
Loading…
Reference in New Issue
Block a user