@@ -10,19 +10,7 @@ def __init__(self, config):
1010 self .auto_unstrip_distance = 0.09999999999999998
1111 self .base_addr = None
1212 self .path = None
13- self ._analysed_functions = {}
14- self ._functions = []
15- self .function_ids = []
16- self .max_workers = 4 # Number of parallel threads
17-
18- def _get_all_functions (self ):
19- return list (self .bv .functions )
20-
21- def _get_analysed_functions (self ):
22- return self ._analysed_functions
23-
24- def _get_sync_analysed_ids_local (self ):
25- return self .function_ids
13+ self .max_workers = 4
2614
2715 def _rename_function (self , bv : BinaryView , addr : int , new_name : str , new_name_mangled : str ) -> bool :
2816 try :
@@ -38,7 +26,7 @@ def _rename_function(self, bv: BinaryView, addr: int, new_name: str, new_name_ma
3826 new_symbol = Symbol (SymbolType .FunctionSymbol , addr , new_name_mangled )
3927 bv .define_user_symbol (new_symbol )
4028
41- log_info (f"RevEng.AI | Renamed function at { hex (addr )} to { new_name } " )
29+ log_info (f"RevEng.AI | Renamed function at { hex (addr )} to { new_name_mangled } " )
4230 return True
4331
4432 except Exception as e :
@@ -90,7 +78,6 @@ def auto_unstrip(self, bv: BinaryView):
9078 self .path = bv .file .filename
9179 log_info (f"RevEng.AI | Path: { self .path } " )
9280 log_info (f"RevEng.AI | Binary ID: { self .config .binary_id } " )
93- self ._analysed_functions = {}
9481
9582 results = RE_search (fpath = self .path ).json ()["query_results" ]
9683 log_info (f"RevEng.AI | Search Results: { results } " )
@@ -106,23 +93,19 @@ def auto_unstrip(self, bv: BinaryView):
10693 for func in analyzed_functions
10794 }
10895
109- # Use fixed chunk size of 50
11096 chunk_size = 50
11197 chunks = [function_ids [i :i + chunk_size ] for i in range (0 , len (function_ids ), chunk_size )]
11298
11399 log_info (f"RevEng.AI | Processing { len (function_ids )} functions in { len (chunks )} chunks of size { chunk_size } " )
114100
115- # Process chunks in parallel
116101 total_renamed = 0
117102 all_errors = []
118103 with ThreadPoolExecutor (max_workers = self .max_workers ) as executor :
119- # Submit all tasks
120104 future_to_chunk = {
121105 executor .submit (self ._process_batch , chunk , id_to_addr , bv ): i
122106 for i , chunk in enumerate (chunks )
123107 }
124108
125- # Wait for all tasks to complete and collect results
126109 for future in as_completed (future_to_chunk ):
127110 chunk_index = future_to_chunk [future ]
128111 try :
@@ -146,12 +129,4 @@ def auto_unstrip(self, bv: BinaryView):
146129
147130 except Exception as e :
148131 log_error (f"RevEng.AI | Error: { str (e )} " )
149- return False , str (e )
150- """
151- self._functions = self._get_all_functions()
152- self._get_analysed_functions()
153- self.function_ids = self._get_sync_analysed_ids_local()
154-
155- log_info(f"RevEng.AI | {bv.file.original_filename}")
156- """
157-
132+ return False , str (e )
0 commit comments