这与发布的问题类似这里和这里。我想对一个名为的二进制文件进行逆向工程GPS记录器但在使用 GDB 调试它之前,我希望简单地使用 QEMU (qemu-aarch64) 模拟它,因为当我运行时,file gpslogger
我得到gpslogger: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, not stripped
.我首先下载确切的解释器文件并将其粘贴到我的 Ubuntu 16.04 x86_64/lib
文件夹中,然后出现其他错误,要求提供其他.so
文件,例如libgps.so
.然后,我下载.so
AARCH64 架构的这些文件并将它们粘贴到/lib
我的 Ubuntu 的文件夹中。一旦所有的.so
错误都no such file or directory
消失了,我就剩下了
Error relocating /lib/libgps.so: __strdup: symbol not found
Error relocating /lib/libgps.so: __fdelt_chk: symbol not found
Error relocating /lib/libgps.so: __fprintf_chk: symbol not found
Error relocating /lib/libgps.so: __snprintf_chk: symbol not found
Error relocating /lib/libgps.so: __isnan: symbol not found
Error relocating /lib/libgps.so: __syslog_chk: symbol not found
Error relocating /lib/libgps.so: __vsnprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __snprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __vsnprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __strncpy_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __vfprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __fprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __vsprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __sprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: reallocarray: symbol not found
Error relocating /lib/libsystemd.so.0: __register_atfork: symbol not found
Error relocating /lib/libsystemd.so.0: __memcpy_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __snprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __vsnprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __strncpy_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __vasprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __open64_2: symbol not found
Error relocating /lib/libsystemd.so.0: __asprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __fprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __ppoll_chk: symbol not found
Error relocating /lib/libsystemd.so.0: fcntl64: symbol not found
Error relocating /lib/libsystemd.so.0: __explicit_bzero_chk: symbol not found
Error relocating /lib/libsystemd.so.0: parse_printf_format: symbol not found
Error relocating /lib/libsystemd.so.0: __openat64_2: symbol not found
Error relocating /lib/libgcrypt.so.20: __memcpy_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __snprintf_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __fdelt_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __vfprintf_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __memset_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __fprintf_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __read_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __syslog_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __sprintf_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __fdelt_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __vfprintf_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __memset_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __fprintf_chk: symbol not found
Error relocating gpslogger: GPSNMEA: symbol not found
除了最后一个重定位错误之外,我相信所有其他功能都应该在glibc
.因此,我只是libc-2.32.so
从以下位置下载了该文件这里对于AARCH64架构并将其粘贴到/lib
我的Ubuntu的文件夹中。然而,错误并没有消失。如果需要更多信息,请告诉我。我很感激任何有关这个问题的帮助。
编辑:
readelf -d gpslogger | grep 'NEEDED'
返回:
0x0000000000000001 (NEEDED) Shared library: [libgps.so]
0x0000000000000001 (NEEDED) Shared library: [libc.musl-aarch64.so.1]
这是否意味着 是libc
来自musl
而不是glibc
?
答案1
输出中的“interpreter /lib/ld-musl-aarch64.so.1
”表示它是用 musl 构建的。这意味着您不仅需要 musl 动态链接器 ( ),还需要.file
gpslogger
ld-musl-aarch64.so.1
gpslogger
您列出的缺失符号表明您安装的库是为 glibc 构建的。