Exemplo n.º 1
0
 static PyObject* Immediate_getValue(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyImmediate_AsImmediate(self)->getValue());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemplo n.º 2
0
 static PyObject* Immediate_getBitvector(PyObject* self, PyObject* noarg) {
   try {
     return PyBitsVector(*PyImmediate_AsImmediate(self));
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemplo n.º 3
0
 static PyObject* Immediate_str(PyObject* self) {
   try {
     std::stringstream str;
     str << PyImmediate_AsImmediate(self);
     return PyString_FromFormat("%s", str.str().c_str());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemplo n.º 4
0
 static PyObject* Immediate_setValue(PyObject* self, PyObject* value) {
   try {
     if (!PyLong_Check(value) && !PyInt_Check(value))
       return PyErr_Format(PyExc_TypeError, "Immediate::setValue(): expected an integer as argument");
     PyImmediate_AsImmediate(self)->setValue(PyLong_AsUint64(value));
     Py_INCREF(Py_None);
     return Py_None;
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemplo n.º 5
0
      static PyObject* MemoryAccess_setScale(PyObject* self, PyObject* imm) {
        try {
          triton::arch::MemoryAccess* mem;

          if (!PyImmediate_Check(imm))
            return PyErr_Format(PyExc_TypeError, "MemoryAccess::setScale(): Expected an Immediate as argument.");

          mem = PyMemoryAccess_AsMemoryAccess(self);
          mem->setScale(*PyImmediate_AsImmediate(imm));
          Py_INCREF(Py_None);
          return Py_None;
        }
        catch (const triton::exceptions::Exception& e) {
          return PyErr_Format(PyExc_TypeError, "%s", e.what());
        }
      }
Exemplo n.º 6
0
 static int Immediate_print(PyObject* self) {
   std::cout << PyImmediate_AsImmediate(self);
   return 0;
 }
Exemplo n.º 7
0
 //! Immediate destructor.
 void Immediate_dealloc(PyObject* self) {
   std::cout << std::flush;
   delete PyImmediate_AsImmediate(self);
   Py_DECREF(self);
 }