Remove workaround with multiple include folders; Instead use a naive escape function
[hashcat.git] / include / shared.h
index 1a6c536..ab8f517 100644 (file)
@@ -72,6 +72,20 @@ static inline int  CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 <
 #define hc_dlsym dlsym
 #endif
 
+#define HC_LOAD_FUNC2(ptr,name,type,var,libname,noerr) \
+  ptr->name = (type) hc_dlsym (ptr->var, #name); \
+  if (noerr != -1) { \
+    if (!ptr->name) { \
+      if (noerr == 1) { \
+        log_error ("ERROR: %s is missing from %s shared library.", #name, #libname); \
+        exit (-1); \
+      } else { \
+        log_info ("WARNING: %s is missing from %s shared library.", #name, #libname); \
+        return (-1); \
+      } \
+    } \
+  }
+
 #define HC_LOAD_FUNC(ptr,name,type,libname,noerr) \
   ptr->name = (type) hc_dlsym (ptr->lib, #name); \
   if (noerr != -1) { \
@@ -117,6 +131,7 @@ static inline int  CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 <
 #include "ext_ADL.h"
 #include "ext_nvapi.h"
 #include "ext_nvml.h"
+#include "ext_xnvctrl.h"
 
 /**
  * shared stuff
@@ -220,7 +235,6 @@ extern hc_thread_mutex_t mux_display;
 #define HT_00140  "sha1($salt.unicode($pass))"
 #define HT_00150  "HMAC-SHA1 (key = $pass)"
 #define HT_00160  "HMAC-SHA1 (key = $salt)"
-#define HT_00190  "sha1(LinkedIn)"
 #define HT_00200  "MySQL323"
 #define HT_00300  "MySQL4.1/MySQL5"
 #define HT_00400  "phpass, MD5(Wordpress), MD5(phpBB3), MD5(Joomla)"
@@ -453,8 +467,6 @@ extern hc_thread_mutex_t mux_display;
 #define DISPLAY_LEN_MAX_150   40 + 1 + 51
 #define DISPLAY_LEN_MIN_150H  40 + 1 + 0
 #define DISPLAY_LEN_MAX_150H  40 + 1 + 102
-#define DISPLAY_LEN_MIN_190   40
-#define DISPLAY_LEN_MAX_190   40
 #define DISPLAY_LEN_MIN_200   16
 #define DISPLAY_LEN_MAX_200   16
 #define DISPLAY_LEN_MIN_300   40
@@ -837,6 +849,7 @@ extern hc_thread_mutex_t mux_display;
 #define HASH_TYPE_BSDICRYPT      48
 #define HASH_TYPE_RAR3HP         49
 #define HASH_TYPE_KRB5TGS        50
+#define HASH_TYPE_STDOUT         51
 
 #define KERN_TYPE_MD5                 0
 #define KERN_TYPE_MD5_PWSLT           10
@@ -852,7 +865,6 @@ extern hc_thread_mutex_t mux_display;
 #define KERN_TYPE_SHA1_SLTPWU         140
 #define KERN_TYPE_HMACSHA1_PW         150
 #define KERN_TYPE_HMACSHA1_SLT        160
-#define KERN_TYPE_SHA1_LINKEDIN       190
 #define KERN_TYPE_MYSQL               200
 #define KERN_TYPE_MYSQL41             300
 #define KERN_TYPE_PHPASS              400
@@ -877,6 +889,7 @@ extern hc_thread_mutex_t mux_display;
 #define KERN_TYPE_HMACSHA512_PW       1750
 #define KERN_TYPE_HMACSHA512_SLT      1760
 #define KERN_TYPE_SHA512CRYPT         1800
+#define KERN_TYPE_STDOUT              2000
 #define KERN_TYPE_DCC2                2100
 #define KERN_TYPE_MD5PIX              2400
 #define KERN_TYPE_MD5ASA              2410
@@ -1125,6 +1138,7 @@ extern hc_thread_mutex_t mux_display;
 #define ROUNDS_AXCRYPT            10000
 #define ROUNDS_KEEPASS            6000
 #define ROUNDS_ZIP2               1000
+#define ROUNDS_STDOUT             0
 
 /**
  * salt types
@@ -1216,7 +1230,6 @@ extern hc_thread_mutex_t mux_display;
  * digests
  */
 
-#define DGST_SIZE_0                 0
 #define DGST_SIZE_4_2               (2  * sizeof (uint))   // 8
 #define DGST_SIZE_4_4               (4  * sizeof (uint))   // 16
 #define DGST_SIZE_4_5               (5  * sizeof (uint))   // 20
@@ -1463,6 +1476,8 @@ int hm_get_memoryspeed_with_device_id        (const uint device_id);
 int hm_get_corespeed_with_device_id          (const uint device_id);
 int hm_get_throttle_with_device_id           (const uint device_id);
 int hm_set_fanspeed_with_device_id_adl       (const uint device_id, const int fanspeed, const int fanpolicy);
+int hm_set_fanspeed_with_device_id_nvapi     (const uint device_id, const int fanspeed, const int fanpolicy);
+int hm_set_fanspeed_with_device_id_xnvctrl   (const uint device_id, const int fanspeed);
 
 void hm_device_val_to_str (char *target_buf, int max_buf_size, char *suffix, int value);
 #endif // HAVE_HWMON
@@ -1533,7 +1548,6 @@ int osx1_parse_hash               (char *input_buf, uint input_len, hash_t *hash
 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 sha1linkedin_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);
@@ -1654,6 +1668,7 @@ int veracrypt_parse_hash_327661   (char *input_buf, uint input_len, hash_t *hash
 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);
 
+void naive_escape (const char *cpath_real, char *cpath_escaped);
 void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources);
 void writeProgramBin (char *dst, u8 *binary, size_t binary_size);