From 57d00b0eee4f55163e40705aedaec3ecc16c8ef2 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Mon, 11 Apr 2016 11:55:14 -0400 Subject: adding readme, arm-syscall, bin-info, and breakpoint plugins --- python/examples/breakpoint.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 python/examples/breakpoint.py (limited to 'python/examples/breakpoint.py') diff --git a/python/examples/breakpoint.py b/python/examples/breakpoint.py new file mode 100644 index 00000000..44df19e2 --- /dev/null +++ b/python/examples/breakpoint.py @@ -0,0 +1,16 @@ +from binaryninja import * + +def write_breakpoint(view, start, length): + """Sample function to show registering a plugin menu item for a range of bytes. Also possible: + register + register_for_address + register_for_function + """ + if view.arch.name.startswith("x86"): + view.write(start, "\xcc" * length) + elif view.arch.name == "armv7": + view.write(start, "\x7a\x00\x20\xe1" * (length/4)) + else: + log_error("No support for breakpoint on %s" % view.arch.name) + +PluginCommand.register_for_range("Convert to breakpoint", "Fill region with breakpoint instructions.", write_breakpoint) -- cgit v1.3.1