|
From: shuai xi <aha...@gm...> - 2018-08-17 09:12:12
|
Hello @all, 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? Very Thanks!! Shuai xi |
|
From: Tom H. <to...@co...> - 2018-08-17 10:58:28
|
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 (to...@co...) http://compton.nu/ |