How to avoid stdin input that does not fit in buffer be sent to the shell in Linux 64-bit Intel (x86-64) assembly

前端 未结 3 1311
一向
一向 2021-01-13 15:44

Edit: Title changed, as @Gunner pointed out that this is not a buffer overflow.

In reading user input from stdin with NR_read

3条回答
  •  死守一世寂寞
    2021-01-13 16:14

    It is not a buffer overflow as others have stated. I wrote a tutorial on reading from the terminal in Linux which also shows how to deal with this issue. It uses Int 80, but you can easily change it to fit your needs.

    http://www.dreamincode.net/forums/topic/286248-nasm-linux-terminal-inputoutput-wint-80h/

提交回复
热议问题