Skip to content

Commit

Permalink
Potential fix for #288
Browse files Browse the repository at this point in the history
BUG: For some reason, the function `extract_function_assembly_features()` might receive a list of basic blocks not containing the function's entry point and Diaphora didn't consider this possibility.

This is a bug I cannot reproduce at all but that, I think, can be easily fixed.
  • Loading branch information
joxeankoret committed Dec 22, 2023
1 parent 5690fa8 commit dfa2d46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions diaphora_ida.py
Original file line number Diff line number Diff line change
Expand Up @@ -2608,11 +2608,12 @@ def extract_function_assembly_features(self, assembly, f, image_base):
# stuff later on.
assembly_addrs = []

# After sorting our the addresses of basic blocks, be sure that the
# After sorting out the addresses of basic blocks, be sure that the
# very first address is always the entry point, no matter at what
# address it is.
base = f - image_base
keys.remove(base)
if base in keys:
keys.remove(base)
keys.insert(0, base)
for key in keys:
for line in assembly[key]:
Expand Down

0 comments on commit dfa2d46

Please sign in to comment.