我正在尝试使用GDB的0xE4FF
函数在我正在调试的程序中搜索find
的所有出现。在下面,我的搜索找到两种模式,然后我继续验证它们:
(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中尽可能地做到这一点,我做的最后一次挑战我发现自己在这种情况下,我所拥有的一切)
答案 0 :(得分:2)
来自(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