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 524 forks source link

Store instruction address in symbolic expression created from instructions. #1200

Closed ek0 closed 1 year ago

ek0 commented 1 year ago

Hey @JonathanSalwan,

This is a small proposal, and hopefully a small enough change. If you could give some feedback it would be much appreciated :)

Currently, apart the disassembly string, symbolic expressions don't have any information regarding the original instruction that was used for lifting. Having the original address embedded in the symbolic expression would be useful to do backtracking using the backward slicing functionality (through sliceExpressions)

For example: looking at the dead store elimination simplification, it seems there's a small hack parsing the disassembly string to retrieve the original instruction address.

If we keep this information in the symbolic expression this would not be required.

JonathanSalwan commented 1 year ago

Hey @ek0,

Thanks for this MR. I do remember thinking about that feature when implementing the small hack, but I do not remember why I did not do it... (maybe to lazy?). Let me few days to see if there is no hidden issue behind this feature and if everything looks good to me, I will merge this one :).

Cheers,

JonathanSalwan commented 1 year ago

sorry I've wrongly merged these commits and I had to revert them. Can you redo the MR?

ek0 commented 1 year ago

Sure thing, let me do this quickly