159 std::cout << std::flush;
161 Py_TYPE(self)->tp_free((PyObject*)self);
165 static PyObject* MemoryAccess_getAddress(PyObject* self, PyObject* noarg) {
170 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
175 static PyObject* MemoryAccess_getLeaAst(PyObject* self, PyObject* noarg) {
184 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
189 static PyObject* MemoryAccess_getBaseRegister(PyObject* self, PyObject* noarg) {
195 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
200 static PyObject* MemoryAccess_getBitSize(PyObject* self, PyObject* noarg) {
205 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
210 static PyObject* MemoryAccess_getBitvector(PyObject* self, PyObject* noarg) {
215 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
220 static PyObject* MemoryAccess_getDisplacement(PyObject* self, PyObject* noarg) {
226 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
231 static PyObject* MemoryAccess_getIndexRegister(PyObject* self, PyObject* noarg) {
237 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
242 static PyObject* MemoryAccess_getScale(PyObject* self, PyObject* noarg) {
248 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
253 static PyObject* MemoryAccess_getSegmentRegister(PyObject* self, PyObject* noarg) {
259 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
264 static PyObject* MemoryAccess_getSize(PyObject* self, PyObject* noarg) {
269 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
274 static PyObject* MemoryAccess_getType(PyObject* self, PyObject* noarg) {
279 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
284 static PyObject* MemoryAccess_isOverlapWith(PyObject* self, PyObject* mem2) {
289 return PyErr_Format(PyExc_TypeError,
"MemoryAccess::isOverlapWith(): Expected a MemoryAccess as argument.");
297 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
302 static PyObject* MemoryAccess_setBaseRegister(PyObject* self, PyObject* reg) {
307 return PyErr_Format(PyExc_TypeError,
"MemoryAccess::setBaseRegister(): Expected a Register as argument.");
315 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
320 static PyObject* MemoryAccess_setDisplacement(PyObject* self, PyObject* imm) {
325 return PyErr_Format(PyExc_TypeError,
"MemoryAccess::setDisplacement(): Expected an Immediate as argument.");
333 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
338 static PyObject* MemoryAccess_setIndexRegister(PyObject* self, PyObject* reg) {
343 return PyErr_Format(PyExc_TypeError,
"MemoryAccess::setIndexRegister(): Expected a Register as argument.");
351 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
356 static PyObject* MemoryAccess_setScale(PyObject* self, PyObject* imm) {
361 return PyErr_Format(PyExc_TypeError,
"MemoryAccess::setScale(): Expected an Immediate as argument.");
369 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
374 static PyObject* MemoryAccess_setSegmentRegister(PyObject* self, PyObject* reg) {
379 return PyErr_Format(PyExc_TypeError,
"MemoryAccess::setSegmentRegister(): Expected a Register as argument.");
387 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
392 #if !defined(IS_PY3_8) || !IS_PY3_8
393 static int MemoryAccess_print(PyObject* self,
void* io,
int s) {
400 static PyObject* MemoryAccess_str(PyObject* self) {
405 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
412 {
"getAddress", MemoryAccess_getAddress, METH_NOARGS,
""},
413 {
"getBaseRegister", MemoryAccess_getBaseRegister, METH_NOARGS,
""},
414 {
"getBitSize", MemoryAccess_getBitSize, METH_NOARGS,
""},
415 {
"getBitvector", MemoryAccess_getBitvector, METH_NOARGS,
""},
416 {
"getDisplacement", MemoryAccess_getDisplacement, METH_NOARGS,
""},
417 {
"getIndexRegister", MemoryAccess_getIndexRegister, METH_NOARGS,
""},
418 {
"getLeaAst", MemoryAccess_getLeaAst, METH_NOARGS,
""},
419 {
"getScale", MemoryAccess_getScale, METH_NOARGS,
""},
420 {
"getSegmentRegister", MemoryAccess_getSegmentRegister, METH_NOARGS,
""},
421 {
"getSize", MemoryAccess_getSize, METH_NOARGS,
""},
422 {
"getType", MemoryAccess_getType, METH_NOARGS,
""},
423 {
"isOverlapWith", MemoryAccess_isOverlapWith, METH_O,
""},
424 {
"setBaseRegister", MemoryAccess_setBaseRegister, METH_O,
""},
425 {
"setDisplacement", MemoryAccess_setDisplacement, METH_O,
""},
426 {
"setIndexRegister", MemoryAccess_setIndexRegister, METH_O,
""},
427 {
"setScale", MemoryAccess_setScale, METH_O,
""},
428 {
"setSegmentRegister", MemoryAccess_setSegmentRegister, METH_O,
""},
429 {
nullptr,
nullptr, 0,
nullptr}
434 PyVarObject_HEAD_INIT(&PyType_Type, 0)
442 (printfunc)MemoryAccess_print,
447 (reprfunc)MemoryAccess_str,
453 (reprfunc)MemoryAccess_str,
458 "MemoryAccess objects",
507 return (PyObject*)object;
This class is used to represent a memory access.
TRITON_EXPORT bool isOverlapWith(const MemoryAccess &other) const
Returns true if other and self overlap.
TRITON_EXPORT void setDisplacement(const triton::arch::Immediate &displacement)
LEA - Sets the displacement operand.
TRITON_EXPORT void setScale(const triton::arch::Immediate &scale)
LEA - Sets the scale operand.
TRITON_EXPORT void setIndexRegister(const triton::arch::Register &index)
LEA - Sets the index register operand.
TRITON_EXPORT void setSegmentRegister(const triton::arch::Register &segment)
LEA - Sets the segment register operand.
TRITON_EXPORT void setBaseRegister(const triton::arch::Register &base)
LEA - Sets the base register operand.
This class is used when an instruction has a register operand.
The root class of all exceptions.
TRITON_EXPORT const char * what() const
Returns the exception message.
PyObject * PyImmediate(const triton::arch::Immediate &imm)
Creates the Immediate python class.
PyTypeObject MemoryAccess_Type
pyMemory type.
PyObject * PyLong_FromUint64(triton::uint64 value)
Returns a pyObject from a triton::uint64.
PyObject * PyRegister(const triton::arch::Register ®)
Creates the Register python class.
PyObject * PyMemoryAccess(const triton::arch::MemoryAccess &mem)
Creates the Memory python class.
PyObject * PyLong_FromUint32(triton::uint32 value)
Returns a pyObject from a triton::uint32.
PyObject * PyAstNode(const triton::ast::SharedAbstractNode &node)
Creates the AstNode python class.
std::string toString(const T &obj)
Converts an object to a string.
PyMethodDef MemoryAccess_callbacks[]
MemoryAccess methods.
void MemoryAccess_dealloc(PyObject *self)
MemoryAccess destructor.
#define PyImmediate_Check(v)
#define PyRegister_AsRegister(v)
#define PyMemoryAccess_Check(v)
#define PyImmediate_AsImmediate(v)
#define PyMemoryAccess_AsMemoryAccess(v)
#define PyRegister_Check(v)