Target address of indirect branch

14 views
Skip to first unread message

Ray Guo

unread,
May 29, 2023, 12:58:46 PM5/29/23
to DynamoRIO Users
Hi,

I am trying to build a CFG of program based on DynamoRio. One question I have is about target address of indirect branch, which is essentially a value stored in register. I notice there is a DynamoRio function called instr_get_target() that can return the target. But I really have no idea about how to get exact value of target address and use it in later part (e.g., in a clean call), since the opnd_t structure is a black box. 

Take the code below as an example, how do I deal with the target_opnd variable so that the exact target address can be obtained and used in the clean_call
DR_ASSERT(instr_is_mbr(instr)); 
opnd_t target_opnd = instr_get_target(instr); 
dr_insert_clean_call(...);

Thanks a lot.

Derek Bruening

unread,
May 30, 2023, 5:22:10 PM5/30/23
to Ray Guo, DynamoRIO Users
Please see dr_insert_mbr_instrumentation() which is listed along with the other branch profiling helpers at https://dynamorio.org/API_BT.html#sec_branch_instru

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/b4b9d37a-8ba7-4fbb-a16f-e55b38d04508n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages