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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

`wa test r8,r8` incorrectly assembles `test rax,rax` #9071

Closed
MaskRay opened this Issue Dec 26, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@MaskRay
Contributor

MaskRay commented Dec 26, 2017

[0x0047aece]> wa test r8,r8
Written 3 bytes (test r8,r8) = wx 4885c0
[0x0047aece]> pi 1
test rax, rax
[0x0047aece]> 

radare2 dropped the ball 馃槩 when I intended to make my one-byte binary fix to libclang.so.5.0 cquery-project/cquery#192 (BTW, cquery is a really awesome C++ language server)

I have to use r2 -nwqc 'wx 4d @ 0x47aece' build/release/lib/clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-14.04/lib/libclang.so.5.0
But apparently r2 -nwqc 'wa test r8,r8 @ 0x47aece' build/release/lib/clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-14.04/lib/libclang.so.5.0 is more readable.

@Maijin

This comment has been minimized.

Show comment
Hide comment
@Maijin

Maijin Dec 26, 2017

Collaborator

Greetings,

x86.nz (x86 handmade assembler) is one of the many x86 assemblers available in radare2 and is updated frequently. Please add a test case so we can fix x86.nz in https://github.com/radare/radare2-regressions/blob/master/t.asm/x86/nz/x86_asm You can do so with github web editor without even cloning the repo.

You can contribute to x86.nz by completing the following file https://github.com/radare/radare2/blob/master/libr/asm/p/asm_x86_nz.c.
You can also use keystone(http://keystone-engine.org) within radare2/rasm2 by installing the radare2 plugin via r2pm :

	r2pm -i keystone-lib
	r2pm -i keystone
then
	rasm2 -a x86.ks鈥
or in radare2 session
	e asm.assembler = x86.ks

Others x86 assemblers are also available trough r2pm or master (see rasm2 -L list):

a___  16 32 64   x86.as      LGPL3   Intel X86 GNU Assembler
a___  16 32 64   x86.nasm    LGPL3   X86 nasm assembler
a___  16 32 64   x86.nz      LGPL3   x86 handmade assembler
ad__  32         x86.olly    GPL2    OllyDBG X86 disassembler
Collaborator

Maijin commented Dec 26, 2017

Greetings,

x86.nz (x86 handmade assembler) is one of the many x86 assemblers available in radare2 and is updated frequently. Please add a test case so we can fix x86.nz in https://github.com/radare/radare2-regressions/blob/master/t.asm/x86/nz/x86_asm You can do so with github web editor without even cloning the repo.

You can contribute to x86.nz by completing the following file https://github.com/radare/radare2/blob/master/libr/asm/p/asm_x86_nz.c.
You can also use keystone(http://keystone-engine.org) within radare2/rasm2 by installing the radare2 plugin via r2pm :

	r2pm -i keystone-lib
	r2pm -i keystone
then
	rasm2 -a x86.ks鈥
or in radare2 session
	e asm.assembler = x86.ks

Others x86 assemblers are also available trough r2pm or master (see rasm2 -L list):

a___  16 32 64   x86.as      LGPL3   Intel X86 GNU Assembler
a___  16 32 64   x86.nasm    LGPL3   X86 nasm assembler
a___  16 32 64   x86.nz      LGPL3   x86 handmade assembler
ad__  32         x86.olly    GPL2    OllyDBG X86 disassembler

@radare radare added the release label Dec 27, 2017

@radare radare added this to the 2.3.0 milestone Dec 27, 2017

Svenito added a commit to Svenito/radare2 that referenced this issue Dec 28, 2017

@radare radare closed this in #9084 Dec 28, 2017

radare added a commit that referenced this issue Dec 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment