In an analysis function (clean call) I have to get the value stored in some register and at some memory location.Regarding the register value: IUUC, one can do the following at instrumentation time:dr_insert_clean_call(drcontext, ilist, where, clean_call_callee, false, 1, opnd_create_reg(reg))...and "opnd_create_reg" here is roughly equivalent to Pin's IARG_REG_VALUE, i.e. it requests DR to pass reg's value to the clean call. Am I right?
However, sometimes I'd like to get the value of a given register (reg_id_t) within the clean call. Is it possible? I know I can acquire the whole context, but how then to iterate over its fields and match with the desired reg_id_t?
Regarding the memory: can one just copy from any process address, or is there a special function, like Pin's PIN_SafeCopy()?
--Thanks.
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 post to this group, send email to dynamor...@googlegroups.com.
Visit this group at http://groups.google.com/group/dynamorio-users.
For more options, visit https://groups.google.com/d/optout.
However, sometimes I'd like to get the value of a given register (reg_id_t) within the clean call. Is it possible? I know I can acquire the whole context, but how then to iterate over its fields and match with the desired reg_id_t?I am not sure what do you mean within the clean call, if you want to get the app's register value, you can use dr_get_mcontext to get the machine context, so all the registers value.
You can directly access the memory if you are sure the memory are accessiable, you can also use dr_safe_read dr_safe_write to access those memory.
Using dr_get_mcontext() I get the whole context, but is it possible to extract from it a specific reg_id_t generically?
On Tue, May 13, 2014 at 1:01 PM, Igor R <boost...@gmail.com> wrote:
Using dr_get_mcontext() I get the whole context, but is it possible to extract from it a specific reg_id_t generically?
reg_get_value