@@ -76,6 +76,8 @@ def __init__(self, parent=None) -> None:
7676 super ().__init__ (parent )
7777 self ._data : list [MatchedFunction ] = []
7878 self ._func_id : int | None = None
79+ self ._analysis_id : int | None = None
80+ self ._portal_url : str = "https://portal.reveng.ai"
7981
8082 def rowCount (self , parent = QtCore .QModelIndex ()) -> int :
8183 return len (self ._data )
@@ -107,7 +109,7 @@ def data(
107109 return None # Button column - handled by delegate
108110
109111 elif role == QtCore .Qt .ItemDataRole .UserRole :
110- return f"https://portal.reveng.ai/function /{ self ._func_id } /compare?id ={ match .function_id } "
112+ return f"{ self . _portal_url } /analyses /{ self ._analysis_id } ?fn= { self . _func_id } &view=matching&matchingMode=single&alt ={ match .function_id } "
111113
112114 elif role == QtCore .Qt .ItemDataRole .TextAlignmentRole :
113115 if col == SimilarityTableColumns .SIMILARITY :
@@ -149,10 +151,12 @@ def headerData(
149151 return self .COLUMNS [section ]
150152 return None
151153
152- def set_data (self , func_id : int , data : list [MatchedFunction ]) -> None :
154+ def set_data (self , func_id : int , data : list [MatchedFunction ], analysis_id : int , portal_url : str ) -> None :
153155 self .beginResetModel ()
154156 self ._func_id = func_id
155157 self ._data = data
158+ self ._analysis_id = analysis_id
159+ self ._portal_url = portal_url
156160 self .endResetModel ()
157161
158162 def clear (self ) -> None :
@@ -266,15 +270,15 @@ def _on_button_clicked(self, index: QtCore.QModelIndex) -> None:
266270 QtGui .QDesktopServices .openUrl (QtCore .QUrl (url ))
267271
268272 def _on_fetch_finished (
269- self , func_id : int , func_addr : int , data : list [MatchedFunction ]
273+ self , func_id : int , func_addr : int , data : list [MatchedFunction ], analysis_id : int , portal_url : str
270274 ) -> None :
271275 """Handle successful API response (called on main thread)."""
272276 # Ignore results if user has moved to a different function
273277 if func_addr != self ._current_func_addr :
274278 return
275279
276280 if self ._model :
277- self ._model .set_data (func_id , data )
281+ self ._model .set_data (func_id , data , analysis_id , portal_url )
278282
279283 func_name = idaapi .get_func_name (func_addr ) or f"sub_{ func_addr :X} "
280284
@@ -295,6 +299,8 @@ def update_for_function(
295299 func_id : int ,
296300 func_addr : int ,
297301 data : list [MatchedFunction ],
302+ analysis_id : int ,
303+ portal_url : str ,
298304 force : bool = False ,
299305 ) -> None :
300306 if not force and func_addr == self ._current_func_addr :
@@ -313,4 +319,4 @@ def update_for_function(
313319 if self ._model :
314320 self ._model .clear ()
315321
316- self ._on_fetch_finished (func_id , func_addr , data )
322+ self ._on_fetch_finished (func_id , func_addr , data , analysis_id , portal_url )
0 commit comments