Closed hexpell closed 1 year ago
for example populate the memory region with some concrete value from some trace data etc.
This code illustrates the way about how to use Triton with a DBI and it's the same concept if you want to synch it with a trace or whatever. The idea is to define a memory callback (see addCallback()
and mem_read()
in the previous code) and sync registers at every processing (see synch_regs
).
That's it. There is no dryrun
way of what you are looking for.
Hope it helps
That's what I'm looking for. Thanks for the quick response!
Before processing an instruction to change the state of the CPU, I want to inspect the instruction that if it's reading or writing any memory address, get the concrete memory address value and perform some other actions, for example populate the memory region with some concrete value from some trace data etc.
But I found it difficult to do this with Triton, specifically to get the MemoryAccess without changing the state of the CPU. Basically what I want is
TritonContext::processing(inst)
but a "dryrun" version. I tried usingTritonContext::disassembly(inst)
but it doesn't populate the MemoryAccess states, until I call processing: