On 17/08/18 10:11, shuai xi wrote:

Follow the memcheck's code, i insert a dirty call in IRSB. Now i want to get and change a register(like rax) value in this dirty call.

In vex , Register often shows as 't19 = GET:I64(16)'  or 'PUT(16) = t22'.

Can i get the register's real address and change its value by the num 16?

i read the code of vex's translate. I seems that there has no global values to store this information. Is there some ways to get this value?

Look at the amd64g_dirtyhelper_CPUID_* helpers as an example
of something that does this.

They are given a guest state pointer as the first argument
and that state contains the register values. The IR is built
so as to pass that pointer as the argument to the helper.

Alternatively I think the helper can just return a value
and then you can construct IR that will save the returned
value to a register.

Tom

--
Tom Hughes ([email protected])
http://compton.nu/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to