enable path resolution on FreeBSD
[hashcat.git] / src / hashcat.c
index ede2326..9c5782d 100644 (file)
@@ -6,7 +6,7 @@
  * License.....: MIT
  */
 
-#ifdef DARWIN
+#if defined(DARWIN) || defined(__FreeBSD__)
 #include <stdio.h>
 #endif
 
@@ -6171,7 +6171,8 @@ int main (int argc, char **argv)
 
   char *exec_path = get_exec_path ();
 
-  #if defined(LINUX) || defined(__APPLE__)
+
+  #if defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
 
   char *resolved_install_folder = realpath (INSTALL_FOLDER, NULL);
   char *resolved_exec_path      = realpath (exec_path, NULL);
@@ -18393,6 +18394,10 @@ int main (int argc, char **argv)
         if (induction_dictionaries_cnt)
         {
           qsort (induction_dictionaries, induction_dictionaries_cnt, sizeof (char *), sort_by_mtime);
+
+          // yeah, this next statement is a little hack to make sure that --loopback runs correctly (because with it we guarantee that the loop iterates one more time)
+
+          dictpos--;
         }
 
         time_t runtime_stop;