BVB Source Codes

voltron Show view.py Source code

Return Download voltron: download view.py Source code - Download voltron Source code - Type:.py
  1. """
  2. Example Voltron view.
  3.  
  4. Copy this to your ~/.voltron/plugins directory. When the `voltron view` command
  5. is executed, 'example' should be visible in the list of valid view names.
  6.  
  7. Start your debugger as follows:
  8.  
  9. $ lldb /tmp/inferior
  10. Voltron loaded.
  11. Run `voltron init` after you load a target.
  12. (lldb) target create "/tmp/inferior"
  13. Current executable set to '/tmp/inferior' (x86_64).
  14. (lldb) voltron init
  15. Registered stop-hook
  16. (lldb) b main
  17. Breakpoint 1: where = inferior`main, address = 0x0000000100000cf0
  18. (lldb) run
  19. Process 13185 launched: '/Volumes/Data/Users/snare/code/voltron/repo/tests/inferior' (x86_64)
  20. Process 13185 stopped
  21. * thread #1: tid = 0x1ee63, 0x0000000100000cf0 inferior`main, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  22.    frame #0: 0x0000000100000cf0 inferior`main
  23. inferior`main:
  24. -> 0x100000cf0:  push   rbp
  25.   0x100000cf1:  mov    rbp, rsp
  26.   0x100000cf4:  sub    rsp, 0x50
  27.   0x100000cf8:  mov    dword ptr [rbp - 0x4], 0x0
  28.  
  29. Run this view in another terminal (as follows). Each time you `stepi` in the
  30. debugger, the view will update and display the current register values.
  31.  
  32. $ voltron view example
  33. """
  34.  
  35. from voltron.view import TerminalView
  36. from voltron.plugin import ViewPlugin
  37.  
  38.  
  39. class ExampleView(TerminalView):
  40.     def render(self, *args, **kwargs):
  41.         # Perform the request
  42.         res = self.client.perform_request('registers')
  43.         if res.is_success:
  44.             # Process the registers and set the body to the formatted list
  45.             reg_list =  ['rax','rbx','rcx','rdx','rbp','rsp','rdi','rsi','rip',
  46.                          'r8','r9','r10','r11','r12','r13','r14','r15']
  47.             lines = map(lambda x: '{:3}: {:016X}'.format(x, res.registers[x]), reg_list)
  48.             self.body = '\n'.join(lines)
  49.         else:
  50.             self.body = "Failed to get registers: {}".format(res)
  51.  
  52.         # Set the title and info
  53.         self.title = '[example]'
  54.         self.info = 'some infoz'
  55.  
  56.         # Let the parent do the rendering
  57.         super(ExampleView, self).render()
  58.  
  59.  
  60. class ExampleViewPlugin(ViewPlugin):
  61.     name = 'example'
  62.     view_class = ExampleView
  63.  
downloadview.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
discover-flask - Full Stack Web Development with Flask. ... 2017-01-12
spring-mvc-showcase - Demonstrates the features of the Spring MVC web fr... 2017-01-12
tushare - TuShare is a utility for crawling historical data ... 2017-01-12
raml-spec - RAML Specification http://raml.... 2017-01-12
android-stackblur - Android StackBlur is a library that can perform a ... 2017-01-12
sound-redux - A Soundcloud client built with React / Redux ... 2017-01-12
httpstat - curl statistics made simple 2017-01-12
vim - Vim configuration file and plug-ins 2017-01-12
appframework - The definitive HTML5 mobile javascript framework ... 2017-01-12
BaiduExporter - Assistant for Baidu to export download links to ar... 2017-01-11

 Back to top