├── LICENSE ├── README.md ├── __init__.py └── plugin.json /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Josh Watson. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bookmarks (v0.3b) **DEPRECATED** 2 | Author: **Josh Watson** 3 | 4 | _A plugin that adds bookmarking functionality._ 5 | 6 | ## Description: 7 | 8 | # !!! This plugin is deprecated, now that Binary Ninja has tags as part of the Core !!! 9 | 10 | This plugin enables a Binary Ninja user to bookmark addresses of interest and quickly navigate back to them at a later time. 11 | 12 | To install this plugin, navigate to your Binary Ninja plugins directory, and run 13 | 14 | ```git clone https://github.com/joshwatson/binaryninja-bookmarks.git bookmarks``` 15 | 16 | Then create a python file called `bookmarks.py` with the contents 17 | 18 | ```import bookmarks``` 19 | 20 | ## Minimum Version 21 | 22 | This plugin requires the following minimum version of Binary Ninja: 23 | 24 | * dev - 1.0.dev-815 25 | 26 | 27 | 28 | ## License 29 | 30 | This plugin is released under a [MIT](LICENSE) license. 31 | 32 | 33 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | ''' 2 | bookmarks.py - Create/List bookmarks in Binary Ninja 3 | 4 | Copyright (c) 2016 Josh Watson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a 7 | copy of this software and associated documentation files (the "Software"), 8 | to deal in the Software without restriction, including without limitation 9 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | and/or sell copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | DEALINGS IN THE SOFTWARE. 23 | ''' 24 | from collections import OrderedDict 25 | 26 | import binaryninja as bn 27 | 28 | 29 | def create_bookmark(view, address): 30 | try: 31 | bookmarks = view.query_metadata('bookmarks') 32 | except KeyError: 33 | bookmarks = OrderedDict() 34 | view.store_metadata('bookmarks', bookmarks) 35 | 36 | bookmark_name = bn.get_text_line_input( 37 | "Create new bookmark", "Enter bookmark name:" 38 | ) 39 | if bookmark_name: 40 | bookmarks[address] = bookmark_name 41 | view.store_metadata("bookmarks", bookmarks) 42 | view.modified = True 43 | 44 | 45 | def goto_bookmark(view): 46 | try: 47 | bookmarks = view.query_metadata('bookmarks') 48 | except KeyError: 49 | bookmarks = OrderedDict() 50 | view.store_metadata('bookmarks', bookmarks) 51 | 52 | if not bookmarks: 53 | bn.show_message_box( 54 | 'Bookmark error', 'There are no bookmarks yet.', 55 | icon=bn.enums.MessageBoxIcon.ErrorIcon 56 | ) 57 | return 58 | 59 | # Metadata can only store string keys in dictionaries currently. 60 | # Therefore, we have to convert keys to integers. 61 | chosen_bookmark = bn.get_choice_input( 62 | 'Go to bookmark', 'Bookmarks:', 63 | ['0x{:x} {}'.format(int(addr), bookmark) 64 | for addr, bookmark in bookmarks.iteritems()] 65 | ) 66 | 67 | # Again, we hae to convert string keys to integers. 68 | if chosen_bookmark is not None: 69 | navigate_to = int(bookmarks.keys()[chosen_bookmark]) 70 | 71 | view.file.navigate(view.file.view, navigate_to) 72 | 73 | 74 | bn.PluginCommand.register_for_address( 75 | 'Create Bookmark', 'Create a bookmark at this address.', create_bookmark 76 | ) 77 | bn.PluginCommand.register('Go to Bookmark', 'Go to a bookmark.', goto_bookmark) -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugin": { 3 | "name": "Bookmarks", 4 | "type": ["ui"], 5 | "api": "python2", 6 | "description": "A plugin that adds bookmarking functionality.", 7 | "longdescription": "This plugin enables a Binary Ninja user to bookmark addresses of interest and quickly navigate back to them at a later time.\n\nTo install this plugin, navigate to your Binary Ninja plugins directory, and run\n\n```git clone https://github.com/joshwatson/binaryninja-bookmarks.git bookmarks```\n\nThen create a python file called `bookmarks.py` with the contents\n\n```import bookmarks```", 8 | "license": { 9 | "name": "MIT", 10 | "text": "Copyright (c) 2016 Josh Watson.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." 11 | }, 12 | "version": "0.3b", 13 | "author": "Josh Watson", 14 | "minimumBinaryNinjaVersion": { 15 | "dev": "1.0.dev-815" 16 | } 17 | } 18 | } 19 | --------------------------------------------------------------------------------