BVB Source Codes

voltron Show disassemble.py Source code

Return Download voltron: download disassemble.py Source code - Download voltron Source code - Type:.py
  1. import voltron
  2. import logging
  3.  
  4. from voltron.api import *
  5. from voltron.plugin import *
  6.  
  7. log = logging.getLogger('api')
  8.  
  9. class APIDisassembleRequest(APIRequest):
  10.     """
  11.    API disassemble request.
  12.  
  13.    {
  14.        "type":         "request",
  15.        "request":      "disassemble"
  16.        "data": {
  17.            "target_id":    0,
  18.            "address":      0x12341234,
  19.            "count":        16,
  20.            "use_capstone": False
  21.        }
  22.    }
  23.  
  24.    `target_id` is optional.
  25.    `address` is the address at which to start disassembling. Defaults to
  26.    instruction pointer if not specified.
  27.    `count` is the number of instructions to disassemble.
  28.    `use_capstone` a flag to indicate whether or not Capstone should be used
  29.    instead of the debugger's disassembler.
  30.    """
  31.     _fields = {'target_id': False, 'address': False, 'count': True, 'use_capstone': False}
  32.  
  33.     target_id = 0
  34.     address = None
  35.     count = 16
  36.  
  37.     @server_side
  38.     def dispatch(self):
  39.         try:
  40.             if self.address == None:
  41.                 pc_name, self.address = voltron.debugger.program_counter(target_id=self.target_id)
  42.             if self.use_capstone:
  43.                 disasm = voltron.debugger.disassemble_capstone(target_id=self.target_id, address=self.address,
  44.                                                                count=self.count)
  45.             else:
  46.                 disasm = voltron.debugger.disassemble(target_id=self.target_id, address=self.address, count=self.count)
  47.             res = APIDisassembleResponse()
  48.             res.disassembly = disasm
  49.             try:
  50.                 res.flavor = voltron.debugger.disassembly_flavor()
  51.             except:
  52.                 res.flavor = 'NA'
  53.             res.host = voltron.debugger._plugin.host
  54.         except NoSuchTargetException:
  55.             res = APINoSuchTargetErrorResponse()
  56.         except TargetBusyException:
  57.             res = APITargetBusyErrorResponse()
  58.         except Exception as e:
  59.             msg = "Unhandled exception {} disassembling: {}".format(type(e), e)
  60.             log.exception(msg)
  61.             res = APIErrorResponse(code=0, message=msg)
  62.  
  63.         return res
  64.  
  65.  
  66. class APIDisassembleResponse(APISuccessResponse):
  67.     """
  68.    API disassemble response.
  69.  
  70.    {
  71.        "type":         "response",
  72.        "status":       "success",
  73.        "data": {
  74.            "disassembly":  "mov blah blah"
  75.        }
  76.    }
  77.    """
  78.     _fields = {'disassembly': True, 'formatted': False, 'flavor': False, 'host': False}
  79.  
  80.     disassembly = None
  81.     formatted = None
  82.     flavor = None
  83.     host = None
  84.  
  85.  
  86. class APIDisassemblePlugin(APIPlugin):
  87.     request = 'disassemble'
  88.     request_class = APIDisassembleRequest
  89.     response_class = APIDisassembleResponse
  90.  
downloaddisassemble.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
mongo-express - Web-based MongoDB admin interface, written with No... 2017-05-17
XCL-Charts - Android charting libraries (XCL-Charts is a free c... 2017-05-17
scrollMonitor - A simple and fast API to monitor elements as you s... 2017-05-16
XCDYouTubeKit - YouTube video player for iOS, tvOS and macOS 2017-05-16
rails-erd - Generate Entity-Relationship Diagrams for Rails ap... 2017-05-16
np - A better `npm publish` 2017-05-16
android - Smartisan open source code for full build.(repo ma... 2017-05-16
word_cloud - A little word cloud generator in Pytho 2017-05-16
mobileplayer-ios - 2017-05-16
Destroy-Windows-10-Spying - Destroy Windows Spying tool ... 2017-05-15

 Back to top