1

I am debugging a Linux program to which I have no symbols. The binary is stripped. No big deal, I can handle that. However, how can I skip a call inside the debugger when I reach a particular piece of code?

What I am asking is not this: Use gdb to debug assembly, how to skip a call

I am interested if I have a:

 call 0x12345678
 ...

to jump to the ... straight without executing the call.

How can I do that?

4

2 回答 2

2

经过更多阅读后,我找到了解决方案。

在我的情况下,我知道操作码call是五个字节长,所以我可以通过设置GDB 寄存器名称 $pc(“程序计数器”)来跳过它来解决它:

set $pc+=5

根据Employed Russian对此答案的评论,以下提供了相同的功能:

jump *$pc+5

假设您有call at地址0x01234567并且想要跳过五个字节,您可以在您的 中执行以下操作.gdbinit

b *0x01234567
commands 1
x/i $pc
echo Not executing the call\n
set $pc+=5
x/i $pc
end
于 2013-04-20T21:06:03.327 回答
1

在此之后将rip值设置为指令的地址call 0x12345678

于 2013-04-20T20:04:09.100 回答