Skip to content

Add flag for the SoftFail case of the LLVM disassembler. #2707

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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Rot127
Copy link
Collaborator

@Rot127 Rot127 commented May 21, 2025

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

The LLVM disassembler returns SoftFail if the instruction can be decoded, but it is illegal due to other reasons.

E.g. because it uses operands it is not allowed to use or the instructions is invalid in a given context.

New cstool output:

cstool arm "0xf0, 0x00, 0xf0, 0xe7, 0x07, 0xB0, 0xBD, 0xE8, 0xf0, 0x00, 0xf0, 0xe7"
 0  f0 00 f0 e7  udf	#0
 4  07 b0 bd e8  pop	{r0, r1, r2, r12, sp, pc}	; Illegal instruction
 8  f0 00 f0 e7  udf	#0

Test plan

Added.

I didn't went through the trouble looking up a SoftFail case for each architecture.
But added the instructions from the issues and null-hypothesis test cases.

Can't reproduce the instruction sequence from #1991. No idea what I did there. But it is not added as use case.

Closing issues

closes #2703
closes #1991

@Rot127
Copy link
Collaborator Author

Rot127 commented May 21, 2025

cc @Rosayxy

The LLVM disassembler returns SoftFail if the instruction
can be decoded, but it is illegal due to other reasons.

E.g. because it uses operands it is not allowed to use
or the instrucion is invalid in a given context.
@Rosayxy
Copy link

Rosayxy commented May 23, 2025

I checked the instruction, it works as expected. Seems great!

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

Successfully merging this pull request may close these issues.

Illegal pop instruction disassembly in arm32 [ARM] Point out if decoding SoftFails
2 participants