strcpy-sse2-unaligned.S未找到

Afs*_*hin 17 c

我正在编译下面的简单代码,并在gdb中运行它.我在strcpy行设置了一个断点,一旦我为abc的输入运行它,然后按s,我得到以下错误:

Breakpoint 1, main (argc=2, argv=0x7fffffffdd98) at ExploitMe.c:9
9           strcpy(buffer, argv[1]);
(gdb) s
__strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:48
48  ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.
Run Code Online (Sandbox Code Playgroud)

我使用的是ubuntu 12.04 AMD64和gcc 2.15.任何的想法?


main(int argc, char *argv[]) {

    char buffer[80];

    strcpy(buffer, argv[1]);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

net*_*der 17

在调试时忽略这些"错误"是完全无害的.

错误只是因为GDB正在寻找strcpy函数的来源.libc中没有源代码的任何函数都会给出类似的错误,例如:

int *p = malloc(sizeof *p);
Run Code Online (Sandbox Code Playgroud)

然后...

(gdb) s
5       int *p = malloc(sizeof *p);
(gdb) s
__GI___libc_malloc (bytes=4) at malloc.c:2910
2910    malloc.c: No such file or directory.
Run Code Online (Sandbox Code Playgroud)

您可以随时下载GNU libc的源代码并将其与GDB链接:

git clone https://github.com/jeremie-koenig/glibc /opt/src/glibc
Run Code Online (Sandbox Code Playgroud)

然后...

(gdb) dir /opt/src/glibc/malloc
(gdb) s
5       int *p = malloc(sizeof *p);
(gdb) s
__GI___libc_malloc (bytes=4) at malloc.c:2910
2910              }
(gdb) s
2915          } else if (!in_smallbin_range(size))
Run Code Online (Sandbox Code Playgroud)

...这将让你逐步完成malloc源代码.它不是特别有用,但它有时会派上用场.