radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.67k stars 3k forks source link

rasm: cannot assemble `mov sil, <imm>` #23326

Closed tesuji closed 1 month ago

tesuji commented 1 month ago

Environment

> date
Mon 16 Sep 16:15:47 2024
> r2 -v
radare2 5.9.4 1 @ linux-x86-64
birth: git.5.9.4 2024-08-08__14:21:20
commit: b77e3f8ed651b6866175062213158e2b33d2c1e7
options: gpl -O1 cs:5 cl:0 make
> uname -ms
Linux x86_64

Description

> pwn asm -f hex -c amd64 'mov sil, 2;' | rasm2 -D -
0x00000000   3                   40b602  mov sil, 2
> rasm2 -c amd64 'mov sil, 2;' | rasm2 -D -
ERROR: Cannot assemble 'mov sil, 2' at line 1

Test

trufae commented 1 month ago

again. -c amd64 is nothing. i just made a PR to warn you about that https://github.com/radareorg/radare2/pull/23329

Would you like to try to fix it by yourself and submit a patch for the libr/arch/p/x86_nz/nzasm.c to add support for that instruction?

Thanks for reporting

tesuji commented 1 month ago

Thanks. I will try to take a look later in a few days.