I successfuly changed an instruction to a NOP
since it is pretty basic:
set *0x08048e3a = 0x90
But I'm trying to change this address 0x08048e3a
which has je 0x8048e52
. I would like to change it to je 0x8048ea8
.
But when I do set *0x08048e3a = 0x74168048ea8
it does not work.
(0x7416
= je
instruction)
Thank you
You can customize GDB to use any editor you want 10. By default, it is /bin/ex , but you can change this by setting the environment variable EDITOR before using GDB. For example, to configure GDB to use the vi editor, you could use these commands with the sh shell: EDITOR=/usr/bin/vi export EDITOR gdb …
gdb is the GNU source-level debugger that is standard on linux (and many other unix) systems. It can be used both for programs written in high-level languages like C and C++ and for assembly code programs; this document concentrates on the latter.
To stop your program while it is running, type "(ctrl) + c" (hold down the ctrl key and press c). gdb will stop your program at whatever line it has just executed. From here you can examine variables and move through your program. To specify other places where gdb should stop, see the section on breakpoints below.
So just type skip in gdb to skip a line. How to parametrize it to "skip(N)" ? @p2rkw. You can replace '1' with $arg0, as explained here: sourceware.org/gdb/onlinedocs/gdb/Define.html.
0x74168048ea8
is longer than a word. You should try setting bytes one by one, e.g.
set *(char*)0x08048e3a = 0x74
set *(char*)0x08048e3b = 0x16
etc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With