1

我找不到在 gdb-peda 中使用“searchmem”命令的示例,在标准 gdb 中,“find”命令还可用于查找感兴趣的指令,这样:

(gdb)find /b start_address,end_address,opcode1,opcode2,..,opcodeN 

例如,要搜索小工具“pop ebx ; ret”,我会输入 gdb:

(gdb)find /b start_address,end_address,0x59,0xc3

如何使用 gdb peda 来做到这一点?

更新:使用 ropsearch 我可以做到这一点。

(gdb-peda)ropsearch "pop ebx ; ret" libc
4

1 回答 1

0

根据源代码,您可以传递searchmem正则表达式模式,以便您能够以这种方式传递操作码列表。

相关部分:

    def searchmem(self, start, end, search, mem=None):
    """
    Search for all instances of a pattern in memory from start to end
    Args:
        - start: start address (Int)
        - end: end address (Int)
        - search: string or python regex pattern (String)
        - mem: cached mem to not re-read for repeated searches (raw bytes)
    Returns:
        - list of found result: (address(Int), hex encoded value(String))

https://github.com/longld/peda/blob/master/peda.py#L1872

于 2021-03-11T01:34:09.320 回答