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

Function _set_current_raw_offset

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

Source from the content-addressed store, hash-verified

1412
1413
1414def _set_current_raw_offset(instance: PythonScriptingInstance, old_value: Any, new_value: Any):
1415 if instance.interpreter.active_view is None:
1416 return
1417
1418 if isinstance(new_value, str):
1419 new_value = instance.interpreter.active_view.parse_expression(
1420 new_value,
1421 instance.interpreter.active_addr
1422 )
1423 if type(new_value) is not int:
1424 raise ValueError("Can only replace this variable with an integer")
1425
1426 addr = instance.interpreter.active_view.get_address_for_data_offset(new_value)
1427 if addr is not None:
1428 if not instance.interpreter.active_view.file.navigate(
1429 instance.interpreter.active_view.file.view, addr
1430 ):
1431 binaryninja.mainthread.execute_on_main_thread(
1432 lambda: instance.interpreter.locals["current_ui_context"].navigateForBinaryView(
1433 instance.interpreter.active_view,
1434 new_value
1435 )
1436 )
1437
1438
1439PythonScriptingProvider.register_magic_variable(

Callers

nothing calls this directly

Calls 3

parse_expressionMethod · 0.80
navigateMethod · 0.45

Tested by

no test coverage detected