gpt4 book ai didi

c - GDB 在进入断点时抛出错误

转载 作者:太空狗 更新时间:2023-10-29 15:32:08 24 4
gpt4 key购买 nike

我正在尝试从这个 link 中观看有关缓冲区溢出的视频教程以下是我正在尝试的代码。

#include <stdio.h>

GetInput()
{
char buffer[8];

gets(buffer);
puts(buffer);
}

main()
{
GetInput();
return 0;
}

我在 gdb 调试中遇到问题,当我进入第 7 行时,我收到以下错误:

_IO_gets (buf=0xbffff458 "k\204\004\b") at iogets.c:33
33 iogets.c: No such file or directory.

我正在按照教程中提到的完全相同的步骤进行操作。我在 virtual box 上使用 32 位 Kali linux

谁能帮我解决这个问题。

最佳答案

该帖子的作者正在学习缓冲区溢出利用类(class)。每个人都没有帮助他,而是跳出了题外话的信息。我们都知道代码是错误的,但是,如果不是在错误的代码上,您应该如何学习缓冲区溢出利用?

在这种情况下,调试无法正常工作,因为调试文件的位置在其他地方。

(gdb) show debug-file-directory
The directory where separate debug symbols are searched for is "/usr/lib/debug"

在gdb中执行以下命令

(gdb) set debug-file-directory

现在您将能够调试您的代码。高频

关于c - GDB 在进入断点时抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34112835/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com