_v3_old
Nguyen Anh Quynh 11 years ago
commit 3f2fb5fa12
  1. 8
      bindings/python/README
  2. 14
      bindings/python/capstone/capstone.py

@ -3,10 +3,16 @@
$ sudo make install
For better performance, install Cython-based binding with:
(NOTE: you must have Cython installed in your machine first)
$ sudo make install_cython
NOTE: to install Cython, depending on if you already have pip or
easy_install installed, simply do either:
$ sudo pip install cython
or:
$ sudo pip install cython
This directory contains some test code to show how to use Capstone API.

@ -291,21 +291,24 @@ class CsInsn(object):
if self._cs._detail:
detail = self._raw.detail.contents
return detail.regs_read[:detail.regs_read_count]
return None
raise CsError(CS_ERR_DETAIL)
@property
def regs_write(self):
if self._cs._detail:
detail = self._raw.detail.contents
return detail.regs_write[:detail.regs_write_count]
return None
raise CsError(CS_ERR_DETAIL)
@property
def groups(self):
if self._cs._detail:
detail = self._raw.detail.contents
return detail.groups[:detail.groups_count]
return None
raise CsError(CS_ERR_DETAIL)
def __gen_detail(self):
arch = self._cs.arch
@ -327,6 +330,9 @@ class CsInsn(object):
ppc.get_arch_info(detail.arch.ppc)
def __getattr__(self, name):
if not self._cs._detail:
raise CsError(CS_ERR_DETAIL)
attr = object.__getattribute__
if not attr(self, '_cs')._detail:
return None
@ -394,7 +400,7 @@ class Cs(object):
else:
self._syntax = None
self._detail = True # by default, get instruction details
self._detail = False # by default, do not produce instruction details
def __del__(self):
if self.csh:

Loading…
Cancel
Save