Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm: rasm2 ignores immediates which are precedeed by an hash #15198

Closed
ghost opened this issue Oct 5, 2019 · 1 comment
Closed

arm: rasm2 ignores immediates which are precedeed by an hash #15198

ghost opened this issue Oct 5, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 5, 2019

Work environment

Questions Answers
OS/arch/bits (mandatory) Linux 5.3.1-arch1-1-ARCH x86_64 GNU/Linux
File format of the file you reverse (mandatory) N/A
Architecture/bits of the file (mandatory) arm
r2 -v full output, not truncated (mandatory) radare2 4.0.0-git 23157 @ linux-x86-64 git.3.9.0-116-g1f6ea1128 - commit: 1f6ea11 build: 2019-10-05__11:54:05

Expected behavior

rasm2 understands the (official?) format for arm immediates #<imm>.

$ rasm2 -a arm -b 64 'STP x29, x30, [sp, #0x80]'
fd7b08a9
$ cstool arm64 fd7b08a9
 0  fd 7b 08 a9  stp    x29, x30, [sp, #0x80]

Actual behavior

rasm2 ignores all immediates which are precedeed by an hash (therefore the (official?) format for arm immediates).

$ rasm2 -a arm -b 64 'STP x29, x30, [sp, #0x80]'
fd7b00a9
$ cstool arm64 fd7b00a9
 0  fd 7b 00 a9  stp    x29, x30, [sp]

Steps to reproduce the behavior

Execute the above instructions

EDIT: in fact, even r2 does ignore them, it makes sense. Editing the title.

$ r2 malloc://16
 -- This code was intentionally left blank, try 'e asm.arch = ws'
[0x00000000]> e asm.arch=arm
[0x00000000]> e asm.bits=64
[0x00000000]> "wa STP x29, x30, [sp, #0x80]"
Written 4 byte(s) (STP x29, x30, [sp, #0x80]) = wx fd7b00a9
[0x00000000]> pd 1
            0x00000000      fd7b00a9       stp x29, x30, [sp]
@ghost ghost changed the title arm: rasm2 ignores immediates which are precedeed by an hash (but r2 does not) arm: rasm2 ignores immediates which are precedeed by an hash Oct 5, 2019
@ghost
Copy link
Author

ghost commented Oct 5, 2019

I am trying to fix it.

@radare radare closed this as completed in 7144b91 Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants