dr_insert_clean_call output

34 views
Skip to first unread message

Mohammad Ewais

unread,
Sep 17, 2021, 1:08:24 AM9/17/21
to DynamoRIO Users
Hello,

Is there a way to have any output from functions called by dr_insert_clean_call? Either as:
1. a return value (so, call a non void returning function)
2. If the function expects arguments by reference, do any changes to these arguments get reflected in the opnds passed by dr_insert_clean_call?

If neither of these are possible:
I am forcing apps to use my own memory, for every memory access I use drutil_insert_get_mem_addr then pass it as an argument to my translation function called by dr_insert_clean_call. What I want is to use the result of that function to replace the original memory operand. Any suggestions?

Mohammad Ewais

unread,
Sep 17, 2021, 1:55:20 AM9/17/21
to DynamoRIO Users
Another possibly relevant question is the following:
Does the type of opnd_t passed to dr_insert_clean_call matter? 
For example, if the final argument type is int32_t, does it matter if the operand passed is a reg or an immediate? As long as it contains a valid 32 bit value?

John Galea

unread,
Sep 18, 2021, 10:17:33 AM9/18/21
to dynamor...@googlegroups.com
Hey,

If you want to maintain results computed via clean calls, have your tool set up and use thread local storage (drmgr_register_tls_field) or heap memory via a global variable. Having clean calls return values is not really appropriate as by design they save and restore machine states.

Cheers,
John

--
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/8ab9497a-da21-4921-bc3e-0fab226922ffn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages