Changing the EAX register with Python

David Cournapeau cournape at gmail.com
Fri Nov 19 13:43:44 CET 2010


On Fri, Nov 19, 2010 at 4:17 PM, Tim Roberts <timr at probo.com> wrote:
> 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.
>
> You will need to find a Linux application equivalent to PaiMei.  Your
> question is not "how can I change EAX", your question is "where can I find
> a Linux debugger that can be controlled from Python?"

Well, gdb may just be the tool you are looking for: since version 7.0
at least, you can script gdb using python,

http://sourceware.org/gdb/wiki/PythonGdb

cheers,

David



More information about the Python-list mailing list