Windows doesn't accept escape characters, falling back to old method for windows
[hashcat.git] / src / shared.c
index e1ce922..12d7706 100644 (file)
@@ -5903,7 +5903,6 @@ char *strhashtype (const uint hash_mode)
     case   141: return ((char *) HT_00141); break;
     case   150: return ((char *) HT_00150); break;
     case   160: return ((char *) HT_00160); break;
-    case   190: return ((char *) HT_00190); break;
     case   200: return ((char *) HT_00200); break;
     case   300: return ((char *) HT_00300); break;
     case   400: return ((char *) HT_00400); break;
@@ -9221,6 +9220,27 @@ void myquit ()
   data.devices_status = STATUS_QUIT;
 }
 
+void naive_escape (const char *cpath_real, char *cpath_escaped, const size_t cpath_escaped_len)
+{
+  const size_t len = strlen (cpath_real);
+
+  for (size_t in = 0, out = 0; in < len; in++, out++)
+  {
+    const u8 c = cpath_real[in];
+
+    if (c == ' ')
+    {
+      cpath_escaped[out] = '\\';
+
+      out++;
+    }
+
+    if (out == cpath_escaped_len) break;
+
+    cpath_escaped[out] = c;
+  }
+}
+
 void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources)
 {
   FILE *fp = fopen (kernel_file, "rb");
@@ -12005,21 +12025,6 @@ int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
   return (PARSER_OK);
 }
 
-int sha1linkedin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
-{
-  if ((input_len < DISPLAY_LEN_MIN_100) || (input_len > DISPLAY_LEN_MAX_100)) return (PARSER_GLOBAL_LENGTH);
-
-  u32 *digest = (u32 *) hash_buf->digest;
-
-  digest[0] = hex_to_u32 ((const u8 *) &input_buf[ 0]);
-  digest[1] = hex_to_u32 ((const u8 *) &input_buf[ 8]);
-  digest[2] = hex_to_u32 ((const u8 *) &input_buf[16]);
-  digest[3] = hex_to_u32 ((const u8 *) &input_buf[24]);
-  digest[4] = hex_to_u32 ((const u8 *) &input_buf[32]);
-
-  return (PARSER_OK);
-}
-
 int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
 {
   if ((input_len < DISPLAY_LEN_MIN_13300) || (input_len > DISPLAY_LEN_MAX_13300)) return (PARSER_GLOBAL_LENGTH);