简体   繁体   English

strcpy-sse2-unaligned.S未找到

[英]strcpy-sse2-unaligned.S not found

I am compiling the simple code below, and run it in gdb. 我正在编译下面的简单代码,并在gdb中运行它。 I set a break point at the strcpy line, as soon as I run it for the input for instance abc, and then press s, I get the following error: 我在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.

I am using ubuntu 12.04 AMD64 and gcc 2.15. 我使用的是ubuntu 12.04 AMD64和gcc 2.15。 Any idea? 任何的想法?


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

    char buffer[80];

    strcpy(buffer, argv[1]);

    return 0;
}

It is completely harmless to ignore these "errors" when debugging. 在调试时忽略这些“错误”是完全无害的。

The error is simply because GDB is looking for the source of the strcpy function. 错误只是因为GDB正在寻找strcpy函数的来源。 Any function in libc that you don't have the source for will you give a similar error, eg: libc中没有源代码的任何函数都会给出类似的错误,例如:

int *p = malloc(sizeof *p);

Then... 然后...

(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.

You can always download GNU libc's source and link it with GDB: 您可以随时下载GNU libc的源代码并将其与GDB链接:

git clone https://github.com/jeremie-koenig/glibc /opt/src/glibc

Then... 然后...

(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))

... which will let you step through malloc 's source code. ...这将让您逐步完成malloc的源代码。 It's not particularly useful, but it can come in handy sometimes. 它不是特别有用,但它有时会派上用场。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM