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

[x86] regression on rcl with capstone v5 #2079

Closed
Tracked by #2081
wargio opened this issue Jul 10, 2023 · 6 comments
Closed
Tracked by #2081

[x86] regression on rcl with capstone v5 #2079

wargio opened this issue Jul 10, 2023 · 6 comments
Labels
Milestone

Comments

@wargio
Copy link
Contributor

wargio commented Jul 10, 2023

d110 should ouput rcl dword [eax], 1 but instead returns rcl dword [eax]
This is the output on objdump

0:  d1 10                   rcl    DWORD PTR [eax],1 
@XVilka
Copy link
Contributor

XVilka commented Jul 10, 2023

https://c9x.me/x86/html/file_module_x86_id_273.html

capstone/build on  next                                                                                                                                                                                    15:46:11
ℤ ./cstool -d x32 d110
 0  d1 10                                            rcl	dword ptr [eax]
	ID: 615 (rcl)
	Prefix:0x00 0x00 0x00 0x00
	Opcode:0xd1 0x00 0x00 0x00
	rex: 0x0
	addr_size: 4
	modrm: 0x10
	disp: 0x0
	sib: 0x0
	op_count: 1
		operands[0].type: MEM
			operands[0].mem.base: REG = eax
		operands[0].size: 4
		operands[0].access: READ
	Registers read: eax
	Registers modified: eflags
	EFLAGS: MOD_CF UNDEF_OF

@XVilka
Copy link
Contributor

XVilka commented Jul 10, 2023

Bisecting pointed to this:

git bisect good
5a99624074d56f8eea26699496f0e8dc41cbf3fb is the first bad commit
commit 5a99624074d56f8eea26699496f0e8dc41cbf3fb
Author: Nguyen Anh Quynh <[email protected]>
Date:   Tue Feb 26 15:19:51 2019 +0800

    sync with LLVM 7.0.1. X86 is first

@XVilka XVilka mentioned this issue Jul 10, 2023
24 tasks
@momo5502
Copy link

I'm in need for a fix for this issue. Usually I would try to contibute a fix myself, however I currently lack the time. So I want to at least bump this issue :D

@Rot127
Copy link
Collaborator

Rot127 commented Jan 3, 2024

LLVM 18 disassembles without 1:

echo "0xd1,0x10" | llvm-mc-18 --disassemble --arch=x86 --show-encoding --output-asm-variant=1
	.text
	rcl	dword ptr [eax]                 # encoding: [0xd1,0x10]

Please check what is the correct syntax and open an issue with the LLVM-project.

@Rot127 Rot127 added this to the v5.0.2 milestone Mar 19, 2024
@Rot127 Rot127 added the X86 Arch label Mar 20, 2024
@Rot127
Copy link
Collaborator

Rot127 commented Mar 20, 2024

@wargio Can you please check against llvm-mc?

@wargio
Copy link
Contributor Author

wargio commented Mar 20, 2024

According to the ISA, that 1 should be there. https://c9x.me/x86/html/file_module_x86_id_273.html
so it is likely a regression of llvm or a decision taken to remove that field for one bit rotation.

@Rot127 Rot127 added the bug label Mar 20, 2024
Rot127 added a commit to Rot127/capstone that referenced this issue Apr 24, 2024
Rot127 added a commit to Rot127/capstone that referenced this issue Apr 24, 2024
Rot127 added a commit to Rot127/capstone that referenced this issue Apr 24, 2024
Rot127 added a commit to Rot127/capstone that referenced this issue Apr 24, 2024
Rot127 added a commit to Rot127/capstone that referenced this issue Apr 26, 2024
Rot127 added a commit to Rot127/capstone that referenced this issue Apr 26, 2024
@kabeor kabeor closed this as completed in b2d5b43 Apr 30, 2024
kabeor pushed a commit that referenced this issue Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants