|
From: Sergey <sn...@gm...> - 2011-11-12 09:44:30
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hello!
I am writing a tool that monitors all call and ret instructions and depending on the changes the return address. I change the VEX as follows: at the end of the block insert DIRTY with the parameters of the current address and return address.
Process the return address is obtained is good, but I do not know how to change that VEX would after I took over control of the handler to another location. Originally I wanted to make the transition to a value which is returned to my handler, but stumbled on the fact that the value returned by Dirty handler is I1 type, not I64.
How can I generate code that assigns the I64 value? Or is there another way to get the same result?
p.s. Sorry, English is not native language for me
Sergey
- --- code ----
ret_addr = newIRTemp(sbOut->tyenv,Ity_I64);
di = unsafeIRDirty_1_N( ret_addr, 0, "ret_hook",
VG_(fnptr_to_fnentry)( & ret_hook ),
mkIRExprVec_2( getExprFromAddr(last_Mark->Ist.IMark.addr, hWordTy), sbIn->next) );
addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
sbOut->next = IRExpr_RdTmp(ret_addr);
- --- end code ----
- --- generated VEX code ----
t84 = DIRTY 1:I1 ::: ret_hook{0x38000370}(0x400AEFE:I64,t27)
goto {Return} t84
- --- end ----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
iF4EAREIAAYFAk6+TkEACgkQT5YcF8hAFclH/AD7BysWjyHCQ6mfZdDb2v9U+9mW
2sgc8LXfMdTTOXrsmgEA/3CLWG6Uu8N+BT35gzRf1to3+UTDVLv1oAubO31Ntvhy
=Z8lr
-----END PGP SIGNATURE-----
|