mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-23 00:28:11 +00:00
fixed problem with cached word lists (dictstat2): nanoseconds must be considered/ignored too
This commit is contained in:
parent
4a4eb0ef7f
commit
d8e7f5f05c
@ -35,6 +35,7 @@
|
||||
- Fixed a parser error in multiple modes not checking for return code, resulting in negative memory index writes
|
||||
- Fixed a problem with changed current working directory, for instance by using --restore together with --remove
|
||||
- Fixed a problem with the conversion to the $HEX[] format: convert/hexify also all passwords of the format $HEX[]
|
||||
- Fixed the dictstat lookup if nanoseconds are used in timestamps for the cached files
|
||||
- Fixed the calculation of device_name_chksum; should be done for each iteration
|
||||
- Fixed the estimated time value whenever the value is very large and overflows
|
||||
- Fixed the parsing of command line options. It doesn't show two times the same error about an invalid option anymore
|
||||
|
@ -75,6 +75,20 @@ but this is nededed for VS compiler which doesn't have inline keyword but has __
|
||||
|
||||
#define MAYBE_UNUSED __attribute__((unused))
|
||||
|
||||
/* Check if we also need to use/set the nanoseconds for the file stats:
|
||||
The linux manual says that the only valid way to check for nanosecond resolution is to follow this rule:
|
||||
"The nanosecond components of each timestamp are available via names of the form st_atim.tv_nsec
|
||||
if the _BSD_SOURCE or _SVID_SOURCE feature test macro is defined"
|
||||
*/
|
||||
|
||||
#if defined (_BSD_SOURCE)
|
||||
#define WITH_NANOSECONDS_IN_STAT 1
|
||||
#endif
|
||||
|
||||
#if defined (_SVID_SOURCE)
|
||||
#define WITH_NANOSECONDS_IN_STAT 1
|
||||
#endif
|
||||
|
||||
// config section
|
||||
// do not try to simply change this, it will not work
|
||||
|
||||
|
@ -19,6 +19,10 @@ int sort_by_dictstat (const void *s1, const void *s2)
|
||||
|
||||
d2->stat.st_atime = d1->stat.st_atime;
|
||||
|
||||
#if defined (WITH_NANOSECONDS_IN_STAT)
|
||||
d2->stat.st_atim.tv_nsec = d1->stat.st_atim.tv_nsec;
|
||||
#endif
|
||||
|
||||
const int rc_from = strcmp (d1->encoding_from, d2->encoding_from);
|
||||
|
||||
if (rc_from != 0) return rc_from;
|
||||
|
@ -293,6 +293,10 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
|
||||
d.stat.st_rdev = 0;
|
||||
d.stat.st_atime = 0;
|
||||
|
||||
#if defined (WITH_NANOSECONDS_IN_STAT)
|
||||
d.stat.st_atim.tv_nsec = 0;
|
||||
#endif
|
||||
|
||||
#if defined (_POSIX)
|
||||
d.stat.st_blksize = 0;
|
||||
d.stat.st_blocks = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user