static PyObject *SymbolicVariable_getComment(PyObject *self, PyObject *noarg) {
  SymbolicVariable *variable = PySymbolicVariable_AsSymbolicVariable(self);
  if (variable->getSymVarComment().empty() == false)
    return PyString_FromFormat("%s", variable->getSymVarComment().c_str());
  Py_INCREF(Py_None);
  return Py_None;
}
Beispiel #2
0
static PyObject *SymbolicVariable_hasConcreteValue(PyObject *self, PyObject *noarg)
{
  SymbolicVariable *variable = PySymbolicVariable_AsSymbolicVariable(self);
  if (variable->hasConcreteValue() == true)
    Py_RETURN_TRUE;
  Py_RETURN_FALSE;
}
 static PyObject* SymbolicVariable_getName(PyObject* self, PyObject* noarg) {
   try {
     return Py_BuildValue("s", PySymbolicVariable_AsSymbolicVariable(self)->getName().c_str());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicVariable_getKind(PyObject* self, PyObject* noarg) {
   try {
     return PyLong_FromUint32(PySymbolicVariable_AsSymbolicVariable(self)->getKind());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicVariable_str(PyObject* self) {
   try {
     std::stringstream str;
     str << PySymbolicVariable_AsSymbolicVariable(self);
     return PyString_FromFormat("%s", str.str().c_str());
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Beispiel #6
0
      static PyObject* SymbolicVariable_setConcreteValue(PyObject* self, PyObject* value) {
        triton::engines::symbolic::SymbolicVariable *symVar;

        if (!PyLong_Check(value) && !PyInt_Check(value))
          return PyErr_Format(PyExc_TypeError, "setConcretevalue(): expected an integer as argument");

        symVar = PySymbolicVariable_AsSymbolicVariable(self);
        symVar->setSymVarConcreteValue(PyLong_AsUint128(value));
        Py_INCREF(Py_None);
        return Py_None;
      }
 static PyObject* SymbolicVariable_setConcreteValue(PyObject* self, PyObject* value) {
   try {
     if (!PyLong_Check(value) && !PyInt_Check(value))
       return PyErr_Format(PyExc_TypeError, "SymbolicVariable::setConcretevalue(): Expected an integer as argument.");
     PySymbolicVariable_AsSymbolicVariable(self)->setConcreteValue(PyLong_AsUint512(value));
     Py_INCREF(Py_None);
     return Py_None;
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
 static PyObject* SymbolicVariable_setComment(PyObject* self, PyObject* comment) {
   try {
     if (!PyString_Check(comment))
       return PyErr_Format(PyExc_TypeError, "SymbolicVariable::setComment(): Expected a string as argument.");
     PySymbolicVariable_AsSymbolicVariable(self)->setComment(PyString_AsString(comment));
     Py_INCREF(Py_None);
     return Py_None;
   }
   catch (const std::exception& e) {
     return PyErr_Format(PyExc_TypeError, "%s", e.what());
   }
 }
Beispiel #9
0
 static PyObject* SymbolicVariable_getKindValue(PyObject* self, PyObject* noarg) {
   return PyLong_FromUint(PySymbolicVariable_AsSymbolicVariable(self)->getSymVarKindValue());
 }
Beispiel #10
0
 static PyObject* SymbolicVariable_getId(PyObject* self, PyObject* noarg) {
   return Py_BuildValue("k", PySymbolicVariable_AsSymbolicVariable(self)->getSymVarId());
 }
Beispiel #11
0
 static PyObject* SymbolicVariable_getName(PyObject* self, PyObject* noarg) {
   return Py_BuildValue("s", PySymbolicVariable_AsSymbolicVariable(self)->getSymVarName().c_str());
 }
Beispiel #12
0
 static PyObject* SymbolicVariable_getConcreteValue(PyObject* self, PyObject* noarg) {
   return PyLong_FromUint128(PySymbolicVariable_AsSymbolicVariable(self)->getConcreteValue());
 }
static PyObject *SymbolicVariable_getSize(PyObject *self, PyObject *noarg) {
  SymbolicVariable *variable = PySymbolicVariable_AsSymbolicVariable(self);
  return Py_BuildValue("k", variable->getSymVarSize());
}
static PyObject *SymbolicVariable_getName(PyObject *self, PyObject *noarg) {
  SymbolicVariable *variable = PySymbolicVariable_AsSymbolicVariable(self);
  return PyString_FromFormat("%s", variable->getSymVarName().c_str());
}
static PyObject *SymbolicVariable_getConcreteValue(PyObject *self, PyObject *noarg) {
  SymbolicVariable *symVar = PySymbolicVariable_AsSymbolicVariable(self);
  return uint128ToPyLongObject(symVar->getConcreteValue());
}
 static int SymbolicVariable_print(PyObject* self) {
   std::cout << PySymbolicVariable_AsSymbolicVariable(self);
   return 0;
 }