-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 assembler doesn't know .word directive #4070
Comments
Use .hex directive
|
Or .byte
|
I disnt added .word because its endian-confusing, but it can be added in 3 lines in libr/asm/asm.c
|
yeah, it seems with .hex the endianness is switched |
also while disassembling some real-world arm code i saw a number of "invalid"s, and i suppose those were .word directives used in a similar manner than the .text-hardcoded func address, but those happened not to produce a valid asm statement. imo in such a case rasm2 should emit a .word directive rather than "invalid" so the asm it spits out can be re-assembled. |
R2 with .hex doesnt swaps endian. Its objdump who confuses everyone :p
|
Theres an eval var for this: e asm.invhex=true You can also use Vd to define other types and structures
|
well usually it swaps, i.e. does the right thing, just not with .hex |
Will be ok with .dword . Hex is just linear write of bytes. Not affected by endian
|
It swaps if you do 0x because numbers are tied to endianness, but data is not
|
gcc 4.7.3 compiles this code (with -O1)
to
however the radare2 assembler doesn't know the .word directive, making it impossible to disassemble or reassemble equivalent code.
The text was updated successfully, but these errors were encountered: