remove special time handling in hashcat.

There's a way to get 64-bit time_t and 64-bit stat in MinGW, so use that.
This commit is contained in:
Rosen Penev
2017-12-09 16:40:45 -08:00
parent 494c2724f5
commit 1c5915cae3
19 changed files with 104 additions and 174 deletions
+1 -6
View File
@@ -37,9 +37,6 @@ void setup_environment_variables (void);
void setup_umask (void);
void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed);
int hc_stat (const char *pathname, hc_stat_t *buf);
int hc_fstat (int fd, hc_stat_t *buf);
void hc_qsort_r (void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg);
void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg);
@@ -59,9 +56,7 @@ void hc_string_trim_leading (char *s);
size_t hc_fread (void *ptr, size_t size, size_t nmemb, FILE *stream);
void hc_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream);
hc_time_t hc_time (hc_time_t *t);
struct tm *hc_gmtime (const hc_time_t *t, MAYBE_UNUSED struct tm *result);
char *hc_ctime (const hc_time_t *t, char *buf, MAYBE_UNUSED const size_t buf_size);
char *hc_ctime (const time_t *t, char *buf, MAYBE_UNUSED const size_t buf_size);
bool hc_same_files (char *file1, char *file2);
+1 -1
View File
@@ -47,7 +47,7 @@ double status_get_msec_paused (const hashcat_ctx_t *hashcat_
double status_get_msec_real (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_started_relative (const hashcat_ctx_t *hashcat_ctx);
hc_time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx);
time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx);
u64 status_get_restore_point (const hashcat_ctx_t *hashcat_ctx);
+1 -1
View File
@@ -22,7 +22,7 @@
#endif // _WIN
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag);
void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const hc_time_t proc_start, const hc_time_t proc_stop);
void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop);
int setup_console (void);
+8 -24
View File
@@ -43,14 +43,6 @@ typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
// time
#if defined (_WIN)
typedef __time64_t hc_time_t;
#else
typedef time_t hc_time_t;
#endif
// timer
#if defined (_WIN)
@@ -73,14 +65,6 @@ typedef pthread_t hc_thread_t;
typedef pthread_mutex_t hc_thread_mutex_t;
#endif
// stat
#if defined (_WIN)
typedef struct _stat64 hc_stat_t;
#else
typedef struct stat hc_stat_t;
#endif
// enums
typedef enum loglevel
@@ -761,7 +745,7 @@ typedef struct outfile_data
{
char *file_name;
off_t seek;
hc_time_t ctime;
time_t ctime;
} outfile_data_t;
@@ -889,7 +873,7 @@ typedef struct bs_word
typedef struct cpt
{
u32 cracked;
hc_time_t timestamp;
time_t timestamp;
} cpt_t;
@@ -1241,7 +1225,7 @@ typedef struct dictstat
{
u64 cnt;
hc_stat_t stat;
struct stat stat;
char encoding_from[64];
char encoding_to[64];
@@ -1727,7 +1711,7 @@ typedef struct cpt_ctx
cpt_t *cpt_buf;
int cpt_pos;
hc_time_t cpt_start;
time_t cpt_start;
u64 cpt_total;
} cpt_ctx_t;
@@ -1870,8 +1854,8 @@ typedef struct status_ctx
* timer
*/
hc_time_t runtime_start;
hc_time_t runtime_stop;
time_t runtime_start;
time_t runtime_stop;
hc_timer_t timer_running; // timer on current dict
hc_timer_t timer_paused; // timer on current dict
@@ -1894,7 +1878,7 @@ typedef struct cache_hit
{
const char *dictfile;
hc_stat_t stat;
struct stat stat;
u64 cached_cnt;
u64 keyspace;
@@ -1911,7 +1895,7 @@ typedef struct cache_generate
u64 cnt;
u64 cnt2;
hc_time_t runtime;
time_t runtime;
} cache_generate_t;