Advertisement
joxeankoret

Untitled

Aug 6th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.12 KB | None | 0 0
  1. diff --git a/diaphora.py b/diaphora.py
  2. index 4d9d003..1511871 100755
  3. --- a/diaphora.py
  4. +++ b/diaphora.py
  5. @@ -249,6 +249,8 @@ class CBinDiff:
  6.      self.ignore_all_names = self.get_value_for("ignore_all_names", True)
  7.      # Ignore small functions?
  8.      self.ignore_small_functions = self.get_value_for("ignore_small_functions", False)
  9. +    # Number of CPU threads/cores to use?
  10. +    self.cpu_count = self.get_value_for("DIAPHORA_CPU_COUNT", cpu_count() - 1)
  11.      ####################################################################
  12.  
  13.    def __del__(self):
  14. @@ -1021,7 +1023,7 @@ class CBinDiff:
  15.      self.run_heuristics_for_category("Best")
  16.  
  17.    def run_heuristics_for_category(self, arg_category):
  18. -    total_cpus = cpu_count() - 1
  19. +    total_cpus = self.cpu_count
  20.      if total_cpus < 1:
  21.        total_cpus = 1
  22.  
  23. @@ -2007,7 +2009,8 @@ if __name__ == "__main__":
  24.  
  25.    if do_diff:
  26.      bd = CBinDiff(db1)
  27. -    bd.ignore_all_names = False
  28. +    if not is_ida:
  29. +      bd.ignore_all_names = False
  30.      bd.db = sqlite3.connect(db1, check_same_thread=True)
  31.      bd.db.text_factory = str
  32.      bd.db.row_factory = sqlite3.Row
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement