GDB 查找函数没有找到所有出现的模式
GDB's find function doesn't find all occurences of the pattern
我正在尝试使用 GDB 的 find
函数在我正在调试的程序中搜索所有出现的 0xE4FF
。在下面,我的搜索找到了两个模式,我继续验证它们:
(gdb) find 0x8048000, 0x888a000, 0xE4FF
0x8142c63
0x8848fa4
2 patterns found.
(gdb) x/2bx 0x08142c63
0x8142c63: 0xff 0xe4
(gdb) x/2bx 0x08848fa4
0x8848fa4: 0xff 0xe4
在我关注的教程中,作者使用的是 EDB 并选择了这个地址 0x08134597
,它落在我给 GDB 的搜索范围内。快速检查确认此地址包含我正在搜索的模式,但 GDB 没有报告它:
(gdb) x/2bx 0x08134597
0x8134597: 0xff 0xe4
我试图理解为什么 GDB 没有报告包含我正在搜索的模式的这个(和其他几个)有效地址。有没有我可以用来确保 GDB 报告所有这些地址的选项。
(注意:这是为了漏洞利用开发,我有意避免使用 GDB-PEDA(这很棒)和 Metasploit。我正在尝试尽可能多地在纯 GDB 中执行此操作,这是我完成的最后一个挑战发现自己处于这样的境地)
来自(gdb) help find
:
Search memory for a sequence of bytes.
Usage:
find [/size-char] [/max-count] start-address, end-address, expr1 [, expr2 ...]
find [/size-char] [/max-count] start-address, +length, expr1 [, expr2 ...]
size-char is one of b,h,w,g for 8,16,32,64 bit values respectively,
and if not specified the size is taken from the type of the expression
in the current language.
Note that this means for example that in the case of C-like languages
a search for an untyped 0x42 will search for "(int) 0x42"
which is typically four bytes.
注意最后一句话。我认为您正在寻找以下之一:
find/h 0x8048000, 0x888a000, 0xE4FF
find 0x8048000, 0x888a000, (short)0xE4FF
我正在尝试使用 GDB 的 find
函数在我正在调试的程序中搜索所有出现的 0xE4FF
。在下面,我的搜索找到了两个模式,我继续验证它们:
(gdb) find 0x8048000, 0x888a000, 0xE4FF
0x8142c63
0x8848fa4
2 patterns found.
(gdb) x/2bx 0x08142c63
0x8142c63: 0xff 0xe4
(gdb) x/2bx 0x08848fa4
0x8848fa4: 0xff 0xe4
在我关注的教程中,作者使用的是 EDB 并选择了这个地址 0x08134597
,它落在我给 GDB 的搜索范围内。快速检查确认此地址包含我正在搜索的模式,但 GDB 没有报告它:
(gdb) x/2bx 0x08134597
0x8134597: 0xff 0xe4
我试图理解为什么 GDB 没有报告包含我正在搜索的模式的这个(和其他几个)有效地址。有没有我可以用来确保 GDB 报告所有这些地址的选项。
(注意:这是为了漏洞利用开发,我有意避免使用 GDB-PEDA(这很棒)和 Metasploit。我正在尝试尽可能多地在纯 GDB 中执行此操作,这是我完成的最后一个挑战发现自己处于这样的境地)
来自(gdb) help find
:
Search memory for a sequence of bytes.
Usage:
find [/size-char] [/max-count] start-address, end-address, expr1 [, expr2 ...]
find [/size-char] [/max-count] start-address, +length, expr1 [, expr2 ...]
size-char is one of b,h,w,g for 8,16,32,64 bit values respectively,
and if not specified the size is taken from the type of the expression
in the current language.
Note that this means for example that in the case of C-like languages
a search for an untyped 0x42 will search for "(int) 0x42"
which is typically four bytes.
注意最后一句话。我认为您正在寻找以下之一:
find/h 0x8048000, 0x888a000, 0xE4FF
find 0x8048000, 0x888a000, (short)0xE4FF