<s> import voltron <EOL> import logging <EOL> from voltron . api import * <EOL> from voltron . plugin import * <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> class APIDisassembleRequest ( APIRequest ) : <EOL> """<STR_LIT>""" <EOL> _fields = { '<STR_LIT>' : False , '<STR_LIT:address>' : False , '<STR_LIT:count>' : True , '<STR_LIT>' : False } <EOL> target_id = <NUM_LIT:0> <EOL> address = None <EOL> count = <NUM_LIT:16> <EOL> @ server_side <EOL> def dispatch ( self ) : <EOL> try : <EOL> if self . address == None : <EOL> pc_name , self . address = voltron . debugger . program_counter ( target_id = self . target_id ) <EOL> if self . use_capstone : <EOL> disasm = voltron . debugger . disassemble_capstone ( target_id = self . target_id , address = self . address , <EOL> count = self . count ) <EOL> else : <EOL> disasm = voltron . debugger . disassemble ( target_id = self . target_id , address = self . address , count = self . count ) <EOL> res = APIDisassembleResponse ( ) <EOL> res . disassembly = disasm <EOL> try : <EOL> res . flavor = voltron . debugger . disassembly_flavor ( ) <EOL> except : <EOL> res . flavor = '<STR_LIT>' <EOL> res . host = voltron . debugger . _plugin . host <EOL> except NoSuchTargetException : <EOL> res = APINoSuchTargetErrorResponse ( ) <EOL> except TargetBusyException : <EOL> res = APITargetBusyErrorResponse ( ) <EOL> except Exception as e : <EOL> msg = "<STR_LIT>" . format ( type ( e ) , e ) <EOL> log . exception ( msg ) <EOL> res = APIErrorResponse ( code = <NUM_LIT:0> , message = msg ) <EOL> return res <EOL> class APIDisassembleResponse ( APISuccessResponse ) : <EOL> """<STR_LIT>""" <EOL> _fields = { '<STR_LIT>' : True , '<STR_LIT>' : False , '<STR_LIT>' : False , '<STR_LIT:host>' : False } <EOL> disassembly = None <EOL> formatted = None <EOL> flavor = None <EOL> host = None <EOL> class APIDisassemblePlugin ( APIPlugin ) : <EOL> request = '<STR_LIT>' <EOL> request_class = APIDisassembleRequest <EOL> response_class = APIDisassembleResponse </s>
