BVB Source Codes

voltron Show command.py Source code

Return Download voltron: download command.py Source code - Download voltron Source code - Type:.py
  1. """
  2. Example command plugin
  3.  
  4. Copy this to your ~/.voltron/plugins directory. It will be loaded when
  5. Voltron is initialised, and register a debugger command that works as follows:
  6.  
  7. $ lldb /tmp/inferior
  8. Voltron loaded.
  9. Run `voltron init` after you load a target.
  10. (lldb) target create "/tmp/inferior"
  11. Current executable set to '/tmp/inferior' (x86_64).
  12. (lldb) b main
  13. Breakpoint 1: where = inferior`main, address = 0x0000000100000cf0
  14. (lldb) run
  15. Process 12561 launched: '/tmp/inferior' (x86_64)
  16. Process 12561 stopped
  17. * thread #1: tid = 0x1d33f, 0x0000000100000cf0 inferior`main, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  18.    frame #0: 0x0000000100000cf0 inferior`main
  19. inferior`main:
  20. -> 0x100000cf0:  push   rbp
  21.   0x100000cf1:  mov    rbp, rsp
  22.   0x100000cf4:  sub    rsp, 0x50
  23.   0x100000cf8:  mov    dword ptr [rbp - 0x4], 0x0
  24. (lldb) example
  25. rax 0000000100000CF0
  26. rbx 0000000000000000
  27. rcx 00007FFF5FBFFA70
  28. rdx 00007FFF5FBFF978
  29. rbp 00007FFF5FBFF958
  30. rsp 00007FFF5FBFF948
  31. rdi 0000000000000001
  32. rsi 00007FFF5FBFF968
  33. rip 0000000100000CF0
  34. r8  0000000000000000
  35. r9  00007FFF5FBFEA08
  36. r10 0000000000000032
  37. r11 0000000000000246
  38. r12 0000000000000000
  39. r13 0000000000000000
  40. r14 0000000000000000
  41. r15 0000000000000000
  42.  
  43. Provided you stick to the adaptor API that is implemented in every *DBAdaptor
  44. class, custom command plugins should work across all debugger hosts.
  45.  
  46. This is a quick example that will only work on an x86_64 target.
  47. """
  48.  
  49. import blessed
  50. import voltron
  51. from voltron.plugin import CommandPlugin
  52. from voltron.command import VoltronCommand
  53.  
  54.  
  55. class ExampleCommand(VoltronCommand):
  56.     def invoke(self, *args):
  57.         regs = voltron.debugger.registers()
  58.         reg_list =  ['rax','rbx','rcx','rdx','rbp','rsp','rdi','rsi','rip',
  59.                      'r8','r9','r10','r11','r12','r13','r14','r15']
  60.         for name in reg_list:
  61.             print("{t.bold}{:3} {t.normal}{:0=16X}".format(name, regs[name], t=blessed.Terminal()))
  62.  
  63.  
  64. class ExampleCommandPlugin(CommandPlugin):
  65.     name = 'example'
  66.     command_class = ExampleCommand
downloadcommand.py Source code - Download voltron Source code
Related Source Codes/Software:
IGListKit - A data-driven UICollectionView framework for build... 2017-01-11
androidmvp - MVP Android Example 2017-01-11
svelte - The magical disappearing UI framework ... 2017-01-11
kcptun - A Simple UDP Tunnel Based On KCP 2017-01-11
poisontap - Exploits locked/password protected computers over ... 2017-01-10
ecma262 - Status, process, and documents for ECMA262 ... 2017-01-11
react-native-elements - React Native Elements UI Toolkit 2017-01-11
tensorflow-zh - Google new open source ai system TensorFlow Chines... 2017-01-11
forum - Blue light (the Lantern) the official BBS 2017-01-11
socketcluster - Highly scalable realtime framework ... 2017-01-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top