1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Introduce hashconfig_t

This commit is contained in:
jsteube 2016-09-09 16:54:48 +02:00
parent ecba0d295a
commit 26172af89d
16 changed files with 4776 additions and 5146 deletions

View File

@ -39,7 +39,6 @@ typedef struct
uint attack_mode;
uint attack_kern;
uint attack_exec;
uint kernel_rules_cnt;
@ -130,7 +129,6 @@ typedef struct
uint maskcnt;
uint maskpos;
char *session;
char separator;
char *hashfile;
char *homedir;
char *install_dir;
@ -178,19 +176,7 @@ typedef struct
char *custom_charset_3;
char *custom_charset_4;
uint hash_mode;
uint hash_type;
uint kern_type;
uint opts_type;
uint salt_type;
uint esalt_size;
uint isSalted;
uint dgst_size;
uint opti_type;
uint dgst_pos0;
uint dgst_pos1;
uint dgst_pos2;
uint dgst_pos3;
hashconfig_t *hashconfig;
#if defined (HAVE_HWMON)
uint gpu_temp_disable;
@ -248,10 +234,6 @@ typedef struct
hashinfo_t **hash_info;
uint username;
int (*sort_by_digest) (const void *, const void *);
int (*parse_func) (char *, uint, hash_t *);
} hc_global_data_t;
#endif // _DATA_H

View File

@ -10,9 +10,9 @@
char *strhlfmt (const uint hashfile_format);
void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len);
void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len);
void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, hashconfig_t *hashconfig);
void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, hashconfig_t *hashconfig);
uint hlfmt_detect (FILE *fp, uint max_check);
uint hlfmt_detect (FILE *fp, uint max_check, hashconfig_t *hashconfig);
#endif // _HLFMT_H

View File

