JonathanSalwan / Triton

Triton is a dynamic binary analysis library. Build your own program analysis tools, automate your reverse engineering, perform software verification or just emulate code.
https://triton-library.github.io
Apache License 2.0
3.4k stars 525 forks source link

Should be able to set concrete values for RDTSC semantics #1164

Closed hexpell closed 1 year ago

hexpell commented 1 year ago

Currently Triton just uses triton::api.getSymbolicExpressions().size() for the result of RDTSC x86 semantics. This is far from aligned with the real world situation. Instead Triton should provide some mechanism like a callback to allow the user to provide concrete value for the instruction.

hexpell commented 1 year ago

One way is to define TSC as a MSR register so we can just hook register read to provide the value.