Exemple #1
0
 static PyObject* ElfHeader_getShoff(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyElfHeader_AsElfHeader(self)->getShoff());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* ElfRelocationTable_getAddend(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyElfRelocationTable_AsElfRelocationTable(self)->getAddend());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemple #3
0
 static PyObject* PathConstraint_getTakenAddress(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyPathConstraint_AsPathConstraint(self)->getTakenAddress());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemple #4
0
 static PyObject* MemoryAccess_getAddress(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyMemoryAccess_AsMemoryAccess(self)->getAddress());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* ElfProgramHeader_getAlign(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyElfProgramHeader_AsElfProgramHeader(self)->getAlign());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemple #6
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());
   }
 }
 static PyObject* SymbolicVariable_getKindValue(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PySymbolicVariable_AsSymbolicVariable(self)->getKindValue());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* ElfSymbolTable_getSize(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint64(PyElfSymbolTable_AsElfSymbolTable(self)->getSize());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Exemple #9
0
      static PyObject* PathConstraint_getBranchConstraints(PyObject* self, PyObject* noarg) {
        try {
          PyObject* ret = nullptr;
          const auto& branches = PyPathConstraint_AsPathConstraint(self)->getBranchConstraints();

          ret = xPyList_New(branches.size());
          for (triton::usize index = 0; index != branches.size(); index++) {
            PyObject* dict = xPyDict_New();
            xPyDict_SetItem(dict, PyString_FromString("isTaken"),    PyBool_FromLong(std::get<0>(branches[index])));
            xPyDict_SetItem(dict, PyString_FromString("srcAddr"),    PyLong_FromUint64(std::get<1>(branches[index])));
            xPyDict_SetItem(dict, PyString_FromString("dstAddr"),    PyLong_FromUint64(std::get<2>(branches[index])));
            xPyDict_SetItem(dict, PyString_FromString("constraint"), PyAstNode(std::get<3>(branches[index])));
            PyList_SetItem(ret, index, dict);
          }

          return ret;
        }
        catch (const triton::exceptions::Exception& e) {
          return PyErr_Format(PyExc_TypeError, "%s", e.what());
        }
      }