MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / _set_here

Function _set_here

python/scriptingprovider.py:1336–1357  ·  view source on GitHub ↗
(instance: PythonScriptingInstance, old_value: Any, new_value: Any)

Source from the content-addressed store, hash-verified

1334
1335
1336def _set_here(instance: PythonScriptingInstance, old_value: Any, new_value: Any):
1337 if instance.interpreter.active_view is None:
1338 return
1339
1340 if isinstance(new_value, str):
1341 new_value = instance.interpreter.active_view.parse_expression(
1342 new_value,
1343 instance.interpreter.active_addr
1344 )
1345 if type(new_value) is not int:
1346 raise ValueError("Can only replace this variable with an integer")
1347
1348 if not instance.interpreter.active_view.file.navigate(
1349 instance.interpreter.active_view.file.view,
1350 new_value
1351 ):
1352 binaryninja.mainthread.execute_on_main_thread(
1353 lambda: instance.interpreter.locals["current_ui_context"].navigateForBinaryView(
1354 instance.interpreter.active_view,
1355 new_value
1356 )
1357 )
1358
1359
1360PythonScriptingProvider.register_magic_variable(

Callers

nothing calls this directly

Calls 2

parse_expressionMethod · 0.80
navigateMethod · 0.45

Tested by

no test coverage detected