我想在我的 ARM64 Ubuntu 22.04 虚拟机上安装 IDA Pro for Linux(或 IDA Free 有同样的问题),该虚拟机使用 Rosetta 2 来实现兼容性。
花费大量时间解决环境依赖问题并安装大量软件包后,IDA Pro 能够正常运行。
sudo apt-get update
sudo apt-get install binutils:amd64 libgl1-mesa-glx:amd64 libglib2.0-0:amd64 libsecret-1-0:amd64
sudo apt-get install libfontconfig1:amd64 libxcb-icccm4:amd64 libxcb-image0:amd64 libxcb-keysyms1:amd64 libxcb-render-util0:amd64 libxcb-render0:amd64 libxcb-shape0:amd64 libxcb-xinerama0:amd64 libxcb-xkb1:amd64 libsm6:amd64 libice6:amd64 libxkbcommon-x11-0:amd64 libxkbcommon0:amd64 libdbus-1-3:amd64
但是重启虚拟机后,又遇到了共享库加载错误,字符显示为乱码。
$ ./idafree-8.4/ida64
./idafree-8.4/ida64: error while loading shared libraries: ��: cannot open shared object file: No such file or directory
ldd 输出如下。似乎没有遗漏任何动态库。
$ ldd-amd64 ./idafree-8.4/ida64
libQt5PrintSupport.so.5 => /home/parallels/./idafree-8.4/libQt5PrintSupport.so.5 (0x00007ffffea00000)
libQt5Svg.so.5 => /home/parallels/./idafree-8.4/libQt5Svg.so.5 (0x00007ffffe600000)
libQt5Widgets.so.5 => /home/parallels/./idafree-8.4/libQt5Widgets.so.5 (0x00007ffffdc00000)
libQt5Gui.so.5 => /home/parallels/./idafree-8.4/libQt5Gui.so.5 (0x00007ffffd200000)
libQt5Core.so.5 => /home/parallels/./idafree-8.4/libQt5Core.so.5 (0x00007ffffc800000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fffff6e5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fffff6de000)
libida64.so => /home/parallels/./idafree-8.4/libida64.so (0x00007ffffc000000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ffffbdd4000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fffff5f7000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fffff5d7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffffbbab000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffffede2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffffeddd000)
libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007ffffedd8000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ffffec9e000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffffff80000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007ffffe948000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007ffffec68000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ffffe943000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ffffe8cd000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007ffffe4c0000)
libxcb.so.1 => /home/parallels/./idafree-8.4/libxcb.so.1 (0x00007ffffb800000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007ffffe8c7000)
IDA Pro: idapronl_hexarm64l_hexarml_hexmips64l_hexmipsl_hexx64l_hexx86l_230608_xxx.run
or
IDA Free: v8.3 (from https://hex-rays.com/ida-free/)
VM:
Ubuntu 22.04.4
Arch: aarch64
Kernel: Linux version 5.15.0-76-generic (buildd@bos02-arm64-019) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #83-Ubuntu SMP Thu Jun 15 19:21:56 UTC 2023
Memory Size: 2G
Host:
Model: Apple M3 Pro
Memory: 18GB
OS: MacOS Sonoma 14.3.1 (23D60)
VirtualMachine Software: Parallels Desktop 19 for Mac (19.0.0)
我推测可能是安装的库和系统的库有冲突。因此,我尝试安装每个库,然后重新启动虚拟机以缩小搜索范围。安装
libc6
并重启后,IDA没有出现错误,但提示缺少libGL.so.1
。安装libgl1-mesa-glx
包并再次运行IDA后,之前的错误再次出现。
错误的十六进制代码:
parallels@ubuntu-linux-22-04-02-desktop:~$ ./idapro-8.3/ida 2>&1 | hexdump -C
00000000 2e 2f 69 64 61 70 72 6f 2d 38 2e 33 2f 69 64 61 |./idapro-8.3/ida|
00000010 3a 20 65 72 72 6f 72 20 77 68 69 6c 65 20 6c 6f |: error while lo|
00000020 61 64 69 6e 67 20 73 68 61 72 65 64 20 6c 69 62 |ading shared lib|
00000030 72 61 72 69 65 73 3a 20 01 91 99 3a 20 63 61 6e |raries: ...: can|
00000040 6e 6f 74 20 6f 70 65 6e 20 73 68 61 72 65 64 20 |not open shared |
00000050 6f 62 6a 65 63 74 20 66 69 6c 65 3a 20 4e 6f 20 |object file: No |
00000060 73 75 63 68 20 66 69 6c 65 20 6f 72 20 64 69 72 |such file or dir|
00000070 65 63 74 6f 72 79 0a |ectory.|
00000077
我尝试运行 IDA 的 TUI 版本——
idat
。 idat
效果很好。
所以我猜这个错误可能是由
libGL.so.1
引起的。
成功运行IDA Pro。
“罪魁祸首”实际上是 Parallels,特别是 Rosetta 守护进程,它可能用于加速 Rosetta:
守护进程是
/media/psf/RosettaLinux/
它在 /var/cache/prlrosettad
中创建缓存条目
杀死守护进程就足以让 IDA 启动。并不理想,但在 Parallels 解决问题之前,这是一个很好的解决方法(在我看来,这值得一张票)。
sudo pkill rosettad