PDA

View Full Version : Setting register contents?


psyCK0
January 13th, 2004, 11:18
Hey,

How do I set register contents by using plugin APIs? I use Expression() to get them, but how do I write them back?

focht
January 13th, 2004, 13:14
Greetings,

well register contents make only sense in context of a thread.
Look at the t_thread descriptor documentation

<pre>
reg - excerpt from context that contains CPU registers sorted in a natural way.
Valid only when regvalid is non-zero. If you need to modify register, stop
application if necessary, check that regvalid is non-zero, apply your changes
and set reg.modified to 1.
Do not change single step flag or debugging register DR6;

regvalid - flag indicating that reg contains actual contents of thread's registers;
</pre>

Use Plugingetvalue(VAL_THREADS) to get the pointer to the table of threads.
You should (of course) only make modification the context structures if thread is in suspended state.

Hope this helps.

Regards,

A. Focht