GDB gives an error when entering a breakpoint

I am trying to track the repetition of a video in a buffer overflow from this and below - the code I'm trying to do.

#include <stdio.h>

GetInput() 
{
    char buffer[8];

    gets(buffer);
    puts(buffer);   
}

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

I get isssue in gdb debugging while I am on ie in line 7, I get the following error:

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

I follow the same steps as in the textbook. I am using 32-bit Kali linux on a virtual box

Can someone help me solve this problem.

+4
source share
2 answers

The author of the message follows the course of operating the buffer overflow. Instead of helping him, everyone jumped with inaccurate information. We all know that the code is wrong, but then, how should you study the operation of buffer overflows, if not bad code?

, - .

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

gdb

(gdb) set debug-file-directory

.

+4

, glibc. , glibc, , gets() , , buffer, Undefined Behavior.

0

Source: https://habr.com/ru/post/1618750/


All Articles