@ -7,6 +7,7 @@
#define _INTERFACE_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
@ -15,6 +16,30 @@
* types
*/
struct _hashconfig
{
char separator;
uint hash_mode;
uint hash_type;
uint salt_type;
uint attack_exec;
uint opts_type;
uint kern_type;
uint dgst_size;
uint esalt_size;
uint opti_type;
uint is_salted;
uint dgst_pos0;
uint dgst_pos1;
uint dgst_pos2;
uint dgst_pos3;
int (*parse_func) (char *, uint, hash_t *, const struct _hashconfig *);
};
typedef struct _hashconfig hashconfig_t;
typedef struct
{
uint iv[4];
@ -1360,162 +1385,162 @@ typedef enum rounds_count
* input functions
*/
int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf);
int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf);
int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int keepass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int veracrypt_parse_hash_200000 (char *input_buf, uint input_len, hash_t *hash_buf);
int veracrypt_parse_hash_500000 (char *input_buf, uint input_len, hash_t *hash_buf);
int veracrypt_parse_hash_327661 (char *input_buf, uint input_len, hash_t *hash_buf);
int veracrypt_parse_hash_655331 (char *input_buf, uint input_len, hash_t *hash_buf);
int win8phone_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int keepass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int veracrypt_parse_hash_200000 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int veracrypt_parse_hash_500000 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int veracrypt_parse_hash_327661 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int veracrypt_parse_hash_655331 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int win8phone_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig);
/**
* output functions
@ -1524,10 +1549,10 @@ int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash
char *strhashtype (const uint hash_mode);
char *strparser (const uint parser_status);
void to_hccap_t (hccap_t *hccap, uint salt_pos, uint digest_pos);
void to_hccap_t (hccap_t *hccap, uint salt_pos, uint digest_pos, hashconfig_t *hashconfig, void *digests_buf, salt_t *salts_buf, void *esalts_buf);
void truecrypt_crc32 (const char *filename, u8 keytab[64]);
void ascii_digest (char *out_buf, uint salt_pos, uint digest_pos, hashconfig_t *hashconfig, void *digests_buf, salt_t *salts_buf, void *esalts_buf, hashinfo_t **hash_info, char *hashfile);
void ascii_digest (char *out_buf, uint salt_pos, uint digest_pos);
int hashconfig_init (hashconfig_t *hashconfig, const uint hash_mode, const char separator, const uint hex_salt);
#endif // _INTERFACE_H

View File

@ -35,10 +35,10 @@ typedef struct
void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
void mp_cut_at (char *mask, uint max);
void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt);
cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt);
cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt, hashconfig_t *hashconfig);
u64 mp_get_sum (uint css_cnt, cs_t *css);
void mp_setup_sys (cs_t *mp_sys);
void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index);
void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index, hashconfig_t *hashconfig);
void mp_reset_usr (cs_t *mp_usr, uint index);
char *mp_get_truncated_mask (char *mask_buf, size_t mask_len, uint len);

View File

@ -13,6 +13,7 @@
#include "ext_nvml.h"
#include "ext_xnvctrl.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "rp_cpu.h"
#include "restore.h"

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@ static const char HLFMT_TEXT_NSLDAPS[] = "nsldaps";
// hlfmt hashcat
static void hlfmt_hash_hashcat (char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len)
static void hlfmt_hash_hashcat (char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, hashconfig_t *hashconfig)
{
if (data.username == 0)
{
@ -60,7 +60,7 @@ static void hlfmt_hash_hashcat (char *line_buf, int line_len, char **hashbuf_pos
for (int i = 0; i < line_len; i++, pos++, len--)
{
if (line_buf[i] == data.separator)
if (line_buf[i] == hashconfig->separator)
{
pos++;
@ -75,7 +75,7 @@ static void hlfmt_hash_hashcat (char *line_buf, int line_len, char **hashbuf_pos
}
}
static void hlfmt_user_hashcat (char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len)
static void hlfmt_user_hashcat (char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, hashconfig_t *hashconfig)
{
char *pos = NULL;
int len = 0;
@ -84,7 +84,7 @@ static void hlfmt_user_hashcat (char *line_buf, int line_len, char **userbuf_pos
for (int i = 0; i < line_len; i++)
{
if (line_buf[i] == data.separator)
if (line_buf[i] == hashconfig->separator)
{
sep_cnt++;
@ -130,7 +130,7 @@ static int hlfmt_detect_pwdump (char *line_buf, int line_len)
return 0;
}
static void hlfmt_hash_pwdump (char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len)
static void hlfmt_hash_pwdump (char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, hashconfig_t *hashconfig)
{
char *pos = NULL;
int len = 0;
@ -146,7 +146,7 @@ static void hlfmt_hash_pwdump (char *line_buf, int line_len, char **hashbuf_pos,
continue;
}
if (data.hash_mode == 1000)
if (hashconfig->hash_mode == 1000)
{
if (sep_cnt == 3)
{
@ -155,7 +155,7 @@ static void hlfmt_hash_pwdump (char *line_buf, int line_len, char **hashbuf_pos,
len++;
}
}
else if (data.hash_mode == 3000)
else if (hashconfig->hash_mode == 3000)
{
if (sep_cnt == 2)
{
@ -328,34 +328,34 @@ char *strhlfmt (const uint hashfile_format)
return ((char *) "Unknown");
}
void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len)
void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, hashconfig_t *hashconfig)
{
switch (hashfile_format)
{
case HLFMT_HASHCAT: hlfmt_hash_hashcat (line_buf, line_len, hashbuf_pos, hashbuf_len); break;
case HLFMT_PWDUMP: hlfmt_hash_pwdump (line_buf, line_len, hashbuf_pos, hashbuf_len); break;
case HLFMT_PASSWD: hlfmt_hash_passwd (line_buf, line_len, hashbuf_pos, hashbuf_len); break;
case HLFMT_SHADOW: hlfmt_hash_shadow (line_buf, line_len, hashbuf_pos, hashbuf_len); break;
case HLFMT_HASHCAT: hlfmt_hash_hashcat (line_buf, line_len, hashbuf_pos, hashbuf_len, hashconfig); break;
case HLFMT_PWDUMP: hlfmt_hash_pwdump (line_buf, line_len, hashbuf_pos, hashbuf_len, hashconfig); break;
case HLFMT_PASSWD: hlfmt_hash_passwd (line_buf, line_len, hashbuf_pos, hashbuf_len); break;
case HLFMT_SHADOW: hlfmt_hash_shadow (line_buf, line_len, hashbuf_pos, hashbuf_len); break;
}
}
void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len)
void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, hashconfig_t *hashconfig)
{
switch (hashfile_format)
{
case HLFMT_HASHCAT: hlfmt_user_hashcat (line_buf, line_len, userbuf_pos, userbuf_len); break;
case HLFMT_PWDUMP: hlfmt_user_pwdump (line_buf, line_len, userbuf_pos, userbuf_len); break;
case HLFMT_PASSWD: hlfmt_user_passwd (line_buf, line_len, userbuf_pos, userbuf_len); break;
case HLFMT_SHADOW: hlfmt_user_shadow (line_buf, line_len, userbuf_pos, userbuf_len); break;
case HLFMT_HASHCAT: hlfmt_user_hashcat (line_buf, line_len, userbuf_pos, userbuf_len, hashconfig); break;
case HLFMT_PWDUMP: hlfmt_user_pwdump (line_buf, line_len, userbuf_pos, userbuf_len); break;
case HLFMT_PASSWD: hlfmt_user_passwd (line_buf, line_len, userbuf_pos, userbuf_len); break;
case HLFMT_SHADOW: hlfmt_user_shadow (line_buf, line_len, userbuf_pos, userbuf_len); break;
}
}
uint hlfmt_detect (FILE *fp, uint max_check)
uint hlfmt_detect (FILE *fp, uint max_check, hashconfig_t *hashconfig)
{
// Exception: those formats are wrongly detected as HLFMT_SHADOW, prevent it
if (data.hash_mode == 5300) return HLFMT_HASHCAT;
if (data.hash_mode == 5400) return HLFMT_HASHCAT;
if (hashconfig->hash_mode == 5300) return HLFMT_HASHCAT;
if (hashconfig->hash_mode == 5400) return HLFMT_HASHCAT;
uint *formats_cnt = (uint *) mycalloc (HLFMTS_CNT, sizeof (uint));

View File

@ -17,6 +17,7 @@
#include "ext_nvml.h"
#include "ext_xnvctrl.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "rp_cpu.h"
#include "restore.h"

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,7 @@
#include "memory.h"
#include "hwmon.h"
#include "rp_cpu.h"
#include "interface.h"
#include "mpsp.h"
#include "opencl.h"
#include "restore.h"

View File

@ -24,6 +24,7 @@
#include "filehandling.h"
#include "thread.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "rp_cpu.h"
#include "opencl.h"
@ -60,7 +61,7 @@ void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHAR
}
}
static void mp_add_cs_buf (uint *in_buf, size_t in_len, cs_t *css, int css_cnt)
static void mp_add_cs_buf (uint *in_buf, size_t in_len, cs_t *css, int css_cnt, hashconfig_t *hashconfig)
{
cs_t *cs = &css[css_cnt];
@ -81,7 +82,7 @@ static void mp_add_cs_buf (uint *in_buf, size_t in_len, cs_t *css, int css_cnt)
{
uint u = in_buf[i] & 0xff;
if (data.opts_type & OPTS_TYPE_PT_UPPER) u = (uint) toupper (u);
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER) u = (uint) toupper (u);
if (css_uniq[u] == 1) continue;
@ -95,7 +96,7 @@ static void mp_add_cs_buf (uint *in_buf, size_t in_len, cs_t *css, int css_cnt)
myfree (css_uniq);
}
static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, int mp_usr_offset, int interpret)
static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, int mp_usr_offset, int interpret, hashconfig_t *hashconfig)
{
size_t in_pos;
@ -113,31 +114,31 @@ static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr,
switch (p1)
{
case 'l': mp_add_cs_buf (mp_sys[0].cs_buf, mp_sys[0].cs_len, mp_usr, mp_usr_offset);
case 'l': mp_add_cs_buf (mp_sys[0].cs_buf, mp_sys[0].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case 'u': mp_add_cs_buf (mp_sys[1].cs_buf, mp_sys[1].cs_len, mp_usr, mp_usr_offset);
case 'u': mp_add_cs_buf (mp_sys[1].cs_buf, mp_sys[1].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case 'd': mp_add_cs_buf (mp_sys[2].cs_buf, mp_sys[2].cs_len, mp_usr, mp_usr_offset);
case 'd': mp_add_cs_buf (mp_sys[2].cs_buf, mp_sys[2].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case 's': mp_add_cs_buf (mp_sys[3].cs_buf, mp_sys[3].cs_len, mp_usr, mp_usr_offset);
case 's': mp_add_cs_buf (mp_sys[3].cs_buf, mp_sys[3].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case 'a': mp_add_cs_buf (mp_sys[4].cs_buf, mp_sys[4].cs_len, mp_usr, mp_usr_offset);
case 'a': mp_add_cs_buf (mp_sys[4].cs_buf, mp_sys[4].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case 'b': mp_add_cs_buf (mp_sys[5].cs_buf, mp_sys[5].cs_len, mp_usr, mp_usr_offset);
case 'b': mp_add_cs_buf (mp_sys[5].cs_buf, mp_sys[5].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case '1': if (mp_usr[0].cs_len == 0) { log_error ("ERROR: Custom-charset 1 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[0].cs_buf, mp_usr[0].cs_len, mp_usr, mp_usr_offset);
mp_add_cs_buf (mp_usr[0].cs_buf, mp_usr[0].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case '2': if (mp_usr[1].cs_len == 0) { log_error ("ERROR: Custom-charset 2 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[1].cs_buf, mp_usr[1].cs_len, mp_usr, mp_usr_offset);
mp_add_cs_buf (mp_usr[1].cs_buf, mp_usr[1].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case '3': if (mp_usr[2].cs_len == 0) { log_error ("ERROR: Custom-charset 3 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[2].cs_buf, mp_usr[2].cs_len, mp_usr, mp_usr_offset);
mp_add_cs_buf (mp_usr[2].cs_buf, mp_usr[2].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case '4': if (mp_usr[3].cs_len == 0) { log_error ("ERROR: Custom-charset 4 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[3].cs_buf, mp_usr[3].cs_len, mp_usr, mp_usr_offset);
mp_add_cs_buf (mp_usr[3].cs_buf, mp_usr[3].cs_len, mp_usr, mp_usr_offset, hashconfig);
break;
case '?': mp_add_cs_buf (&p0, 1, mp_usr, mp_usr_offset);
case '?': mp_add_cs_buf (&p0, 1, mp_usr, mp_usr_offset, hashconfig);
break;
default: log_error ("Syntax error: %s", in_buf);
exit (-1);
@ -170,13 +171,13 @@ static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr,
chr = hex_convert (p1) << 0;
chr |= hex_convert (p0) << 4;
mp_add_cs_buf (&chr, 1, mp_usr, mp_usr_offset);
mp_add_cs_buf (&chr, 1, mp_usr, mp_usr_offset, hashconfig);
}
else
{
uint chr = p0;
mp_add_cs_buf (&chr, 1, mp_usr, mp_usr_offset);
mp_add_cs_buf (&chr, 1, mp_usr, mp_usr_offset, hashconfig);
}
}
}
@ -194,7 +195,7 @@ u64 mp_get_sum (uint css_cnt, cs_t *css)
return (sum);
}
cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt)
cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt, hashconfig_t *hashconfig)
{
cs_t *css = (cs_t *) mycalloc (256, sizeof (cs_t));
@ -217,31 +218,31 @@ cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, u
switch (p1)
{
case 'l': mp_add_cs_buf (mp_sys[0].cs_buf, mp_sys[0].cs_len, css, css_pos);
case 'l': mp_add_cs_buf (mp_sys[0].cs_buf, mp_sys[0].cs_len, css, css_pos, hashconfig);
break;
case 'u': mp_add_cs_buf (mp_sys[1].cs_buf, mp_sys[1].cs_len, css, css_pos);
case 'u': mp_add_cs_buf (mp_sys[1].cs_buf, mp_sys[1].cs_len, css, css_pos, hashconfig);
break;
case 'd': mp_add_cs_buf (mp_sys[2].cs_buf, mp_sys[2].cs_len, css, css_pos);
case 'd': mp_add_cs_buf (mp_sys[2].cs_buf, mp_sys[2].cs_len, css, css_pos, hashconfig);
break;
case 's': mp_add_cs_buf (mp_sys[3].cs_buf, mp_sys[3].cs_len, css, css_pos);
case 's': mp_add_cs_buf (mp_sys[3].cs_buf, mp_sys[3].cs_len, css, css_pos, hashconfig);
break;
case 'a': mp_add_cs_buf (mp_sys[4].cs_buf, mp_sys[4].cs_len, css, css_pos);
case 'a': mp_add_cs_buf (mp_sys[4].cs_buf, mp_sys[4].cs_len, css, css_pos, hashconfig);
break;
case 'b': mp_add_cs_buf (mp_sys[5].cs_buf, mp_sys[5].cs_len, css, css_pos);
case 'b': mp_add_cs_buf (mp_sys[5].cs_buf, mp_sys[5].cs_len, css, css_pos, hashconfig);
break;
case '1': if (mp_usr[0].cs_len == 0) { log_error ("ERROR: Custom-charset 1 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[0].cs_buf, mp_usr[0].cs_len, css, css_pos);
mp_add_cs_buf (mp_usr[0].cs_buf, mp_usr[0].cs_len, css, css_pos, hashconfig);
break;
case '2': if (mp_usr[1].cs_len == 0) { log_error ("ERROR: Custom-charset 2 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[1].cs_buf, mp_usr[1].cs_len, css, css_pos);
mp_add_cs_buf (mp_usr[1].cs_buf, mp_usr[1].cs_len, css, css_pos, hashconfig);
break;
case '3': if (mp_usr[2].cs_len == 0) { log_error ("ERROR: Custom-charset 3 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[2].cs_buf, mp_usr[2].cs_len, css, css_pos);
mp_add_cs_buf (mp_usr[2].cs_buf, mp_usr[2].cs_len, css, css_pos, hashconfig);
break;
case '4': if (mp_usr[3].cs_len == 0) { log_error ("ERROR: Custom-charset 4 is undefined\n"); exit (-1); }
mp_add_cs_buf (mp_usr[3].cs_buf, mp_usr[3].cs_len, css, css_pos);
mp_add_cs_buf (mp_usr[3].cs_buf, mp_usr[3].cs_len, css, css_pos, hashconfig);
break;
case '?': mp_add_cs_buf (&chr, 1, css, css_pos);
case '?': mp_add_cs_buf (&chr, 1, css, css_pos, hashconfig);
break;
default: log_error ("ERROR: Syntax error: %s", mask_buf);
exit (-1);
@ -278,13 +279,13 @@ cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, u
chr |= hex_convert (p1) << 0;
chr |= hex_convert (p0) << 4;
mp_add_cs_buf (&chr, 1, css, css_pos);
mp_add_cs_buf (&chr, 1, css, css_pos, hashconfig);
}
else
{
uint chr = p0;
mp_add_cs_buf (&chr, 1, css, css_pos);
mp_add_cs_buf (&chr, 1, css, css_pos, hashconfig);
}
}
}
@ -356,13 +357,13 @@ void mp_setup_sys (cs_t *mp_sys)
mp_sys[5].cs_len = pos; }
}
void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index)
void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index, hashconfig_t *hashconfig)
{
FILE *fp = fopen (buf, "rb");
if (fp == NULL || feof (fp)) // feof() in case if file is empty
{
mp_expand (buf, strlen (buf), mp_sys, mp_usr, index, 1);
mp_expand (buf, strlen (buf), mp_sys, mp_usr, index, 1, hashconfig);
}
else
{
@ -378,11 +379,11 @@ void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index)
{
log_info ("WARNING: Charset file corrupted");
mp_expand (buf, strlen (buf), mp_sys, mp_usr, index, 1);
mp_expand (buf, strlen (buf), mp_sys, mp_usr, index, 1, hashconfig);
}
else
{
mp_expand (mp_file, len, mp_sys, mp_usr, index, 0);
mp_expand (mp_file, len, mp_sys, mp_usr, index, 0, hashconfig);
}
}
}

View File

@ -21,6 +21,7 @@
#include "opencl.h"
#include "shared.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "restore.h"
#include "data.h"

View File

@ -17,6 +17,7 @@
#include "thread.h"
#include "rp_cpu.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "opencl.h"
#include "restore.h"

View File

@ -23,6 +23,7 @@
#include "rp_cpu.h"
#include "terminal.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "rp_cpu.h"
#include "opencl.h"

View File

@ -18,12 +18,13 @@
#include "rp_cpu.h"
#include "terminal.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "opencl.h"
#include "restore.h"
#include "interface.h"
#include "data.h"
//#include "shared.h"
#include "interface.h"
#include "status.h"
static const char ST_0000[] = "Initializing";
@ -287,6 +288,13 @@ void status_display ()
if (data.devices_status == STATUS_INIT) return;
if (data.devices_status == STATUS_STARTING) return;
hashconfig_t *hashconfig = data.hashconfig;
void *digests_buf = data.digests_buf;
salt_t *salts_buf = data.salts_buf;
void *esalts_buf = data.esalts_buf;
hashinfo_t **hash_info = data.hash_info;
char *hashfile = data.hashfile;
// in this case some required buffers are free'd, ascii_digest() would run into segfault
if (data.shutdown_inner == 1) return;
@ -305,7 +313,7 @@ void status_display ()
char *status_type = strstatus (data.devices_status);
uint hash_mode = data.hash_mode;
uint hash_mode = hashconfig->hash_mode;
char *hash_type = strhashtype (hash_mode); // not a bug
@ -373,15 +381,15 @@ void status_display ()
if (mask_len > 0)
{
if (data.opti_type & OPTI_TYPE_SINGLE_HASH)
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
{
if (data.opti_type & OPTI_TYPE_APPENDED_SALT)
if (hashconfig->opti_type & OPTI_TYPE_APPENDED_SALT)
{
mask_len -= data.salts_buf[0].salt_len;
}
}
if (data.opts_type & OPTS_TYPE_PT_UNICODE) mask_len /= 2;
if (hashconfig->opts_type & OPTS_TYPE_PT_UNICODE) mask_len /= 2;
tmp_len += snprintf (tmp_buf + tmp_len, sizeof (tmp_buf) - tmp_len, " [%i]", mask_len);
}
@ -490,7 +498,7 @@ void status_display ()
if (data.digests_cnt == 1)
{
if (data.hash_mode == 2500)
if (hashconfig->hash_mode == 2500)
{
wpa_t *wpa = (wpa_t *) data.esalts_buf;
@ -509,19 +517,19 @@ void status_display ()
wpa->orig_mac2[4],
wpa->orig_mac2[5]);
}
else if (data.hash_mode == 5200)
else if (hashconfig->hash_mode == 5200)
{
log_info ("Hash.Target....: File (%s)", data.hashfile);
}
else if (data.hash_mode == 9000)
else if (hashconfig->hash_mode == 9000)
{
log_info ("Hash.Target....: File (%s)", data.hashfile);
}
else if ((data.hash_mode >= 6200) && (data.hash_mode <= 6299))
else if ((hashconfig->hash_mode >= 6200) && (hashconfig->hash_mode <= 6299))
{
log_info ("Hash.Target....: File (%s)", data.hashfile);
}
else if ((data.hash_mode >= 13700) && (data.hash_mode <= 13799))
else if ((hashconfig->hash_mode >= 13700) && (hashconfig->hash_mode <= 13799))
{
log_info ("Hash.Target....: File (%s)", data.hashfile);
}
@ -529,7 +537,7 @@ void status_display ()
{
char out_buf[HCBUFSIZ_LARGE] = { 0 };
ascii_digest (out_buf, 0, 0);
ascii_digest (out_buf, 0, 0, hashconfig, digests_buf, salts_buf, esalts_buf, hash_info, hashfile);
// limit length
if (strlen (out_buf) > 40)
@ -545,13 +553,13 @@ void status_display ()
}
else
{
if (data.hash_mode == 3000)
if (hashconfig->hash_mode == 3000)
{
char out_buf1[32] = { 0 };
char out_buf2[32] = { 0 };
ascii_digest (out_buf1, 0, 0);
ascii_digest (out_buf2, 0, 1);
ascii_digest (out_buf1, 0, 0, hashconfig, digests_buf, salts_buf, esalts_buf, hash_info, hashfile);
ascii_digest (out_buf2, 0, 1, hashconfig, digests_buf, salts_buf, esalts_buf, hash_info, hashfile);
log_info ("Hash.Target....: %s, %s", out_buf1, out_buf2);
}
@ -1117,6 +1125,8 @@ void status_display ()
void status_benchmark_automate ()
{
hashconfig_t *hashconfig = data.hashconfig;
u64 speed_cnt[DEVICES_MAX] = { 0 };
double speed_ms[DEVICES_MAX] = { 0 };
@ -1152,7 +1162,7 @@ void status_benchmark_automate ()
if (device_param->skipped) continue;
log_info ("%u:%u:%" PRIu64 "", device_id + 1, data.hash_mode, (hashes_dev_ms[device_id] * 1000));
log_info ("%u:%u:%" PRIu64 "", device_id + 1, hashconfig->hash_mode, (hashes_dev_ms[device_id] * 1000));
}
}

View File

@ -24,6 +24,7 @@
#include "interface.h"
#include "shared.h"
#include "hwmon.h"
#include "interface.h"
#include "mpsp.h"
#include "restore.h"
#include "data.h"