Skip to content

Commit

Permalink
Add code to fetch dynamic-x info in potfile if there's dynamic-x enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteube committed Nov 17, 2023
1 parent dad4609 commit d2d27cd
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/potfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int sort_by_hash_t_salt (const void *v1, const void *v2)
}
*/

// this function is special and only used whenever --username and --show are used together:
// this function is special and only used whenever --username or --dynamic-x and --show are used together:
// it will sort all tree entries according to the settings stored in hashconfig

int sort_pot_tree_by_hash (const void *v1, const void *v2)
Expand Down Expand Up @@ -425,7 +425,7 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
}

// we only need this variable in a very specific situation:
// whenever we use --username and --show together we want to keep all hashes sorted within a nice structure
// whenever we use --username or --dynamic-x and --show together we want to keep all hashes sorted within a nice structure

pot_tree_entry_t *all_hashes_tree = NULL;
pot_tree_entry_t *tree_entry_cache = NULL;
Expand Down Expand Up @@ -699,6 +699,23 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx)

out_buf[out_len] = 0;

// dynamic-x

unsigned char *dynamicx_buf = NULL;

u32 dynamicx_len = 0;

dynamicx_t *dynamicx = hash1->hash_info->dynamicx;

if (dynamicx)
{
dynamicx_buf = (unsigned char *) (dynamicx->dynamicx_buf);

dynamicx_len = dynamicx->dynamicx_len;

dynamicx_buf[dynamicx_len] = 0;
}

// user
unsigned char *username = NULL;

Expand Down

0 comments on commit d2d27cd

Please sign in to comment.