创建: 2022-09-22 11:26
http://scz.617.cn:8/unix/202209221126.txt
缺省情况下Ubuntu 22中找不到radare2,只能用snap安装,参看
Getting started
https://snapcraft.io/docs/getting-started
aptitude install snapd
snap install radare2 --edge --devmode
snap list
snap remove radare2
ls -l /snap/bin/radare2.rasm2
readlink -f /snap/bin/radare2.rasm2
radare2.rasm2是到/usr/bin/snap的符号链接,类似busybox的套路。"/snap/bin"在PATH环境变量中。
$ radare2.rasm2 -a x86 -b 64 -s intel -o 0 "mov eax,dword [rsp+0x20]"
448b442420$ radare2.rasm2 -a x86 -b 64 -s att -o 0 -D 448b442420
0x00000000 5 448b442420 movl 0x20(%rsp), %r8d
snap版rasm2无法指定x86.nasm,这需要去snap中找nasm,不会去找/usr/bin/nasm,但snap中并没有nasm。
$ radare2.rasm2 -a x86.nasm -b 64 -s intel -o 0 "mov eax,dword [rsp+0x20]"
...
sh: 1: nasm: not found
Error running 'nasm'
...$ ls -l /snap/radare2/current/usr/bin/rasm2
snap版rasm2实际位于此处,所在目录位于只读文件系统,无法在此创建nasm的符号链接。
$ cd /snap/radare2/current/usr/bin/
$ ln -s /usr/bin/nasm .
ln: failed to create symbolic link './nasm': Read-only file system
rasm2不能指定x86.nasm的话,有些BUG无法规避,snap版rasm2鸡肋了。