summaryrefslogtreecommitdiff
path: root/examples/breakpoint/src/breakpoint.cpp
diff options
context:
space:
mode:
authorAndrew Lamoureux <lwerdna@users.noreply.github.com>2017-03-15 20:35:37 -0400
committerGitHub <noreply@github.com>2017-03-15 20:35:37 -0400
commitc7c12a27abbd8a01d9425598ac7cd424dcfa50ce (patch)
tree9347ba4e5e6a2b26baf620f59e56db7965bb47b5 /examples/breakpoint/src/breakpoint.cpp
parent1f7523ce2b1edac1014d781fc771d5b82568e2f1 (diff)
parent31d34d5d067ed4c5fe071eb8637b10ed50607555 (diff)
Merge pull request #573 from jhurliman/dev
CMake files for building binaryninja-api and example c++ plugin
Diffstat (limited to 'examples/breakpoint/src/breakpoint.cpp')
-rw-r--r--examples/breakpoint/src/breakpoint.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/examples/breakpoint/src/breakpoint.cpp b/examples/breakpoint/src/breakpoint.cpp
index 41476411..4fac98ac 100644
--- a/examples/breakpoint/src/breakpoint.cpp
+++ b/examples/breakpoint/src/breakpoint.cpp
@@ -6,31 +6,31 @@ using namespace std;
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"
{
- BINARYNINJAPLUGIN bool CorePluginInit()
- {
+ BINARYNINJAPLUGIN bool CorePluginInit()
+ {
// Register the plugin with Binary Ninja
PluginCommand::RegisterForRange("Convert to breakpoint",
"Fill region with breakpoint instructions.",
&write_breakpoint);
- return true;
- }
-}
+ return true;
+ }
+} \ No newline at end of file