Closed vancaho closed 11 months ago
We did not overloaded operators in C++. So, you have to craft the constraint using AstContext
.
Thanks very much. That is very helpful. If I want to set value for a memory cell, how to write the code?
ctx.setConcreteMemoryValue(triton::arch::MemoryAccess(0x11223344, triton::size::dword), 0xdeadbeef);
Sorry, I asked the wrong question. What I mean is I want to get a model for a memory cell. For example, I want to get a model for setting 0x11223344 to 0xdeadbeef.
Common guy, I'm not ChatGPT :D
auto mem = ctx.getSymbolicMemory(triton::arch::MemoryAccess(0x11223344, 4));
auto ast = ctx.getAstContext();
auto constraint = ast->equal(mem, ast->bv(0xdeadbeef, 4));
auto model = ctx.getModel(constraint);
Hi, I want to use
Context::getModel()
function in c++. For example, ifdst_reg_sym_ast
is the ast of aregister
I want to get a model ofdst_reg_sym_ast = 0x41414141
.With
python
, I can write:model = self._context.getModel(dst_reg_sym_ast == 0x41414141)
. But with C++, the above code is not usable. I looked upContext::getModel()
in the documentation, but cannot find an example.