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

PPC DCB instructions disassembled incorrectly #4845

Open
psifertex opened this issue Dec 22, 2023 · 3 comments
Open

PPC DCB instructions disassembled incorrectly #4845

psifertex opened this issue Dec 22, 2023 · 3 comments
Assignees
Labels
Arch: PowerPC Issues with the PowerPC architecture plugin Component: Architecture Issue needs changes to an architecture plugin Effort: Trivial Issue should take < 1 day Impact: Low Issue is a papercut or has a good, supported workaround Type: Bug Issue is a non-crashing bug with repro steps

Comments

@psifertex
Copy link
Member

From a slack report:

It's a very low impact bug since it's strictly visual, but for the PPC disassembly (which I believe rides on top of capstone?) the disassembly text for dcbf and dcbz instructions gets a bit mangled.

For example, the opcode 7c 00 00 ac should disassemble as dcbf 0, r0 but the disassembly text shows as dcbf , r0
Checking with capstone outside of binja, the output is correct, which leads me to believe this is an issue within binja itself.

@psifertex psifertex added Type: Bug Issue is a non-crashing bug with repro steps Arch: PowerPC Issues with the PowerPC architecture plugin Impact: Low Issue is a papercut or has a good, supported workaround Effort: Trivial Issue should take < 1 day labels Dec 22, 2023
@lwerdna lwerdna self-assigned this Jan 30, 2024
@fuzyll fuzyll added the Component: Architecture Issue needs changes to an architecture plugin label Mar 26, 2024
@Rot127
Copy link

Rot127 commented Mar 29, 2024

This is fixed in the next and future v6 release:

./cstool -d ppc64be "7c 00 00 ac"
 0  7c 00 00 ac  dcbf	0, r0
	ID: 8 (dcbf)
	op_count: 1
		operands[0].type: MEM
			operands[0].mem.base: REG = 0
			operands[0].mem.offset: REG = r0
		operands[0].access: READ

We cannot give a date yet for the v6 release. But we highly recommend to use the next branch if you can. It provides enormously better disassembly for PPC, ARM, AArch64.
Also see the release guide.

@Rot127
Copy link

Rot127 commented Mar 29, 2024

Unfortunately, I don't have time currently to check it myself, but the instructions in: #3983 #3989 #4023 #3968 are probably fixed in next as well.

@galenbwill galenbwill self-assigned this Mar 29, 2024
@XVilka
Copy link

XVilka commented Mar 29, 2024

By the way, if you are curious about details of the long-running auto-sync project that will be a part of Capstone 6.0, @Rot127 wrote a blog post about why, how, and what was done to modernize Capstone: Auto-Sync - Generating disassembler plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: PowerPC Issues with the PowerPC architecture plugin Component: Architecture Issue needs changes to an architecture plugin Effort: Trivial Issue should take < 1 day Impact: Low Issue is a papercut or has a good, supported workaround Type: Bug Issue is a non-crashing bug with repro steps
Projects
None yet
Development

No branches or pull requests

6 participants