Changing the EAX register with Python

Dan Stromberg drsalists at gmail.com
Thu Nov 18 17:33:12 EST 2010


Here's -a- way to try - not necessarily the best way:
1) Write a little gcc .c with inline assembler, to make your EAX change
2) Call it from CPython using ctypes

However, by the time you return from the code that makes your change and
resume execution in the CPython interpreter, EAX may well have been changed
to something new.  Accumulators don't often hold the same value for very
long.

On Thu, Nov 18, 2010 at 12:20 PM, dutche <dutche at gmail.com> wrote:

> Hi folks, I have a unusual question here.
>
> How can I change the value of EAX register under python under Linux??
> As paimei does under Windows.
>
> My project is to have a python program that loads a C program and sets
> a breakpoint at some address, and then with this breakpoint I change
> the EAX register and then continue the program execution.
>
> With Windows and paimei I did that, but under Linux I don't know yet.
>
> Any ideas?
>
> Thank you
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101118/f9bda928/attachment.html>


More information about the Python-list mailing list