142 std::cout << std::flush;
144 Py_TYPE(self)->tp_free((PyObject*)self);
148 static PyObject* SymbolicExpression_getAst(PyObject* self, PyObject* noarg) {
153 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
158 static PyObject* SymbolicExpression_getComment(PyObject* self, PyObject* noarg) {
163 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
168 static PyObject* SymbolicExpression_getDisassembly(PyObject* self, PyObject* noarg) {
173 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
178 static PyObject* SymbolicExpression_getId(PyObject* self, PyObject* noarg) {
183 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
188 static PyObject* SymbolicExpression_getNewAst(PyObject* self, PyObject* noarg) {
193 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
198 static PyObject* SymbolicExpression_getOrigin(PyObject* self, PyObject* noarg) {
210 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
215 static PyObject* SymbolicExpression_getType(PyObject* self, PyObject* noarg) {
220 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
225 static PyObject* SymbolicExpression_isMemory(PyObject* self, PyObject* noarg) {
232 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
237 static PyObject* SymbolicExpression_isRegister(PyObject* self, PyObject* noarg) {
244 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
249 static PyObject* SymbolicExpression_isSymbolized(PyObject* self, PyObject* noarg) {
256 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
261 static PyObject* SymbolicExpression_isTainted(PyObject* self, PyObject* noarg) {
268 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
273 static PyObject* SymbolicExpression_setAst(PyObject* self, PyObject* node) {
276 return PyErr_Format(PyExc_TypeError,
"SymbolicExpression::setAst(): Expected a AstNode as argument.");
282 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
287 static PyObject* SymbolicExpression_setComment(PyObject* self, PyObject* comment) {
289 if (!PyStr_Check(comment))
290 return PyErr_Format(PyExc_TypeError,
"SymbolicExpression::setComment(): Expected a string as argument.");
296 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
301 #if !defined(IS_PY3_8) || !IS_PY3_8
302 static int SymbolicExpression_print(PyObject* self,
void* io,
int s) {
309 static PyObject* SymbolicExpression_str(PyObject* self) {
314 return PyErr_Format(PyExc_TypeError,
"%s", e.
what());
319 static int SymbolicExpression_init(AstNode_Object *self, PyObject *args, PyObject *kwds) {
324 static PyObject* SymbolicExpression_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
325 return type->tp_alloc(type, 0);
331 {
"getAst", SymbolicExpression_getAst, METH_NOARGS,
""},
332 {
"getComment", SymbolicExpression_getComment, METH_NOARGS,
""},
333 {
"getDisassembly", SymbolicExpression_getDisassembly, METH_NOARGS,
""},
334 {
"getId", SymbolicExpression_getId, METH_NOARGS,
""},
335 {
"getNewAst", SymbolicExpression_getNewAst, METH_NOARGS,
""},
336 {
"getOrigin", SymbolicExpression_getOrigin, METH_NOARGS,
""},
337 {
"getType", SymbolicExpression_getType, METH_NOARGS,
""},
338 {
"isMemory", SymbolicExpression_isMemory, METH_NOARGS,
""},
339 {
"isRegister", SymbolicExpression_isRegister, METH_NOARGS,
""},
340 {
"isSymbolized", SymbolicExpression_isSymbolized, METH_NOARGS,
""},
341 {
"isTainted", SymbolicExpression_isTainted, METH_NOARGS,
""},
342 {
"setAst", SymbolicExpression_setAst, METH_O,
""},
343 {
"setComment", SymbolicExpression_setComment, METH_O,
""},
344 {
nullptr,
nullptr, 0,
nullptr}
349 PyVarObject_HEAD_INIT(&PyType_Type, 0)
350 "SymbolicExpression",
357 (printfunc)SymbolicExpression_print,
362 (reprfunc)SymbolicExpression_str,
368 (reprfunc)SymbolicExpression_str,
373 "SymbolicExpression objects",
388 (initproc)SymbolicExpression_init,
390 (newfunc)SymbolicExpression_new,
415 if (symExpr ==
nullptr) {
422 if (
object != NULL) {
423 object->symExpr = symExpr;
426 return (PyObject*)object;
The root class of all exceptions.
TRITON_EXPORT const char * what() const
Returns the exception message.
PyObject * PyLong_FromUsize(triton::usize value)
Returns a pyObject from a triton::usize.
PyTypeObject SymbolicExpression_Type
pySymbolicExpression type.
PyObject * PyRegister(const triton::arch::Register ®)
Creates the Register python class.
PyObject * PySymbolicExpression(const triton::engines::symbolic::SharedSymbolicExpression &symExpr)
Creates the SymbolicExpression 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::shared_ptr< triton::engines::symbolic::SymbolicExpression > SharedSymbolicExpression
Shared Symbolic Expression.
std::string toString(const T &obj)
Converts an object to a string.
PyMethodDef SymbolicExpression_callbacks[]
SymbolicExpression methods.
void SymbolicExpression_dealloc(PyObject *self)
SymbolicExpression destructor.
#define PyAstNode_Check(v)
#define PyAstNode_AsAstNode(v)
#define PySymbolicExpression_AsSymbolicExpression(v)
pySymbolicExpression object.