diff options
| author | KyleMiles <krm504@nyu.edu> | 2022-01-27 22:43:28 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2022-01-28 00:24:06 -0500 |
| commit | 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 (patch) | |
| tree | dace4156d03148bcaf02df138ab4e0d93e61bc6f /examples/breakpoint | |
| parent | 519c9db22367f2659d1a54599fab47e6313be06e (diff) | |
Format All Files
Diffstat (limited to 'examples/breakpoint')
| -rw-r--r-- | examples/breakpoint/src/breakpoint.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/examples/breakpoint/src/breakpoint.cpp b/examples/breakpoint/src/breakpoint.cpp index 65c8d018..75156e1d 100644 --- a/examples/breakpoint/src/breakpoint.cpp +++ b/examples/breakpoint/src/breakpoint.cpp @@ -4,35 +4,37 @@ using namespace BinaryNinja; using namespace std; -void write_breakpoint(BinaryNinja::BinaryView *view, uint64_t start, uint64_t length) +void write_breakpoint(BinaryNinja::BinaryView* view, uint64_t start, uint64_t length) { - // Sample function to show registering a plugin menu item for a range of bytes. - // Also possible: - // register - // register_for_address - // register_for_function + // Sample function to show registering a plugin menu item for a range of bytes. + // Also possible: + // register + // register_for_address + // register_for_function - Ref<Architecture> arch = view->GetDefaultArchitecture(); - string arch_name = arch->GetName(); + Ref<Architecture> arch = view->GetDefaultArchitecture(); + string arch_name = arch->GetName(); - if (arch_name.compare(0, 3, "x86") == 0) { - string int3s = string(length, '\xcc'); - view->Write(start, int3s.c_str(), length); - } else { - LogError("No support for breakpoint on %s", arch_name.c_str()); - } + if (arch_name.compare(0, 3, "x86") == 0) + { + string int3s = string(length, '\xcc'); + view->Write(start, int3s.c_str(), length); + } + else + { + LogError("No support for breakpoint on %s", arch_name.c_str()); + } } extern "C" { - BN_DECLARE_CORE_ABI_VERSION + BN_DECLARE_CORE_ABI_VERSION - BINARYNINJAPLUGIN bool CorePluginInit() - { - // Register the plugin with Binary Ninja - PluginCommand::RegisterForRange("Convert to breakpoint", - "Fill region with breakpoint instructions.", - &write_breakpoint); - return true; - } + BINARYNINJAPLUGIN bool CorePluginInit() + { + // Register the plugin with Binary Ninja + PluginCommand::RegisterForRange( + "Convert to breakpoint", "Fill region with breakpoint instructions.", &write_breakpoint); + return true; + } }
\ No newline at end of file |
