xed icon indicating copy to clipboard operation
xed copied to clipboard

Improve support for conditional read/write operands

Open lzybkr opened this issue 8 years ago • 3 comments

Similar to xed_agen, I think it would be useful to have an api that uses the xed_register_callback_fn_t callback to definitely determine when a conditional operand is actually read/written.

lzybkr avatar Feb 14 '18 18:02 lzybkr

Not sure I'm on board with that idea. The conditional register stuff is really there to help register allocators reason about what registers are updated and those that only might be updated. Register allocators don't have values to work with.

I took a quick look at all the conditional writes and conditional read/writes. They fall in to a few broad categories: rep-string ops, conditional moves, gathers/scatters, compare-exchange, some shifts and some other more esoteric stuff. Yes, I see how if you know the count for the rep-string ops or shifts, or the mask for gathers, one could make some of the conditional accesses unconditional.

markcharney avatar Feb 14 '18 18:02 markcharney

My scenario is analyzing an instruction level trace to propagate tainted memory from the point of taint to all uses.

I have the register and memory values at every instruction (built on top of our time travel debugging) and xed_agen was extremely helpful, so I thought it was worth bringing up. One way or another I need to understand cmov and rep instructions as they are unavoidable in traces I need to analyze.

lzybkr avatar Feb 14 '18 18:02 lzybkr

Yeah, I hear you. Most of the stuff seems pretty easy to support.

markcharney avatar Feb 14 '18 21:02 markcharney