BVB Source Codes

voltron Show stack.py Source code

Return Download voltron: download stack.py Source code - Download voltron Source code - Type:.py
  1. import voltron
  2. import logging
  3. import base64
  4.  
  5. from voltron.api import *
  6.  
  7. log = logging.getLogger('api')
  8.  
  9. class APIStackRequest(APIRequest):
  10.     """
  11.    API read stack request.
  12.  
  13.    {
  14.        "type":         "request",
  15.        "request":      "stack"
  16.        "data": {
  17.            "target_id":    0,
  18.            "thread_id":    123456,
  19.            "length":       0x40
  20.        }
  21.    }
  22.  
  23.    `target_id` and `thread_id` are optional. If not present, the currently
  24.    selected target and thread will be used.
  25.  
  26.    `length` is the number of bytes to read.
  27.    """
  28.     _fields = {'target_id': False, 'thread_id': False, 'length': True}
  29.  
  30.     target_id = 0
  31.     thread_id = None
  32.     length = None
  33.  
  34.     @server_side
  35.     def dispatch(self):
  36.         try:
  37.             sp_name, sp = voltron.debugger.stack_pointer(target_id=self.target_id)
  38.             memory = voltron.debugger.memory(address=sp, length=self.length, target_id=self.target_id)
  39.             res = APIStackResponse()
  40.             res.memory = memory
  41.             res.stack_pointer = sp
  42.         except NoSuchTargetException:
  43.             res = APINoSuchTargetErrorResponse()
  44.         except TargetBusyException:
  45.             res = APITargetBusyErrorResponse()
  46.         except Exception as e:
  47.             msg = "Unhandled exception {} reading stack: {}".format(type(e), e)
  48.             log.exception(msg)
  49.             res = APIErrorResponse(code=0, message=msg)
  50.  
  51.         return res
  52.  
  53.  
  54. class APIStackResponse(APISuccessResponse):
  55.     """
  56.    API read stack response.
  57.  
  58.    {
  59.        "type":         "response",
  60.        "status":       "success",
  61.        "data": {
  62.            "memory":           "\xff...",
  63.            "stack_pointer":    0x12341234
  64.        }
  65.    }
  66.    """
  67.     _fields = {'memory': True, 'stack_pointer': True}
  68.  
  69.     _encode_fields = ['memory']
  70.  
  71.     memory = None
  72.     stack_pointer = None
  73.  
  74.  
  75. class APIStackPlugin(APIPlugin):
  76.     request = 'stack'
  77.     request_class = APIStackRequest
  78.     response_class = APIStackResponse
  79.  
downloadstack.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