Lines Matching refs:self

32 	def __init__(self, libxed):
35 self.xedd = xedd_t()
36 self.xedp = addressof(self.xedd)
37 libxed.xed_decoded_inst_zero(self.xedp)
38 self.state = xed_state_t()
39 self.statep = addressof(self.state)
41 self.buffer = create_string_buffer(256)
42 self.bufferp = addressof(self.buffer)
46 def __init__(self):
48 self.libxed = CDLL("libxed.so")
50 self.libxed = None
51 if not self.libxed:
52 self.libxed = CDLL("/usr/local/lib/libxed.so")
54 self.xed_tables_init = self.libxed.xed_tables_init
55 self.xed_tables_init.restype = None
56 self.xed_tables_init.argtypes = []
58 self.xed_decoded_inst_zero = self.libxed.xed_decoded_inst_zero
59 self.xed_decoded_inst_zero.restype = None
60 self.xed_decoded_inst_zero.argtypes = [ c_void_p ]
62 self.xed_operand_values_set_mode = self.libxed.xed_operand_values_set_mode
63 self.xed_operand_values_set_mode.restype = None
64 self.xed_operand_values_set_mode.argtypes = [ c_void_p, c_void_p ]
66 self.xed_decoded_inst_zero_keep_mode = self.libxed.xed_decoded_inst_zero_keep_mode
67 self.xed_decoded_inst_zero_keep_mode.restype = None
68 self.xed_decoded_inst_zero_keep_mode.argtypes = [ c_void_p ]
70 self.xed_decode = self.libxed.xed_decode
71 self.xed_decode.restype = c_int
72 self.xed_decode.argtypes = [ c_void_p, c_void_p, c_uint ]
74 self.xed_format_context = self.libxed.xed_format_context
75 self.xed_format_context.restype = c_uint
76 self.xed_format_context.argtypes = [ c_int, c_void_p, c_void_p, c_int, c_ulonglong, c_void_p, c_void_p ]
78 self.xed_tables_init()
80 def Instruction(self):
81 return XEDInstruction(self)
83 def SetMode(self, inst, mode):
90 self.xed_operand_values_set_mode(inst.xedp, inst.statep)
92 def DisassembleOne(self, inst, bytes_ptr, bytes_cnt, ip):
93 self.xed_decoded_inst_zero_keep_mode(inst.xedp)
94 err = self.xed_decode(inst.xedp, bytes_ptr, bytes_cnt)
98 ok = self.xed_format_context(2, inst.xedp, inst.bufferp, sizeof(inst.buffer), ip, 0, 0)