1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Add global dynamic-x hash mode extraction function

This commit is contained in:
jsteube 2023-11-08 14:43:45 +00:00
parent 4da995cf88
commit 2d3ebf1d4e
2 changed files with 31 additions and 0 deletions

View File

@ -104,6 +104,8 @@ int generic_salt_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, const u8
int input_tokenizer (const u8 *input_buf, const int input_len, hc_token_t *token); int input_tokenizer (const u8 *input_buf, const int input_len, hc_token_t *token);
int extract_dynamic_x (const u8 *input_buf);
#if defined (__APPLE__) #if defined (__APPLE__)
bool is_apple_silicon (void); bool is_apple_silicon (void);
#endif #endif

View File

@ -1483,3 +1483,32 @@ char *file_to_buffer (const char *filename)
return NULL; return NULL;
} }
int extract_dynamic_x (const u8 *input_buf)
{
/*
if (input_len < 12) return -1;
if (input_buf[0] != '$') return -1;
if (input_buf[1] != 'd') return -1;
if (input_buf[2] != 'y') return -1;
if (input_buf[3] != 'n') return -1;
if (input_buf[4] != 'a') return -1;
if (input_buf[5] != 'm') return -1;
if (input_buf[6] != 'i') return -1;
if (input_buf[7] != 'c') return -1;
if (input_buf[8] != '_') return -1;
int digit_len = 0;
for (int i = 0; i < input_len; i++)
{
}
*/
int hash_mode = -1;
if (sscanf ((char *) input_buf, "$dynamic_%d$", &hash_mode) != 1) return -1;
return hash_mode;
}