I am running a program and I want to check whether a branch is taken when there is a conditional jump.
I heard that IntelPT can do that using pt_qry_cond_branch()
function. However I could not see any example on how to use it. Does anyone have any idea about it?
For example, how would I use Intel PT to see what happened in this function:
foo:
rdrand eax
cmp eax, 1<<29
ja .taken
nop
.taken:
xor eax, eax
ret
I want to know how to use Intel-PT for this, rather than setting a breakpoint on the nop
or some other way of instrumenting to find the data and compute the branch condition myself.