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

Wrong assembler output for x86 #11724

Open
ZhangZhuoSJTU opened this issue Oct 3, 2018 · 4 comments
Open

Wrong assembler output for x86 #11724

ZhangZhuoSJTU opened this issue Oct 3, 2018 · 4 comments

Comments

@ZhangZhuoSJTU
Copy link
Contributor

Work environment

Questions Answers
OS/arch/bits (mandatory) Ubuntu x86 64
File format of the file you reverse (mandatory) None
Architecture/bits of the file (mandatory) x86/32
r2 -v full output, not truncated (mandatory) radare2 3.0.0-git 19606 @ linux-x86-64 git.2.9.0-271-g237e6c294 commit: 237e6c2 build: 2018-10-03__15:56:23

Expected behavior

$ rasm2 -d -a x86 -b 32 8b444b10 # used for test the right result
$ mov eax, dword [ebx + ecx*2 + 0x10] # This is right
$ rasm2 -a x86 -b 32 "mov eax, dword [ebx + ecx*2 + 0x10]"
$ 8b444b10

Actual behavior

$ rasm2 -d -a x86 -b 32 8b444b10 # used for test the right result
$ mov eax, dword [ebx + ecx*2 + 0x10] # This is right
$ rasm2 -a x86 -b 32 "mov eax, dword [ebx + ecx*2 + 0x10]"
$ 8b040b # This is wrong
@radare
Copy link
Collaborator

radare commented Oct 3, 2018 via email

@ZhangZhuoSJTU ZhangZhuoSJTU changed the title Wrong disassemble output for x86 Wrong assembler output for x86 Oct 3, 2018
@XVilka XVilka added this to the 3.0 milestone Oct 9, 2018
@Maijin
Copy link
Contributor

Maijin commented Oct 9, 2018

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/tree/master/new/db/asm (See https://github.com/radare/radare2-regressions/blob/master/new/README.md) 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 modified the milestones: 3.0, 3.2.0 Oct 15, 2018
@radare
Copy link
Collaborator

radare commented Oct 15, 2018

nobody is gonna fix this for today

@radare radare removed this from the 3.2.0 milestone Jan 3, 2019
@stale
Copy link

stale bot commented Dec 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 3, 2020
@trufae trufae removed the bug label Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants