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

Function _set_current_comment

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

Source from the content-addressed store, hash-verified

1384
1385
1386def _set_current_comment(instance: PythonScriptingInstance, old_value: Any, new_value: Any):
1387 if instance.interpreter.active_view is None:
1388 return
1389
1390 if instance.interpreter.active_func is None:
1391 instance.interpreter.active_view.set_comment_at(instance.interpreter.active_addr, new_value)
1392 else:
1393 if instance.interpreter.active_view.get_comment_at(instance.interpreter.active_addr) != '':
1394 # Prefer editing active view comment if one exists
1395 instance.interpreter.active_view.set_comment_at(instance.interpreter.active_addr, new_value)
1396 else:
1397 instance.interpreter.active_func.set_comment_at(instance.interpreter.active_addr, new_value)
1398
1399
1400PythonScriptingProvider.register_magic_variable(

Callers

nothing calls this directly

Calls 2

set_comment_atMethod · 0.45
get_comment_atMethod · 0.45

Tested by

no test coverage detected