Closed crazyquark closed 1 year ago
I am not the best suited to answer this, but I think I am first. So maybe I can help move your forward a bit until someone smarter shows up.
There might be two problems that are hiding each other.
Version 5.6.6 is a bit old, your source build should be 5.7.7 and you can get a 5.7.6 release from here: https://github.com/radareorg/radare2/releases/tag/5.7.6
For comparison, my install from source gives me this:
> rasm2 -v
rasm2 5.7.7 29132 @ linux-x86-64 git.5.7.6-199-gaadacb2c9c
commit: aadacb2c9c91bd585673c37831dbaddf89db1677 build: 2022-08-31__02:20:49
> r2 -v
radare2 5.7.7 29132 @ linux-x86-64 git.5.7.6-199-gaadacb2c9c
commit: aadacb2c9c91bd585673c37831dbaddf89db1677 build: 2022-08-31__02:20:49
When I run rasm2 -L |grep -i xtensa
with the above build, I get nothing. I think this is a bug in rasm2 -L
because I can apparently still disassemble with xtensa. My build of rasm2 and r2 both accept it in -a
> rasm2 -b32 -da xtensa 112233445566778899
l32r a1, 0xfffccc88
excw
bany a8, a7, 0xffffffa3
So this bug might of tricked you into thinking your source build does not have xtensa?
Hi @swoops , thank you for the quick reply.
OK, freshly built radare2
from sources(master
branch):
/usr/local/bin/r2 -v
radare2 5.7.7 28813 @ linux-x86-64 git.5.7.6-199-gaadacb2c9
commit: aadacb2c9c91bd585673c37831dbaddf89db1677 build: 2022-08-31__13:42:02
/usr/local/bin/rasm2 -v
rasm2 5.7.7 28813 @ linux-x86-64 git.5.7.6-199-gaadacb2c9
commit: aadacb2c9c91bd585673c37831dbaddf89db1677 build: 2022-08-31__13:42:02
Yes, seems you were right, disassembly works for xtensa however assembly does not work or I am doing something wrong:
/usr/local/bin/rasm2 -b32 -a xtensa 'movi a1,0'
ERROR: Cannot assemble 'movi a1,0' at line 3
Also, possibly as a consequence, iaito is unable to edit instructions:
It is however able to disassemble it:
iaito
is also built from source.
there's no assembler for xtensa:
$ rasm2 -LL| grep xten
_dAe 32 xtensa LGPL3 Xtensa disassembler
0$
the first _
means that there's no assembler support for this architecture, so it's totally expected that iaito cant assemble instructions. it's not a bug in iaito.
If you want to assemble xtensa instructions you can do three things:
gas
plugin from r2 to wrap around it to use it from r2
Environment
Description
The xtensa plugin is missing in the radare2 builds, so iaito cannot dissasemble xtensa binaries. rasm2 -L also shows it is missing:
Test
rasm -L
I have also tried building from source but this also results in a
rasm2
withoutxtensa
. Also tried the BlackArch builds in VM(from the official repo), same issue.