Changing the EAX register with Python

dutche dutche at gmail.com
Fri Nov 19 14:08:37 CET 2010


Well, I think using ptrace is really the best way, at least what I
have found on Google told me that.

Stefan, your answer will fit perfectlly for me, it was what I'm
searching.

Thank you

On Nov 19, 10:43 am, David Cournapeau <courn... at gmail.com> wrote:
> On Fri, Nov 19, 2010 at 4:17 PM, Tim Roberts <t... at probo.com> wrote:
> > dutche <dut... 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