| 5 | using namespace std; |
| 6 | |
| 7 | void write_breakpoint(BinaryNinja::BinaryView* view, uint64_t start, uint64_t length) |
| 8 | { |
| 9 | // Sample function to show registering a plugin menu item for a range of bytes. |
| 10 | // Also possible: |
| 11 | // register |
| 12 | // register_for_address |
| 13 | // register_for_function |
| 14 | |
| 15 | Ref<Architecture> arch = view->GetDefaultArchitecture(); |
| 16 | string arch_name = arch->GetName(); |
| 17 | |
| 18 | if (arch_name.compare(0, 3, "x86") == 0) |
| 19 | { |
| 20 | string int3s = string(length, '\xcc'); |
| 21 | view->Write(start, int3s.c_str(), length); |
| 22 | } |
| 23 | else |
| 24 | { |
| 25 | LogError("No support for breakpoint on %s", arch_name.c_str()); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | extern "C" |
| 30 | { |
nothing calls this directly
no test coverage detected