Skip to content

Commit

Permalink
Add more RC_FINAL_ enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteube committed Sep 12, 2022
1 parent 7a5ea7e commit 8973f2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/status_codes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ status codes on exit:
2 = aborted
3 = aborted by checkpoint
4 = aborted by runtime
5 = aborted by finish
9 changes: 7 additions & 2 deletions include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,13 @@ typedef enum status_rc

typedef enum rc_final
{
RC_FINAL_OK = 0,
RC_FINAL_EXHAUSTED = 1
RC_FINAL_ERROR = -1,
RC_FINAL_OK = 0,
RC_FINAL_EXHAUSTED = 1,
RC_FINAL_ABORT = 2,
RC_FINAL_ABORT_CHECKPOINT = 3,
RC_FINAL_ABORT_RUNTIME = 4,
RC_FINAL_ABORT_FINISH = 5,

} rc_final_t;

Expand Down
12 changes: 6 additions & 6 deletions src/hashcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,14 +1807,14 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx)

if (rc_final == 0)
{
if (status_ctx->devices_status == STATUS_ABORTED_FINISH) rc_final = 5;
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_QUIT) rc_final = 2;
if (status_ctx->devices_status == STATUS_ABORTED_FINISH) rc_final = RC_FINAL_ABORT_FINISH;
if (status_ctx->devices_status == STATUS_ABORTED_RUNTIME) rc_final = RC_FINAL_ABORT_RUNTIME;
if (status_ctx->devices_status == STATUS_ABORTED_CHECKPOINT) rc_final = RC_FINAL_ABORT_CHECKPOINT;
if (status_ctx->devices_status == STATUS_ABORTED) rc_final = RC_FINAL_ABORT;
if (status_ctx->devices_status == STATUS_QUIT) rc_final = RC_FINAL_ABORT;
if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = RC_FINAL_EXHAUSTED;
if (status_ctx->devices_status == STATUS_CRACKED) rc_final = RC_FINAL_OK;
if (status_ctx->devices_status == STATUS_ERROR) rc_final = -1;
if (status_ctx->devices_status == STATUS_ERROR) rc_final = RC_FINAL_ERROR;
}
else if (rc_final == -1)
{
Expand Down

0 comments on commit 8973f2b

Please sign in to comment.