diff --git a/example.dict.gz b/example.dict.gz index 65089b554..4283abb48 100644 Binary files a/example.dict.gz and b/example.dict.gz differ diff --git a/include/shared.h b/include/shared.h index e448cc8f0..07aa2596c 100644 --- a/include/shared.h +++ b/include/shared.h @@ -63,8 +63,6 @@ void hc_string_trim_trailing (char *s); void hc_string_trim_leading (char *s); bool hc_fopen (HCFILE *fp, const char *path, char *mode); -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); int hc_fscanf (HCFILE *fp, const char *format, void *ptr); int hc_fprintf (HCFILE *fp, const char *format, ...); int hc_vfprintf (HCFILE *fp, const char *format, va_list ap); @@ -72,14 +70,14 @@ int hc_fseek (HCFILE *fp, off_t offset, int whence); void hc_rewind (HCFILE *fp); off_t hc_ftell (HCFILE *fp); int hc_fgetc (HCFILE *fp); -int hc_fputc (int c, HCFILE *fp); -char *hc_fgets (char *buf, int len, HCFILE *fp); int hc_fileno (HCFILE *fp); int hc_feof (HCFILE *fp); void hc_fflush (HCFILE *fp); void hc_fclose (HCFILE *fp); -size_t hc_fwrite_compress (void *ptr, size_t size, size_t nmemb, HCFILE *fp); -size_t hc_fread_compress (void *ptr, size_t size, size_t nmemb, HCFILE *fp); +int hc_fputc (int c, HCFILE *fp); +char *hc_fgets (char *buf, int len, HCFILE *fp); +size_t hc_fwrite (void *ptr, size_t size, size_t nmemb, HCFILE *fp); +size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp); bool hc_same_files (char *file1, char *file2); diff --git a/src/backend.c b/src/backend.c index df3393391..909c3c606 100644 --- a/src/backend.c +++ b/src/backend.c @@ -468,8 +468,7 @@ static bool read_kernel_binary (hashcat_ctx_t *hashcat_ctx, const char *kernel_f char *buf = (char *) hcmalloc (st.st_size + 1 + EXTRASZ); -// size_t num_read = hc_fread (buf, sizeof (char), st.st_size, fp); - size_t num_read = hc_fread_compress (buf, sizeof (char), st.st_size, &fp); + size_t num_read = hc_fread (buf, sizeof (char), st.st_size, &fp); // fclose (fp); hc_fclose (&fp); @@ -541,8 +540,7 @@ static bool write_kernel_binary (hashcat_ctx_t *hashcat_ctx, char *kernel_file, return false; } -// hc_fwrite (binary, sizeof (char), binary_size, fp); - hc_fwrite_compress (binary, sizeof (char), binary_size, &fp); + hc_fwrite (binary, sizeof (char), binary_size, &fp); // fflush (fp); hc_fflush (&fp); diff --git a/src/brain.c b/src/brain.c index 3db4734d3..1a53c1f6b 100644 --- a/src/brain.c +++ b/src/brain.c @@ -548,7 +548,7 @@ u64 brain_compute_attack_wordlist (const char *filename) while (!hc_feof (&fp)) { // const size_t nread = fread (buf, 1, FBUFSZ, fd); - const size_t nread = hc_fread_compress (buf, 1, FBUFSZ, &fp); + const size_t nread = hc_fread (buf, 1, FBUFSZ, &fp); XXH64_update (state, buf, nread); } @@ -627,7 +627,7 @@ u32 brain_auth_challenge (void) } // if (fread (&val, sizeof (val), 1, fd) != 1) - if (hc_fread_compress (&val, sizeof (val), 1, &fp) != 1) + if (hc_fread (&val, sizeof (val), 1, &fp) != 1) { brain_logging (stderr, 0, "%s: %s\n", urandom, strerror (errno)); @@ -1631,7 +1631,7 @@ bool brain_server_read_hash_dump (brain_server_db_hash_t *brain_server_db_hash, } // const size_t nread = fread (brain_server_db_hash->long_buf, sizeof (brain_server_hash_long_t), temp_cnt, fd); - const size_t nread = hc_fread_compress (brain_server_db_hash->long_buf, sizeof (brain_server_hash_long_t), temp_cnt, &fp); + const size_t nread = hc_fread (brain_server_db_hash->long_buf, sizeof (brain_server_hash_long_t), temp_cnt, &fp); if (nread != (size_t) temp_cnt) { @@ -1684,7 +1684,7 @@ bool brain_server_write_hash_dump (brain_server_db_hash_t *brain_server_db_hash, fp.is_gzip = 0; // const size_t nwrite = fwrite (brain_server_db_hash->long_buf, sizeof (brain_server_hash_long_t), brain_server_db_hash->long_cnt, fd); - const size_t nwrite = hc_fwrite_compress (brain_server_db_hash->long_buf, sizeof (brain_server_hash_long_t), brain_server_db_hash->long_cnt, &fp); + const size_t nwrite = hc_fwrite (brain_server_db_hash->long_buf, sizeof (brain_server_hash_long_t), brain_server_db_hash->long_cnt, &fp); if (nwrite != (size_t) brain_server_db_hash->long_cnt) { @@ -1844,7 +1844,7 @@ bool brain_server_read_attack_dump (brain_server_db_attack_t *brain_server_db_at } // const size_t nread = fread (brain_server_db_attack->long_buf, sizeof (brain_server_attack_long_t), temp_cnt, fd); - const size_t nread = hc_fread_compress (brain_server_db_attack->long_buf, sizeof (brain_server_attack_long_t), temp_cnt, &fp); + const size_t nread = hc_fread (brain_server_db_attack->long_buf, sizeof (brain_server_attack_long_t), temp_cnt, &fp); if (nread != (size_t) temp_cnt) { @@ -1899,7 +1899,7 @@ bool brain_server_write_attack_dump (brain_server_db_attack_t *brain_server_db_a // storing should not include reserved attacks only finished // const size_t nwrite = fwrite (brain_server_db_attack->long_buf, sizeof (brain_server_attack_long_t), brain_server_db_attack->long_cnt, fd); - const size_t nwrite = hc_fwrite_compress (brain_server_db_attack->long_buf, sizeof (brain_server_attack_long_t), brain_server_db_attack->long_cnt, &fp); + const size_t nwrite = hc_fwrite (brain_server_db_attack->long_buf, sizeof (brain_server_attack_long_t), brain_server_db_attack->long_cnt, &fp); if (nwrite != (size_t) brain_server_db_attack->long_cnt) { diff --git a/src/cpu_crc32.c b/src/cpu_crc32.c index d08845046..017f1ff76 100644 --- a/src/cpu_crc32.c +++ b/src/cpu_crc32.c @@ -101,8 +101,7 @@ int cpu_crc32 (const char *filename, u8 keytab[64]) u8 *buf = (u8 *) hcmalloc (MAX_KEY_SIZE + 1); -// size_t nread = hc_fread (buf, sizeof (u8), MAX_KEY_SIZE, fd); - size_t nread = hc_fread_compress (buf, sizeof (u8), MAX_KEY_SIZE, &fp); + size_t nread = hc_fread (buf, sizeof (u8), MAX_KEY_SIZE, &fp); // fclose (fd); hc_fclose (&fp); diff --git a/src/debugfile.c b/src/debugfile.c index 94e470605..3b09ddbc0 100644 --- a/src/debugfile.c +++ b/src/debugfile.c @@ -51,8 +51,7 @@ static void debugfile_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ } else { -// hc_fwrite (plain_ptr, plain_len, 1, debugfile_ctx->fp); - hc_fwrite_compress ((void *)plain_ptr, plain_len, 1, debugfile_ctx->fp); + hc_fwrite ((void *)plain_ptr, plain_len, 1, debugfile_ctx->fp); } } @@ -72,8 +71,7 @@ void debugfile_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *rule_buf, con if ((debug_mode == 3) || (debug_mode == 4)) hc_fputc (':', debugfile_ctx->fp); } -// hc_fwrite (rule_buf, rule_len, 1, debugfile_ctx->fp); - hc_fwrite_compress ((void *)rule_buf, rule_len, 1, debugfile_ctx->fp); + hc_fwrite ((void *)rule_buf, rule_len, 1, debugfile_ctx->fp); if (debug_mode == 4) { @@ -83,8 +81,7 @@ void debugfile_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *rule_buf, con debugfile_format_plain (hashcat_ctx, mod_plain_ptr, mod_plain_len); } -// hc_fwrite (EOL, strlen (EOL), 1, debugfile_ctx->fp); - hc_fwrite_compress (EOL, strlen (EOL), 1, debugfile_ctx->fp); + hc_fwrite (EOL, strlen (EOL), 1, debugfile_ctx->fp); } int debugfile_init (hashcat_ctx_t *hashcat_ctx) diff --git a/src/dictstat.c b/src/dictstat.c index d279a7767..1578d6c5d 100644 --- a/src/dictstat.c +++ b/src/dictstat.c @@ -112,10 +112,8 @@ void dictstat_read (hashcat_ctx_t *hashcat_ctx) u64 v; u64 z; -// const size_t nread1 = hc_fread (&v, sizeof (u64), 1, fp); - const size_t nread1 = hc_fread_compress (&v, sizeof (u64), 1, &fp); -// const size_t nread2 = hc_fread (&z, sizeof (u64), 1, fp); - const size_t nread2 = hc_fread_compress (&z, sizeof (u64), 1, &fp); + const size_t nread1 = hc_fread (&v, sizeof (u64), 1, &fp); + const size_t nread2 = hc_fread (&z, sizeof (u64), 1, &fp); if ((nread1 != 1) || (nread2 != 1)) { @@ -167,8 +165,7 @@ void dictstat_read (hashcat_ctx_t *hashcat_ctx) { dictstat_t d; -// const size_t nread = hc_fread (&d, sizeof (dictstat_t), 1, fp); - const size_t nread = hc_fread_compress (&d, sizeof (dictstat_t), 1, &fp); + const size_t nread = hc_fread (&d, sizeof (dictstat_t), 1, &fp); if (nread == 0) continue; @@ -227,15 +224,12 @@ int dictstat_write (hashcat_ctx_t *hashcat_ctx) v = byte_swap_64 (v); z = byte_swap_64 (z); -// hc_fwrite (&v, sizeof (u64), 1, fp); - hc_fwrite_compress (&v, sizeof (u64), 1, &fp); -// hc_fwrite (&z, sizeof (u64), 1, fp); - hc_fwrite_compress (&z, sizeof (u64), 1, &fp); + hc_fwrite (&v, sizeof (u64), 1, &fp); + hc_fwrite (&z, sizeof (u64), 1, &fp); // data -// hc_fwrite (dictstat_ctx->base, sizeof (dictstat_t), dictstat_ctx->cnt, fp); - hc_fwrite_compress (dictstat_ctx->base, sizeof (dictstat_t), dictstat_ctx->cnt, &fp); + hc_fwrite (dictstat_ctx->base, sizeof (dictstat_t), dictstat_ctx->cnt, &fp); // fclose (fp); hc_fclose (&fp); diff --git a/src/filehandling.c b/src/filehandling.c index 48ad0b4a0..ae39c1a06 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -19,7 +19,7 @@ u64 count_lines (HCFILE *fp) while (!hc_feof (fp)) { - size_t nread = hc_fread_compress (buf, sizeof (char), HCBUFSIZ_LARGE, fp); + size_t nread = hc_fread (buf, sizeof (char), HCBUFSIZ_LARGE, fp); if (nread < 1) continue; diff --git a/src/hashes.c b/src/hashes.c index 30ad33bf1..4d7c61622 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -234,8 +234,7 @@ int save_hash (hashcat_ctx_t *hashcat_ctx) const int binary_len = module_ctx->module_hash_binary_save (hashes, salt_pos, digest_pos, &binary_buf); -// hc_fwrite (binary_buf, binary_len, 1, fp); - hc_fwrite_compress (binary_buf, binary_len, 1, &fp); + hc_fwrite (binary_buf, binary_len, 1, &fp); hcfree (binary_buf); } diff --git a/src/hwmon.c b/src/hwmon.c index 9780c9e5c..636f70d6f 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -506,8 +506,7 @@ static int nvml_init (hashcat_ctx_t *hashcat_ctx) nvml_winpath = (char *) hcmalloc (100); -// hc_fread (nvml_winpath, 100, 1, nvml_lib); - hc_fread_compress (nvml_winpath, 100, 1, &nvml_lib); + hc_fread (nvml_winpath, 100, 1, &nvml_lib); // fclose (nvml_lib); hc_fclose (&nvml_lib); diff --git a/src/logfile.c b/src/logfile.c index 756a1d789..89de8cabd 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -68,8 +68,7 @@ void logfile_append (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...) va_end (ap); -// hc_fwrite (EOL, strlen (EOL), 1, fp); - hc_fwrite_compress (EOL, strlen (EOL), 1, &fp); + hc_fwrite (EOL, strlen (EOL), 1, &fp); // fflush (fp); hc_fflush (&fp); diff --git a/src/loopback.c b/src/loopback.c index d1ee4a7e5..8bbe5422e 100644 --- a/src/loopback.c +++ b/src/loopback.c @@ -52,8 +52,7 @@ static void loopback_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_p } else { -// hc_fwrite (plain_ptr, plain_len, 1, loopback_ctx->fp); - hc_fwrite_compress ((void *)plain_ptr, plain_len, 1, loopback_ctx->fp); + hc_fwrite ((void *)plain_ptr, plain_len, 1, loopback_ctx->fp); } } @@ -172,8 +171,7 @@ void loopback_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ptr, con // lock_file (fp); lock_file (fp->f.fp); -// hc_fwrite (EOL, strlen (EOL), 1, fp); - hc_fwrite_compress (EOL, strlen (EOL), 1, fp); + hc_fwrite (EOL, strlen (EOL), 1, fp); // fflush (fp); hc_fflush (fp); diff --git a/src/main.c b/src/main.c index 24a53448a..787775c28 100644 --- a/src/main.c +++ b/src/main.c @@ -108,16 +108,15 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, HCFILE *fp, const int loglevel switch (loglevel) { case LOGLEVEL_INFO: break; - case LOGLEVEL_WARNING: hc_fwrite_compress ("\033[33m", 5, 1, fp); break; - case LOGLEVEL_ERROR: hc_fwrite_compress ("\033[31m", 5, 1, fp); break; - case LOGLEVEL_ADVICE: hc_fwrite_compress ("\033[33m", 5, 1, fp); break; + case LOGLEVEL_WARNING: hc_fwrite ("\033[33m", 5, 1, fp); break; + case LOGLEVEL_ERROR: hc_fwrite ("\033[31m", 5, 1, fp); break; + case LOGLEVEL_ADVICE: hc_fwrite ("\033[33m", 5, 1, fp); break; } #endif // finally, print -// hc_fwrite (msg_buf, msg_len, 1, fp); - hc_fwrite_compress ((void *)msg_buf, msg_len, 1, fp); + hc_fwrite ((void *)msg_buf, msg_len, 1, fp); // color stuff post @@ -133,9 +132,9 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, HCFILE *fp, const int loglevel switch (loglevel) { case LOGLEVEL_INFO: break; - case LOGLEVEL_WARNING: hc_fwrite_compress ("\033[0m", 4, 1, fp); break; - case LOGLEVEL_ERROR: hc_fwrite_compress ("\033[0m", 4, 1, fp); break; - case LOGLEVEL_ADVICE: hc_fwrite_compress ("\033[0m", 4, 1, fp); break; + case LOGLEVEL_WARNING: hc_fwrite ("\033[0m", 4, 1, fp); break; + case LOGLEVEL_ERROR: hc_fwrite ("\033[0m", 4, 1, fp); break; + case LOGLEVEL_ADVICE: hc_fwrite ("\033[0m", 4, 1, fp); break; } #endif @@ -143,15 +142,13 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, HCFILE *fp, const int loglevel if (msg_newline == true) { -// hc_fwrite (EOL, strlen (EOL), 1, fp); - hc_fwrite_compress (EOL, strlen (EOL), 1, fp); + hc_fwrite (EOL, strlen (EOL), 1, fp); // on error, add another newline if (loglevel == LOGLEVEL_ERROR) { -// hc_fwrite (EOL, strlen (EOL), 1, fp); - hc_fwrite_compress (EOL, strlen (EOL), 1, fp); + hc_fwrite (EOL, strlen (EOL), 1, fp); } } @@ -371,8 +368,8 @@ static void main_cracker_hash_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, if (outfile_ctx->filename == NULL) if (user_options->quiet == false) clear_prompt (hashcat_ctx); } - hc_fwrite (buf, len, 1, stdout); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (buf, len, 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { @@ -417,8 +414,8 @@ static void main_potfile_hash_show (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAY if (outfile_ctx->fp != NULL) return; // cracked hash was not written to an outfile - hc_fwrite (buf, len, 1, stdout); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (buf, len, 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } static void main_potfile_hash_left (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) @@ -427,8 +424,8 @@ static void main_potfile_hash_left (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAY if (outfile_ctx->fp != NULL) return; // cracked hash was not written to an outfile - hc_fwrite (buf, len, 1, stdout); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (buf, len, 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } static void main_potfile_num_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) diff --git a/src/modules/module_02500.c b/src/modules/module_02500.c index c21b484bf..8907f8677 100644 --- a/src/modules/module_02500.c +++ b/src/modules/module_02500.c @@ -192,7 +192,7 @@ static int check_old_hccap (const char *hashfile) u32 signature; - const size_t nread = hc_fread_compress (&signature, sizeof (u32), 1, fp); + const size_t nread = hc_fread (&signature, sizeof (u32), 1, fp); fclose (fp); @@ -382,7 +382,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE while (!hc_feof (&fp)) { - const size_t nread = hc_fread_compress (in, sizeof (hccapx_t), 1, &fp); + const size_t nread = hc_fread (in, sizeof (hccapx_t), 1, &fp); if (nread == 0) break; diff --git a/src/modules/module_02501.c b/src/modules/module_02501.c index 47256e76e..a7ce17b04 100644 --- a/src/modules/module_02501.c +++ b/src/modules/module_02501.c @@ -189,7 +189,7 @@ static int check_old_hccap (const char *hashfile) u32 signature; - const size_t nread = hc_fread_compress (&signature, sizeof (u32), 1, fp); + const size_t nread = hc_fread (&signature, sizeof (u32), 1, fp); fclose (fp); @@ -357,7 +357,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE while (!hc_feof (&fp)) { - const size_t nread = hc_fread_compress (in, sizeof (hccapx_t), 1, &fp); + const size_t nread = hc_fread (in, sizeof (hccapx_t), 1, &fp); if (nread == 0) break; diff --git a/src/modules/module_05200.c b/src/modules/module_05200.c index 787d23d51..7c50b5d47 100644 --- a/src/modules/module_05200.c +++ b/src/modules/module_05200.c @@ -101,7 +101,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (&in, 0, sizeof (psafe3_t)); - const size_t n = hc_fread_compress (&in, sizeof (psafe3_t), 1, &fp); + const size_t n = hc_fread (&in, sizeof (psafe3_t), 1, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06211.c b/src/modules/module_06211.c index 6b3e89b54..8f2be8897 100644 --- a/src/modules/module_06211.c +++ b/src/modules/module_06211.c @@ -154,7 +154,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06212.c b/src/modules/module_06212.c index c313a04d6..bfc9d05d8 100644 --- a/src/modules/module_06212.c +++ b/src/modules/module_06212.c @@ -154,7 +154,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06213.c b/src/modules/module_06213.c index bb414a65a..1b09d8607 100644 --- a/src/modules/module_06213.c +++ b/src/modules/module_06213.c @@ -152,7 +152,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06221.c b/src/modules/module_06221.c index f20484766..6d43ffe3c 100644 --- a/src/modules/module_06221.c +++ b/src/modules/module_06221.c @@ -152,7 +152,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06222.c b/src/modules/module_06222.c index 9204c18ec..b0ae40989 100644 --- a/src/modules/module_06222.c +++ b/src/modules/module_06222.c @@ -152,7 +152,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06223.c b/src/modules/module_06223.c index f05859049..ee3c1f5ed 100644 --- a/src/modules/module_06223.c +++ b/src/modules/module_06223.c @@ -152,7 +152,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06231.c b/src/modules/module_06231.c index 8ba30b502..e01fd7300 100644 --- a/src/modules/module_06231.c +++ b/src/modules/module_06231.c @@ -154,7 +154,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06232.c b/src/modules/module_06232.c index b70efaf23..b8a404670 100644 --- a/src/modules/module_06232.c +++ b/src/modules/module_06232.c @@ -154,7 +154,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06233.c b/src/modules/module_06233.c index 5c569261a..499f0714a 100644 --- a/src/modules/module_06233.c +++ b/src/modules/module_06233.c @@ -154,7 +154,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06241.c b/src/modules/module_06241.c index 1b1709a95..09c3e8ec7 100644 --- a/src/modules/module_06241.c +++ b/src/modules/module_06241.c @@ -166,7 +166,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06242.c b/src/modules/module_06242.c index 668e78373..20a239fd0 100644 --- a/src/modules/module_06242.c +++ b/src/modules/module_06242.c @@ -166,7 +166,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_06243.c b/src/modules/module_06243.c index 9845b5d71..baa540b0c 100644 --- a/src/modules/module_06243.c +++ b/src/modules/module_06243.c @@ -166,7 +166,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (TC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_09000.c b/src/modules/module_09000.c index e278338b4..b69166668 100644 --- a/src/modules/module_09000.c +++ b/src/modules/module_09000.c @@ -164,7 +164,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (&buf, 0, sizeof (psafe2_hdr)); - const size_t n = hc_fread_compress (&buf, sizeof (psafe2_hdr), 1, &fp); + const size_t n = hc_fread (&buf, sizeof (psafe2_hdr), 1, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13711.c b/src/modules/module_13711.c index 6e264b9d7..87852ec44 100644 --- a/src/modules/module_13711.c +++ b/src/modules/module_13711.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13712.c b/src/modules/module_13712.c index 95f02ff5b..c8179fb71 100644 --- a/src/modules/module_13712.c +++ b/src/modules/module_13712.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13713.c b/src/modules/module_13713.c index e565e7b60..062378441 100644 --- a/src/modules/module_13713.c +++ b/src/modules/module_13713.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13721.c b/src/modules/module_13721.c index a21cecb7f..fba2cc96d 100644 --- a/src/modules/module_13721.c +++ b/src/modules/module_13721.c @@ -178,7 +178,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13722.c b/src/modules/module_13722.c index 9494495e1..7e8257b77 100644 --- a/src/modules/module_13722.c +++ b/src/modules/module_13722.c @@ -178,7 +178,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13723.c b/src/modules/module_13723.c index d17b43783..5b9c5cb94 100644 --- a/src/modules/module_13723.c +++ b/src/modules/module_13723.c @@ -178,7 +178,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13731.c b/src/modules/module_13731.c index 8d70ae371..3afff8644 100644 --- a/src/modules/module_13731.c +++ b/src/modules/module_13731.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13732.c b/src/modules/module_13732.c index 80bd5d8f1..965776e9e 100644 --- a/src/modules/module_13732.c +++ b/src/modules/module_13732.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13733.c b/src/modules/module_13733.c index 87d56b3fd..3a7d0bbbb 100644 --- a/src/modules/module_13733.c +++ b/src/modules/module_13733.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13741.c b/src/modules/module_13741.c index bdc6674a6..45fa7d48c 100644 --- a/src/modules/module_13741.c +++ b/src/modules/module_13741.c @@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13742.c b/src/modules/module_13742.c index 9075a6d8e..eda71240c 100644 --- a/src/modules/module_13742.c +++ b/src/modules/module_13742.c @@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13743.c b/src/modules/module_13743.c index 40e594276..fb3b75f0f 100644 --- a/src/modules/module_13743.c +++ b/src/modules/module_13743.c @@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13751.c b/src/modules/module_13751.c index 80b309621..dae3c2d94 100644 --- a/src/modules/module_13751.c +++ b/src/modules/module_13751.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13752.c b/src/modules/module_13752.c index 8f050103a..9f847766b 100644 --- a/src/modules/module_13752.c +++ b/src/modules/module_13752.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13753.c b/src/modules/module_13753.c index 1f9e59bf4..8113f044c 100644 --- a/src/modules/module_13753.c +++ b/src/modules/module_13753.c @@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13761.c b/src/modules/module_13761.c index 5dfeb4a40..5fc1a1376 100644 --- a/src/modules/module_13761.c +++ b/src/modules/module_13761.c @@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13762.c b/src/modules/module_13762.c index a25d77b48..b0da01aa7 100644 --- a/src/modules/module_13762.c +++ b/src/modules/module_13762.c @@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13763.c b/src/modules/module_13763.c index c93fba771..09fb93505 100644 --- a/src/modules/module_13763.c +++ b/src/modules/module_13763.c @@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13771.c b/src/modules/module_13771.c index eae026aa9..f788981ef 100644 --- a/src/modules/module_13771.c +++ b/src/modules/module_13771.c @@ -184,7 +184,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13772.c b/src/modules/module_13772.c index ac5fbd924..e52ee2725 100644 --- a/src/modules/module_13772.c +++ b/src/modules/module_13772.c @@ -184,7 +184,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_13773.c b/src/modules/module_13773.c index d26b3e0b6..20634ebe4 100644 --- a/src/modules/module_13773.c +++ b/src/modules/module_13773.c @@ -184,7 +184,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE char *in = (char *) hcmalloc (VC_HEADER_SIZE); - const size_t n = hc_fread_compress (in, 1, VC_HEADER_SIZE, &fp); + const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp); hc_fclose (&fp); diff --git a/src/modules/module_14600.c b/src/modules/module_14600.c index e364b240c..9b8fcc357 100644 --- a/src/modules/module_14600.c +++ b/src/modules/module_14600.c @@ -357,7 +357,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE struct luks_phdr hdr; - const size_t nread = hc_fread_compress (&hdr, sizeof (hdr), 1, &fp); + const size_t nread = hc_fread (&hdr, sizeof (hdr), 1, &fp); if (nread != 1) { @@ -542,7 +542,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE return (PARSER_LUKS_FILE_SIZE); } - const size_t nread2 = hc_fread_compress (luks->af_src_buf, keyBytes, stripes, &fp); + const size_t nread2 = hc_fread (luks->af_src_buf, keyBytes, stripes, &fp); if (nread2 != stripes) { @@ -564,7 +564,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE return (PARSER_LUKS_FILE_SIZE); } - const size_t nread3 = hc_fread_compress (luks->ct_buf, sizeof (u32), 128, &fp); + const size_t nread3 = hc_fread (luks->ct_buf, sizeof (u32), 128, &fp); if (nread3 != 128) { diff --git a/src/mpsp.c b/src/mpsp.c index e0f96bda2..a3986dce7 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -596,8 +596,7 @@ static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, { char mp_file[1024]; -// const size_t nread = hc_fread (mp_file, 1, sizeof (mp_file) - 1, fp); - const size_t nread = hc_fread_compress (mp_file, 1, sizeof (mp_file) - 1, &fp); + const size_t nread = hc_fread (mp_file, 1, sizeof (mp_file) - 1, &fp); // if (!feof (fp)) if (!hc_feof (&fp)) @@ -729,8 +728,7 @@ static int sp_setup_tbl (hashcat_ctx_t *hashcat_ctx) u8 *inbuf = (u8 *) hcmalloc (s.st_size); -// SizeT inlen = (SizeT) hc_fread (inbuf, 1, s.st_size, fd); - SizeT inlen = (SizeT) hc_fread_compress (inbuf, 1, s.st_size, &fp); + SizeT inlen = (SizeT) hc_fread (inbuf, 1, s.st_size, &fp); if (inlen != (SizeT) s.st_size) { diff --git a/src/outfile.c b/src/outfile.c index 0409e944c..af8c038e3 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -537,10 +537,8 @@ int outfile_write (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const int ou if (outfile_ctx->fp != NULL) { -// hc_fwrite (tmp_buf, tmp_len, 1, outfile_ctx->fp); - hc_fwrite_compress (tmp_buf, tmp_len, 1, outfile_ctx->fp); -// hc_fwrite (EOL, strlen (EOL), 1, outfile_ctx->fp); - hc_fwrite_compress (EOL, strlen (EOL), 1, outfile_ctx->fp); + hc_fwrite (tmp_buf, tmp_len, 1, outfile_ctx->fp); + hc_fwrite (EOL, strlen (EOL), 1, outfile_ctx->fp); } return tmp_len; diff --git a/src/pidfile.c b/src/pidfile.c index a96d7e958..29570d5b0 100644 --- a/src/pidfile.c +++ b/src/pidfile.c @@ -24,8 +24,7 @@ static int check_running_process (hashcat_ctx_t *hashcat_ctx) pidfile_data_t *pd = (pidfile_data_t *) hcmalloc (sizeof (pidfile_data_t)); -// const size_t nread = hc_fread (pd, sizeof (pidfile_data_t), 1, fp); - const size_t nread = hc_fread_compress (pd, sizeof (pidfile_data_t), 1, &fp); + const size_t nread = hc_fread (pd, sizeof (pidfile_data_t), 1, &fp); // fclose (fp); hc_fclose (&fp); @@ -170,8 +169,7 @@ static int write_pidfile (hashcat_ctx_t *hashcat_ctx) fp.is_gzip = 0; -// hc_fwrite (pd, sizeof (pidfile_data_t), 1, fp); - hc_fwrite_compress (pd, sizeof (pidfile_data_t), 1, &fp); + hc_fwrite (pd, sizeof (pidfile_data_t), 1, &fp); // fflush (fp); hc_fflush (&fp); diff --git a/src/potfile.c b/src/potfile.c index bbf908921..af6daccde 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -205,7 +205,6 @@ void potfile_read_close (hashcat_ctx_t *hashcat_ctx) if (potfile_ctx->fp == NULL) return; fclose (potfile_ctx->fp); -// hc_fclose (potfile_ctx->fp); } int potfile_write_open (hashcat_ctx_t *hashcat_ctx) @@ -215,10 +214,8 @@ int potfile_write_open (hashcat_ctx_t *hashcat_ctx) if (potfile_ctx->enabled == false) return 0; FILE *fp = fopen (potfile_ctx->filename, "ab"); -/// HCFILE *fp = (HCFILE *) hcmalloc (sizeof(HCFILE)); if (fp == NULL) -// if (hc_fopen (fp, potfile_ctx->filename, "ab") == false) { event_log_error (hashcat_ctx, "%s: %s", potfile_ctx->filename, strerror (errno)); @@ -243,7 +240,6 @@ void potfile_write_close (hashcat_ctx_t *hashcat_ctx) if (hashconfig->potfile_disable == true) return; fclose (potfile_ctx->fp); -// hc_fclose (potfile_ctx->fp); } void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const int out_len, u8 *plain_ptr, unsigned int plain_len) @@ -300,16 +296,12 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, cons tmp_buf[tmp_len] = 0; lock_file (potfile_ctx->fp); -// lock_file (potfile_ctx->fp->f.fp); fprintf (potfile_ctx->fp, "%s" EOL, tmp_buf); -// hc_fprintf (potfile_ctx->fp, "%s" EOL, tmp_buf); fflush (potfile_ctx->fp); -// hc_fflush (potfile_ctx->fp); if (unlock_file (potfile_ctx->fp)) -// if (unlock_file (potfile_ctx->fp->f.fp)) { event_log_error (hashcat_ctx, "%s: Failed to unlock file.", potfile_ctx->filename); } @@ -542,7 +534,6 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx) fp.f.fp = potfile_ctx->fp; while (!feof (potfile_ctx->fp)) -// while (!hc_feof (potfile_ctx->fp)) { size_t line_len = fgetl (&fp, line_buf); diff --git a/src/restore.c b/src/restore.c index 12407b39c..b9f2dfc2b 100644 --- a/src/restore.c +++ b/src/restore.c @@ -68,7 +68,7 @@ static int read_restore (hashcat_ctx_t *hashcat_ctx) restore_data_t *rd = restore_ctx->rd; // if (fread (rd, sizeof (restore_data_t), 1, fp) != 1) - if (hc_fread_compress (rd, sizeof (restore_data_t), 1, &fp) != 1) + if (hc_fread (rd, sizeof (restore_data_t), 1, &fp) != 1) { event_log_error (hashcat_ctx, "Cannot read %s", eff_restore_file); @@ -236,8 +236,7 @@ static int write_restore (hashcat_ctx_t *hashcat_ctx) return -1; } -// hc_fwrite (rd, sizeof (restore_data_t), 1, fp); - hc_fwrite_compress (rd, sizeof (restore_data_t), 1, &fp); + hc_fwrite (rd, sizeof (restore_data_t), 1, &fp); for (u32 i = 0; i < rd->argc; i++) { diff --git a/src/shared.c b/src/shared.c index 609184a18..4a06cd43f 100644 --- a/src/shared.c +++ b/src/shared.c @@ -356,7 +356,7 @@ bool hc_path_has_bom (const char *path) if (hc_fopen (&fp, path, "rb") == false) return false; // const size_t nread = fread (buf, 1, sizeof (buf), fp); - const size_t nread = hc_fread_compress (buf, 1, sizeof (buf), &fp); + const size_t nread = hc_fread (buf, 1, sizeof (buf), &fp); // fclose (fp); hc_fclose (&fp); @@ -643,7 +643,7 @@ bool hc_fopen (HCFILE *fp, const char *path, char *mode) return true; } -size_t hc_fread_compress (void *ptr, size_t size, size_t nmemb, HCFILE *fp) +size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp) { size_t n = 0; @@ -657,7 +657,7 @@ size_t hc_fread_compress (void *ptr, size_t size, size_t nmemb, HCFILE *fp) return n; } -size_t hc_fwrite_compress (void *ptr, size_t size, size_t nmemb, HCFILE *fp) +size_t hc_fwrite (void *ptr, size_t size, size_t nmemb, HCFILE *fp) { size_t n = 0; @@ -673,18 +673,6 @@ size_t hc_fwrite_compress (void *ptr, size_t size, size_t nmemb, HCFILE *fp) return n; } -size_t hc_fread (void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - return fread (ptr, size, nmemb, stream); -} - -void hc_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t rc = fwrite (ptr, size, nmemb, stream); - - if (rc == 0) rc = 0; -} - int hc_fseek (HCFILE *fp, off_t offset, int whence) { int r = 0; diff --git a/src/stdout.c b/src/stdout.c index ba82a9548..e7d90c8c2 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -18,8 +18,7 @@ static void out_flush (out_t *out) { if (out->len == 0) return; -// hc_fwrite (out->buf, 1, out->len, out->fp); - hc_fwrite_compress (out->buf, 1, out->len, out->fp); + hc_fwrite (out->buf, 1, out->len, out->fp); out->len = 0; } diff --git a/src/terminal.c b/src/terminal.c index 1400ae724..5435f61ec 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -977,7 +977,7 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx) printf ("%d\t", util); } - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); fflush (stdout); @@ -1064,7 +1064,7 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) printf (" \"time_start\": %" PRIu64 ",", (u64) status_ctx->runtime_start); printf (" \"estimated_stop\": %" PRIu64 " }", (u64) end); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); fflush (stdout); diff --git a/src/usage.c b/src/usage.c index b0e011cf0..15c6c309e 100644 --- a/src/usage.c +++ b/src/usage.c @@ -269,7 +269,7 @@ void usage_mini_print (const char *progname) { printf (USAGE_MINI[i], progname); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } } @@ -315,19 +315,19 @@ void usage_big_print (hashcat_ctx_t *hashcat_ctx) { printf ("%s", USAGE_BIG_PRE_HASHMODES[i]); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } - //hc_fwrite_compress (EOL, strlen (EOL), 1, stdout); + //hc_fwrite (EOL, strlen (EOL), 1, stdout); for (int i = 0; i < usage_sort_cnt; i++) { printf ("%7d | %-48s | %s", usage_sort_buf[i].hash_mode, usage_sort_buf[i].hash_name, strhashcategory (usage_sort_buf[i].hash_category)); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); for (int i = 0; i < usage_sort_cnt; i++) { @@ -340,8 +340,8 @@ void usage_big_print (hashcat_ctx_t *hashcat_ctx) { printf ("%s", USAGE_BIG_POST_HASHMODES[i]); - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } - hc_fwrite (EOL, strlen (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } diff --git a/src/wordlist.c b/src/wordlist.c index 15a6503f4..57bd36346 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -55,7 +55,7 @@ int load_segment (hashcat_ctx_t *hashcat_ctx, HCFILE *fp) wl_data->pos = 0; - wl_data->cnt = hc_fread_compress (wl_data->buf, 1, wl_data->incr - 1000, fp); + wl_data->cnt = hc_fread (wl_data->buf, 1, wl_data->incr - 1000, fp); wl_data->buf[wl_data->cnt] = 0;