joxeankoret icon

Untitled

joxeankoret | PRO | 08/06/19 11:48:46 AM UTC | 0 ⭐ | 376 👁️ | Never ⏰ | []
Diff |

1.12 KB

|

None

|

0 👍

/

0 👎

diff --git a/diaphora.py b/diaphora.py
index 4d9d003..1511871 100755
--- a/diaphora.py
+++ b/diaphora.py
@@ -249,6 +249,8 @@ class CBinDiff:
     self.ignore_all_names = self.get_value_for("ignore_all_names", True)
     # Ignore small functions?
     self.ignore_small_functions = self.get_value_for("ignore_small_functions", False)
+    # Number of CPU threads/cores to use?
+    self.cpu_count = self.get_value_for("DIAPHORA_CPU_COUNT", cpu_count() - 1)
     ####################################################################
 
   def __del__(self):
@@ -1021,7 +1023,7 @@ class CBinDiff:
     self.run_heuristics_for_category("Best")
 
   def run_heuristics_for_category(self, arg_category):
-    total_cpus = cpu_count() - 1
+    total_cpus = self.cpu_count
     if total_cpus < 1:
       total_cpus = 1
 
@@ -2007,7 +2009,8 @@ if __name__ == "__main__":
 
   if do_diff:
     bd = CBinDiff(db1)
-    bd.ignore_all_names = False
+    if not is_ida:
+      bd.ignore_all_names = False
     bd.db = sqlite3.connect(db1, check_same_thread=True)
     bd.db.text_factory = str
     bd.db.row_factory = sqlite3.Row

Comments