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

Switch to capstone 5.0 #3653

Merged
merged 10 commits into from
Jul 16, 2023
Merged

Switch to capstone 5.0 #3653

merged 10 commits into from
Jul 16, 2023

Conversation

wargio
Copy link
Member

@wargio wargio commented Jul 11, 2023

DO NOT SQUASH!!!

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

I have hand-verified all the instructions (encoding/decoding) using objdump

@wargio wargio changed the title Switch to capstone5 Switch to capstone 5.0 Jul 11, 2023
meson_options.txt Outdated Show resolved Hide resolved
@XVilka XVilka added this to the 0.6.0 milestone Jul 11, 2023
@github-actions github-actions bot added the PPC label Jul 12, 2023
XVilka

This comment was marked as resolved.

@XVilka XVilka requested a review from Rot127 July 12, 2023 13:08
@XVilka

This comment was marked as resolved.

@wargio
Copy link
Member Author

wargio commented Jul 12, 2023

no, is likely missing some enums.

@XVilka

This comment was marked as resolved.

test/db/analysis/ppc Outdated Show resolved Hide resolved
test/db/analysis/x86_32 Outdated Show resolved Hide resolved
test/db/analysis/x86_64 Outdated Show resolved Hide resolved
test/db/asm/x86_16 Outdated Show resolved Hide resolved
test/db/asm/x86_16 Outdated Show resolved Hide resolved
test/db/esil/arm_64 Outdated Show resolved Hide resolved
test/db/formats/mach0/imports Outdated Show resolved Hide resolved
test/db/formats/mach0/objc Outdated Show resolved Hide resolved
test/db/rzil/ppc32 Outdated Show resolved Hide resolved
test/db/tools/rz Outdated Show resolved Hide resolved
@XVilka

This comment was marked as resolved.

@Heersin

This comment was marked as resolved.

@wargio
Copy link
Member Author

wargio commented Jul 13, 2023

not existed in v3 ?

i added some stuff, and i forgot to add the compiler fences.

Copy link
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only looked at the PPC part but looks good to me. Although we should probably fix those bugs you mention in CS and make a v5.1. Actually no. Lets just push for v6 as much as possible. Please add the comments about the bugs for easier comprehension nonetheless.

librz/analysis/arch/ppc/ppc_il.c Show resolved Hide resolved
librz/analysis/arch/ppc/ppc_il_ops.c Show resolved Hide resolved
librz/analysis/arch/ppc/ppc_il_ops.c Show resolved Hide resolved
@Rot127
Copy link
Member

Rot127 commented Jul 14, 2023 via email

@wargio
Copy link
Member Author

wargio commented Jul 14, 2023

But, because of the missing operand, the disponent is treated as register here and can give a valid result, right?

According to the ISA, when 0 is actually 0, not R0

@wargio
Copy link
Member Author

wargio commented Jul 14, 2023

This is a test for one of those NULL cases.
e8000002 ppc32le lwa r0, 0(0)

@Rot127
Copy link
Member

Rot127 commented Jul 14, 2023 via email

@wargio
Copy link
Member Author

wargio commented Jul 14, 2023

lwa r0, 0(4) should be lwa r0, 0(r4) => e8040002
e9000012 => lwa r8, 0x10(0)

image

https://www.ibm.com/docs/en/aix/7.1?topic=set-lwa-load-word-algebraic-instruction

@Rot127
Copy link
Member

Rot127 commented Jul 15, 2023

@wargio Checked it on my machine. I was confused, so ignore my comments above. But thanks for making the effort to go into it.

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash some commits so that we have cleaner history and commit marks any test as BROKEN. See my other comments too. Except that is LGTM. Some of these numerous hacks will likely be gone once auto-sync PRs are merged.

librz/asm/p/asm_x86_cs.c Show resolved Hide resolved
test/db/analysis/x86_64 Show resolved Hide resolved
@XVilka XVilka mentioned this pull request Jul 15, 2023
5 tasks
Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once Woodpecker is fixed - it doesn't look like a caching issue. MacOS zeroes buffers on initialization, maybe it is the reason?

@XVilka
Copy link
Member

XVilka commented Jul 16, 2023

Opened an issue for this test here: #3658

@XVilka XVilka merged commit 99c5f83 into dev Jul 16, 2023
43 checks passed
@XVilka XVilka deleted the fuzz-capstone5 branch July 16, 2023 05:22
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.

7 participants