pax_global_header 0000666 0000000 0000000 00000000064 12707172125 0014516 g ustar 00root root 0000000 0000000 52 comment=b7f1cc0261ddfc5fbe1d8de6735f91be85961008 voltron-0.1.4/ 0000775 0000000 0000000 00000000000 12707172125 0013223 5 ustar 00root root 0000000 0000000 voltron-0.1.4/.gitignore 0000664 0000000 0000000 00000000552 12707172125 0015215 0 ustar 00root root 0000000 0000000 ### Python ### *.py[cod] # C extensions *.so # Packages *.egg *.egg-info dist build eggs parts bin var sdist develop-eggs .installed.cfg lib lib64 __pycache__ # Installer logs pip-log.txt # Unit test / coverage reports .coverage .tox nosetests.xml # Translations *.mo # Mr Developer .mr.developer.cfg .project .pydevproject # Rope .ropeproject .DS_Store voltron-0.1.4/.travis.yml 0000664 0000000 0000000 00000002237 12707172125 0015340 0 ustar 00root root 0000000 0000000 language: python matrix: include: - os: linux sudo: required dist: trusty python: "3.3" - os: linux sudo: required dist: trusty python: "3.4" - os: linux sudo: required dist: trusty python: "3.5" - os: osx osx_image: xcode7.2 language: generic addons: apt: packages: - build-essential - gdb before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; brew install python ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq ; sudo apt-get install lldb-3.4 ; fi install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install mock pexpect nose ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install mock pexpect nose --user; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install . ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install . --user; fi script: - python --version - mkdir ~/.voltron - echo '{"general":{"debug_logging":true}}' >~/.voltron/config - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python -m nose -sv tests/gdb_cli_tests.py ; fi - python -m nose -sv tests/lldb_cli_tests.py voltron-0.1.4/LICENSE 0000664 0000000 0000000 00000002060 12707172125 0014226 0 ustar 00root root 0000000 0000000 The MIT License (MIT) Copyright (c) 2016 snare 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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. voltron-0.1.4/README.md 0000664 0000000 0000000 00000016200 12707172125 0014501 0 ustar 00root root 0000000 0000000 Voltron =======  Voltron is an extensible debugger UI toolkit written in Python. It aims to improve the user experience of various debuggers (LLDB, GDB, VDB and WinDbg) by enabling the attachment of utility views that can retrieve and display data from the debugger host. By running these views in other TTYs, you can build a customised debugger user interface to suit your needs. Voltron does not aim to be everything to everyone. It's not a wholesale replacement for your debugger's CLI. Rather, it aims to complement your existing setup and allow you to extend your CLI debugger as much or as little as you like. If you just want a view of the register contents in a window alongside your debugger, you can do that. If you want to go all out and have something that looks more like OllyDbg, you can do that too. Built-in views are provided for: - Registers - Disassembly - Stack - Memory - Breakpoints - Backtrace The author's setup looks something like this:  Any debugger command can be split off into a view and highlighted with a specified Pygments lexer:  More screenshots are [here](https://github.com/snare/voltron/wiki/Screenshots). Support ------- `voltron` supports LLDB, GDB, VDB and WinDbg/CDB (via [PyKD](https://pykd.codeplex.com/)) and runs on OS X, Linux and Windows. WinDbg support is new, please [open an issue](https://github.com/snare/voltron/issues) if you have problems. The following architectures are supported: | | lldb | gdb | vdb | windbg | |---------|------|-----|-----|--------| | x86 | ✓ | ✓ | ✓ | ✓ | | x86_64 | ✓ | ✓ | ✓ | ✓ | | arm | ✓ | ✓ | ✓ | ✗ | | arm64 | ✓ | ✗ | ✗ | ✗ | | powerpc | ✗ | ✓ | ✗ | ✗ | Installation ------------ Releases are on PyPI. Install with `pip`: $ pip install voltron If you want to be bleeding edge, clone this repo and install with `setup.py`: $ python setup.py install Quick Start ----------- 1. If your debugger has an init script (`.lldbinit` for LLDB or `.gdbinit` for GDB) configure it to load Voltron when it starts by sourcing the `entry.py` entry point script. The full path will be inside the `voltron` package. For example, on OS X it might be */Library/Python/2.7/site-packages/voltron/entry.py*. If you don't add this to your init script, you'll need to execute the commands after starting your debugger. LLDB: command script import /path/to/voltron/entry.py GDB: source /path/to/voltron/entry.py voltron init set disassembly-flavor intel 2. Start your debugger and initialise Voltron manually if necessary. On recent versions of LLDB you do not need to initialise Voltron manually: $ lldb target_binary On older versions of LLDB you need to call `voltron init` after you load the inferior: $ lldb target_binary (lldb) voltron init GDB: $ gdb target_binary VDB: $ ./vdbbin target_binary > script /path/to/voltron/entry.py WinDbg/CDB (requires [PyKD](https://pykd.codeplex.com/)): > cdb -c '.load C:\path\to\pykd.pyd ; !py --global C:\path\to\voltron\entry.py' target_binary 3. In another terminal (I use iTerm panes) start one of the UI views. On LLDB and WinDbg the views will update immediately. On GDB and VDB they will not update until the inferior stops (at a breakpoint, after a step, etc): $ voltron view register $ voltron view stack $ voltron view disasm $ voltron view backtrace 4. Set a breakpoint and run your inferior. (*db) b main (*db) run 5. When the debugger hits the breakpoint, the views will be updated to reflect the current state of registers, stack, memory, etc. Views are updated after each command is executed in the debugger CLI, using the debugger's "stop hook" mechanism. So each time you step, or continue and hit a breakpoint, the views will update. Documentation ------------- See the [wiki](https://github.com/snare/voltron/wiki) on github. Bugs and Errata --------------- See the [issue tracker](https://github.com/snare/voltron/issues) on github for more information or to submit issues. ### GDB 1. GDB on some distros is built with Python 3, but the system's Python is version 2. If Voltron is installed into Python 2's `site-packages` it will not work with GDB. See [this page on the wiki](https://github.com/snare/voltron/wiki/Voltron-on-Ubuntu-14.04-with-GDB) for installation instructions. 2. There is no clean way to hook GDB's exit, only the inferior's exit, so the Voltron server is started and stopped along with the inferior. This results in views showing "Connection refused" before the inferior has been started. 3. Due to a limitation in the GDB API, the views are only updated each time the debugger is stopped (e.g. by hitting a breakpoint), so view contents are not populated immediately when the view is connected, only when the first breakpoint is hit. 4. If the stack view is causing GDB to hang then it must be launched **after** the debugger has been launched, the inferior started, and the debugger stopped (e.g. a breakpoint hit). This has been fixed, but this note will remain until another release is issued. ### LLDB On older versions of LLDB, the `voltron init` command must be run manually after loading the debug target, as a target must be loaded before Voltron's hooks can be installed. Voltron will attempt to automatically register its event handler, and it will inform the user if `voltron init` is required. ### WinDbg More information about WinDbg/CDB support [here](https://github.com/snare/voltron/wiki/WinDbg). ### Misc 1. The authors primarily use Voltron with the most recent version of LLDB on OS X. We will try to test everything on as many platforms and architectures as possible before releases, but LLDB/OS X/x64 is going to be by far the most frequently-used combination. Hopefully Voltron doesn't set your pets on fire, but YMMV. 2. Intel is the only disassembly flavour currently supported for syntax highlighting. License ------- See the [LICENSE](https://github.com/snare/voltron/blob/master/LICENSE) file. If you use this and don't hate it, buy me a beer at a conference some time. This license also extends to other contributors - [richo](http://github.com/richo) definitely deserves a few beers for his contributions. Credits ------- Thanks to Azimuth Security for letting me spend time working on this. Props to [richo](http://github.com/richo) for all his contributions to Voltron. [fG!](http://github.com/gdbinit)'s gdbinit was the original inspiration for this project. Thanks to [Willi](http://github.com/williballenthin) for implementing the VDB support. Voltron now uses [Capstone](http://www.capstone-engine.org) for disassembly as well as the debugger hosts' internal disassembly mechanism. [Capstone](http://www.capstone-engine.org) is a powerful, open source, multi-architecture disassembler upon which the next generation of reverse engineering and debugging tools are being built. Check it out. voltron-0.1.4/examples/ 0000775 0000000 0000000 00000000000 12707172125 0015041 5 ustar 00root root 0000000 0000000 voltron-0.1.4/examples/angularview/ 0000775 0000000 0000000 00000000000 12707172125 0017365 5 ustar 00root root 0000000 0000000 voltron-0.1.4/examples/angularview/angularview.py 0000664 0000000 0000000 00000001721 12707172125 0022264 0 ustar 00root root 0000000 0000000 import logging import pygments from voltron.plugin import * from voltron.lexers import * from voltron.api import * from flask import * log = logging.getLogger('api') class AngularViewPlugin(WebPlugin): name = 'angularview' class FormatDisassemblyRequest(APIRequest): _fields = {'disassembly': True} def dispatch(self): try: res = FormatDisassemblyResponse( disassembly=pygments.highlight(self.disassembly.strip(), LLDBIntelLexer(), pygments.formatters.HtmlFormatter())) except Exception as e: msg = "Exception formatting disassembly: {}".format(repr(e)) log.exception(msg) res = APIGenericErrorResponse(msg) return res class FormatDisassemblyResponse(APIResponse): _fields = {'disassembly': True} class FormatDisassemblyPlugin(APIPlugin): request = "format_disasm" request_class = FormatDisassemblyRequest response_class = FormatDisassemblyResponse voltron-0.1.4/examples/angularview/static/ 0000775 0000000 0000000 00000000000 12707172125 0020654 5 ustar 00root root 0000000 0000000 voltron-0.1.4/examples/angularview/static/css/ 0000775 0000000 0000000 00000000000 12707172125 0021444 5 ustar 00root root 0000000 0000000 voltron-0.1.4/examples/angularview/static/css/solarized.css 0000664 0000000 0000000 00000010555 12707172125 0024160 0 ustar 00root root 0000000 0000000 /* Solarized Dark For use with Jekyll and Pygments http://ethanschoonover.com/solarized SOLARIZED HEX ROLE --------- -------- ------------------------------------------ base03 #002b36 background base01 #586e75 comments / secondary content base1 #93a1a1 body text / default code / primary content orange #cb4b16 constants red #dc322f regex, special keywords blue #268bd2 reserved keywords cyan #2aa198 strings, numbers green #859900 operators, other keywords */ /*.highlight { background-color: #002b36; color: #93a1a1 }*/ .highlight { background-color: #073642; color: #93a1a1 } .highlight .c { color: #586e75 } /* Comment */ .highlight .err { color: #93a1a1 } /* Error */ .highlight .g { color: #93a1a1 } /* Generic */ .highlight .k { color: #859900 } /* Keyword */ .highlight .l { color: #93a1a1 } /* Literal */ .highlight .n { color: #93a1a1 } /* Name */ .highlight .o { color: #859900 } /* Operator */ .highlight .x { color: #cb4b16 } /* Other */ .highlight .p { color: #93a1a1 } /* Punctuation */ .highlight .cm { color: #586e75 } /* Comment.Multiline */ .highlight .cp { color: #859900 } /* Comment.Preproc */ .highlight .c1 { color: #586e75 } /* Comment.Single */ .highlight .cs { color: #859900 } /* Comment.Special */ .highlight .gd { color: #2aa198 } /* Generic.Deleted */ .highlight .ge { color: #93a1a1; font-style: italic } /* Generic.Emph */ .highlight .gr { color: #dc322f } /* Generic.Error */ .highlight .gh { color: #cb4b16 } /* Generic.Heading */ .highlight .gi { color: #859900 } /* Generic.Inserted */ .highlight .go { color: #93a1a1 } /* Generic.Output */ .highlight .gp { color: #93a1a1 } /* Generic.Prompt */ .highlight .gs { color: #93a1a1; font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #cb4b16 } /* Generic.Subheading */ .highlight .gt { color: #93a1a1 } /* Generic.Traceback */ .highlight .kc { color: #cb4b16 } /* Keyword.Constant */ .highlight .kd { color: #268bd2 } /* Keyword.Declaration */ .highlight .kn { color: #859900 } /* Keyword.Namespace */ .highlight .kp { color: #859900 } /* Keyword.Pseudo */ .highlight .kr { color: #268bd2 } /* Keyword.Reserved */ .highlight .kt { color: #dc322f } /* Keyword.Type */ .highlight .ld { color: #93a1a1 } /* Literal.Date */ .highlight .m { color: #2aa198 } /* Literal.Number */ .highlight .s { color: #2aa198 } /* Literal.String */ .highlight .na { color: #93a1a1 } /* Name.Attribute */ .highlight .nb { color: #B58900 } /* Name.Builtin */ .highlight .nc { color: #268bd2 } /* Name.Class */ .highlight .no { color: #cb4b16 } /* Name.Constant */ .highlight .nd { color: #268bd2 } /* Name.Decorator */ .highlight .ni { color: #cb4b16 } /* Name.Entity */ .highlight .ne { color: #cb4b16 } /* Name.Exception */ .highlight .nf { color: #268bd2 } /* Name.Function */ .highlight .nl { color: #93a1a1 } /* Name.Label */ .highlight .nn { color: #93a1a1 } /* Name.Namespace */ .highlight .nx { color: #93a1a1 } /* Name.Other */ .highlight .py { color: #93a1a1 } /* Name.Property */ .highlight .nt { color: #268bd2 } /* Name.Tag */ .highlight .nv { color: #268bd2 } /* Name.Variable */ .highlight .ow { color: #859900 } /* Operator.Word */ .highlight .w { color: #93a1a1 } /* Text.Whitespace */ .highlight .mf { color: #2aa198 } /* Literal.Number.Float */ .highlight .mh { color: #2aa198 } /* Literal.Number.Hex */ .highlight .mi { color: #2aa198 } /* Literal.Number.Integer */ .highlight .mo { color: #2aa198 } /* Literal.Number.Oct */ .highlight .sb { color: #586e75 } /* Literal.String.Backtick */ .highlight .sc { color: #2aa198 } /* Literal.String.Char */ .highlight .sd { color: #93a1a1 } /* Literal.String.Doc */ .highlight .s2 { color: #2aa198 } /* Literal.String.Double */ .highlight .se { color: #cb4b16 } /* Literal.String.Escape */ .highlight .sh { color: #93a1a1 } /* Literal.String.Heredoc */ .highlight .si { color: #2aa198 } /* Literal.String.Interpol */ .highlight .sx { color: #2aa198 } /* Literal.String.Other */ .highlight .sr { color: #dc322f } /* Literal.String.Regex */ .highlight .s1 { color: #2aa198 } /* Literal.String.Single */ .highlight .ss { color: #2aa198 } /* Literal.String.Symbol */ .highlight .bp { color: #268bd2 } /* Name.Builtin.Pseudo */ .highlight .vc { color: #268bd2 } /* Name.Variable.Class */ .highlight .vg { color: #268bd2 } /* Name.Variable.Global */ .highlight .vi { color: #268bd2 } /* Name.Variable.Instance */ .highlight .il { color: #2aa198 } /* Literal.Number.Integer.Long */ voltron-0.1.4/examples/angularview/static/css/style.css 0000664 0000000 0000000 00000000571 12707172125 0023321 0 ustar 00root root 0000000 0000000 .reg_label { color: #b58900; font-weight: bold; } .reg_highlight { color: #dc322f; } .reg_normal { } #tile { display:inline-block; vertical-align: top; background-color: #073642; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.3em; padding-bottom: 0.3em; } pre { margin: 0; } #disasm { background-color: #073642; } voltron-0.1.4/examples/angularview/static/index.html 0000664 0000000 0000000 00000001757 12707172125 0022663 0 ustar 00root root 0000000 0000000