re_similar, re_struct_audit; next_functions favours raw functions with a readable near-duplicate

This commit is contained in:
KeelrLeek committed 2026-10-05 13:45:16 -05:00
1 parent 2d2f5fe7c5
commit 07a031109b
4 files changed
+65 -4

No files matched your search

+9
View File
@@ -103,6 +103,15 @@ class FunctionQueue:
return {int(row["address"], 16): row for row in csv.DictReader(f)}
return {int(row["address"], 16): row for row in json.loads(Path(path).read_text(encoding="utf-8"))}
def similar_readable(self):
"""Raw functions with a readable near-duplicate (from the [reverse] similar_clusters file)."""
path = self.config.get("similar_clusters")
if not path or not Path(path).exists():
return frozenset()
data = json.loads(Path(path).read_text(encoding="utf-8"))
return frozenset(int(m["address"], 16) for c in data.get("clusters", []) for m in c.get("members", [])
if m.get("best_readable") and m.get("status") != "readable")
# ------------------------------------------------------------------ queue
def score(self, addr, facts, named, rejected, similar_readable=frozenset()):
d = facts[addr]