Skip to content

Commit 25eda27

Browse files
committed
fix: auto-unstrip renaming
1 parent 25b4e03 commit 25eda27

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

reai_toolkit/features/auto_unstrip/auto_unstrip.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ def rename_functions(self, bv: BinaryView, options: List[Dict]):
8383
try:
8484
renamed_count = 0
8585
for option in options:
86-
if rename_function_util(bv, option['virtual_address'], option['suggested_name']):
86+
if rename_function_util(
87+
self.config,
88+
bv,
89+
option['virtual_address'],
90+
option['suggested_name'],
91+
option['suggested_mangled_name'],
92+
option['source_function_id'],
93+
):
8794
renamed_count += 1
8895
return True, f"Successfully renamed {renamed_count} functions"
8996
except Exception as e:
@@ -122,15 +129,28 @@ def auto_unstrip(self, bv: BinaryView):
122129
else:
123130
raise Exception(api_response.error)
124131
for match in matches:
132+
print(match, flush=True)
125133
try:
126134
if self.cancelled.is_set():
127135
return False, "Operation cancelled"
128136

129137
function = get_function_by_addr_util(bv, match.function_vaddr)
130-
results.append({"virtual_address": match.function_vaddr, "current_name": function.name, "suggested_name": match.suggested_demangled_name})
138+
results.append({
139+
"virtual_address": match.function_vaddr,
140+
"current_name": function.name,
141+
"suggested_name": match.suggested_demangled_name,
142+
"suggested_mangled_name": match.suggested_name,
143+
"source_function_id": match.function_id,
144+
})
131145
except Exception as e:
132146
log_error(f"RevEng.AI | Error getting function by address {match.function_vaddr}: {str(e)}")
133-
results.append({"virtual_address": match.function_vaddr, "current_name": "N/A", "suggested_name": match.suggested_demangled_name})
147+
results.append({
148+
"virtual_address": match.function_vaddr,
149+
"current_name": "N/A",
150+
"suggested_name": match.suggested_demangled_name,
151+
"suggested_mangled_name": match.suggested_name,
152+
"source_function_id": match.function_id,
153+
})
134154

135155
if self.cancelled.is_set():
136156
return False, "Operation cancelled"

reai_toolkit/features/auto_unstrip/auto_unstrip_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def populate_results_table(self, results):
145145
select_item.setFlags(Qt.ItemIsUserCheckable | Qt.ItemIsEnabled | Qt.ItemIsSelectable)
146146
select_item.setCheckState(Qt.Checked)
147147
self.results_table.setItem(i, 0, select_item)
148-
148+
149149
columns = [
150150
(1, "virtual_address", lambda x: f"0x{x:x}" if isinstance(x, int) else str(x)),
151151
(2, "current_name", lambda x: str(x)),

reai_toolkit/features/view_analysis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self, config=None):
88

99
def register(self):
1010
PluginCommand.register(
11-
"RevEng.AI\\Analysis\\\u200b\u200bView Analysis",
11+
"RevEng.AI\\Analysis\\\u200b\u200bView in portal",
1212
"View the current analysis in the RevEng.AI portal",
1313
self.open_analysis,
1414
self.is_valid

0 commit comments

Comments
 (0)