예제 #1
0
static PyObject *SymbolicExpression_getComment(PyObject *self, PyObject *noarg) {
  SymbolicExpression *expression = PySymbolicExpression_AsSymbolicExpression(self);
  if (expression->getComment().empty() == false)
    return PyString_FromFormat("%s", expression->getComment().c_str());
  Py_INCREF(Py_None);
  return Py_None;
}
 static PyObject* SymbolicExpression_getOriginRegister(PyObject* self, PyObject* noarg) {
   try {
     return PyRegisterOperand(PySymbolicExpression_AsSymbolicExpression(self)->getOriginRegister());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicExpression_getNewAst(PyObject* self, PyObject* noarg) {
   try {
     return PyAstNode(PySymbolicExpression_AsSymbolicExpression(self)->getNewAst());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicExpression_getKind(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint32(PySymbolicExpression_AsSymbolicExpression(self)->getKind());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicExpression_getComment(PyObject* self, PyObject* noarg) {
   try {
     return Py_BuildValue("s", PySymbolicExpression_AsSymbolicExpression(self)->getComment().c_str());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
예제 #6
0
 static PyObject* SymbolicExpression_getOriginMemory(PyObject* self, PyObject* noarg) {
   try {
     return PyMemoryAccess(PySymbolicExpression_AsSymbolicExpression(self)->getOriginMemory());
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicExpression_str(PyObject* self) {
   try {
     std::stringstream str;
     str << PySymbolicExpression_AsSymbolicExpression(self);
     return PyString_FromFormat("%s", str.str().c_str());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicExpression_isTainted(PyObject* self, PyObject* noarg) {
   try {
     if (PySymbolicExpression_AsSymbolicExpression(self)->isTainted == true)
       Py_RETURN_TRUE;
     Py_RETURN_FALSE;
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicExpression_setAst(PyObject* self, PyObject* node) {
   try {
     if (!PyAstNode_Check(node))
       return PyErr_Format(PyExc_TypeError, "SymbolicExpression::setAst(): Expected a AstNode as argument.");
     PySymbolicExpression_AsSymbolicExpression(self)->setAst(PyAstNode_AsAstNode(node));
     Py_INCREF(Py_None);
   return Py_None;
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
예제 #10
0
 static PyObject* SymbolicExpression_setComment(PyObject* self, PyObject* comment) {
   try {
     if (!PyString_Check(comment))
       return PyErr_Format(PyExc_TypeError, "SymbolicExpression::setComment(): Expected a string as argument.");
     PySymbolicExpression_AsSymbolicExpression(self)->setComment(PyString_AsString(comment));
     Py_INCREF(Py_None);
     return Py_None;
   }
   catch (const triton::exceptions::Exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
예제 #11
0
 static int SymbolicExpression_print(PyObject* self) {
   std::cout << PySymbolicExpression_AsSymbolicExpression(self);
   return 0;
 }
예제 #12
0
static PyObject *SymbolicExpression_isTainted(PyObject *self, PyObject *noarg) {
  SymbolicExpression *expression = PySymbolicExpression_AsSymbolicExpression(self);
  if (expression->isTainted == true)
    Py_RETURN_TRUE;
  Py_RETURN_FALSE;
}
예제 #13
0
static PyObject *SymbolicExpression_getNewAst(PyObject *self, PyObject *noarg) {
  SymbolicExpression *expression = PySymbolicExpression_AsSymbolicExpression(self);
  return PySmtAstNode(smt2lib::newInstance(expression->getExpression()));
}
예제 #14
0
static PyObject *SymbolicExpression_getKind(PyObject *self, PyObject *noarg) {
  SymbolicExpression *expression = PySymbolicExpression_AsSymbolicExpression(self);
  return Py_BuildValue("k", expression->getKind());
}
예제 #15
0
static PyObject *SymbolicExpression_getAst(PyObject *self, PyObject *noarg) {
  SymbolicExpression *expression = PySymbolicExpression_AsSymbolicExpression(self);
  return PySmtAstNode(expression->getExpression());
}