-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Migrate from Capstone to Zydis (x86 architecture) #4832
base: dev
Are you sure you want to change the base?
Conversation
Changes in the tests/code :
|
Very well done. |
Please fix the compilation issues. see the CI jobs. also run clang format (via the python script) |
Yes, I did not get time yesterday. I will do it asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice job! Looks good so far.
Regarding the renaming:
I think it is better if you add a file which maps ZYDIS_
enums to the X86_
enums. Simply for readability and less changes.
Building:
Capstone can be built without any x86 code. You just have to remove -DCAPSTONE_HAS_X86
in subprojects/packagefiles/capstone-*/meson.build
. This also makes the binary way smaller.
cc @wargio
librz/arch/isa/x86/common.c
Outdated
[ZYDIS_REGISTER_RDI] = "rdi", | ||
[ZYDIS_REGISTER_RDX] = "rdx", | ||
[ZYDIS_REGISTER_RIP] = "rip", | ||
//[ZYDIS_REGISTER_RIZ] = "riz", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the unused code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am currently keeping some of the unused code because they might be required while resolving tests. Once that is done, I will get rid of the unused code.
Hello, I am working on these and I will commit the changes soon. |
Ouh, nice. Didn't know it uses Meson as well. Why is cc @wargio For what to do about updating meson. But bumping the version seems fine to me. I build with |
Seems like we need the old meson version for TinyCC and old debian builds. So it must be the patch then :( |
It customises the build process, doesn't overwrite it.
Okay, i will look into this. There are a few things that old version of meson doesn't have like |
dont diff patch. just create a folder with the patched files and define it in the wrap file. this will overwrite the files in the pulled folder. |
The latest version of Zydis (4.1.0) does not support meson build system so we cannot use a wrap-file. |
capstone does not support meson neither but we use meson anyway. just create a meson.build file in the patch dir and add the sources and defines. Examples: |
8854385
to
ed87201
Compare
@wargio So the current issue with the builds is that there is no Zycore dependency installed in Zydis by default. To do that, we would have to build Zycore inside Zydis using another meson.build file. |
Why not just add a folder with the wrap file of the dependency within the patch folder of zydis? Or if available just use a source which contains all the deps needed. This is quite common |
Agree with @wargio. Meson has (luckily) the ability to make subprojects depend on subprojects. |
ed87201
to
75ecbfd
Compare
Hello. So I tried building zycore inside zydis but I faced the following issues:
I think there must definitely be a solution but I cannot seem to get it due to my inexperience in meson build system. So I would really like some help in this direction. As of now, I have pushed the changes with amalgamated form of zydis. In the meanwhile, I resolved ~150 tests that were mostly formatting related. There are still ~70 tests that I need to review and debug code accordingly. I'm working on it. Thanks. Edit : I think I merged dev into my branch as well. Should I remove it? |
3e72d6c
to
187ebe4
Compare
edbe9fc
to
e04b29e
Compare
I have resolved ~700 tests and there are ~650 more to resolve. Most of them are simple I am also working on making a separate file with all For the appveyor fails, I think it is because the default setting uses dynamic linking instead of a static one, so I have to remove a flag while compiling. |
8d5b4d4
to
1ab01fd
Compare
1ab01fd
to
5c45b2a
Compare
The issue with appveyor builds was not related to dynamic linking, as by default, every dependency is built statically in rizin. The issue was with |
nice |
5c45b2a
to
f1fe51a
Compare
Is rz-bindgen failure related to this PR? |
Your checklist for this pull request
Detailed description
ZydisDecodedInstruction
andZydisDecodedOperand
instead ofcs_x86
andcs_x86_op
TODO in further commits :
lcall
,ljump
etc)analysis_x86
andasm_x86
filesTest plan
...
Closing issues
closes #4709
...