gdb修改内存值

https://sourceware.org/gdb/current/onlinedocs/gdb/Assignment.html#Assignment 里发现gdb修改内存值的办法: To store values into arbitrary places in memory, use the ‘{…}’ construct to generate a value of specified type at a specified address (see Expressions). For example, {int}0x83040 refers to memory location 0x83040 as an integer (which implies a certain size and representation in memory), and set {int}0x83040 = 4 stores the value 4 into that memory location.

set {int *}0x7fff64191670=2  //8字节
set {int} 0x7fff64191670=20  //4字节

pwndbg rebase功能

具体用法如下:

b *$rebase(offset)

非常方便!!在你运行开启了pie和aslr的程序时,不需要你自己计算偏移下断点。

在pwntools下可以这么用

gdb.attach(io,"b *$rebase(0x27C3)")