-
Notifications
You must be signed in to change notification settings - Fork 6
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
Updating Zydis-Pascal to the latest Zydis version #2
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks a lot for your work! I've not been using Delphi/Pascal for a while and definitely would not have been able to design the updated bindings in such a nice and compatible way.
I left a few (rather minor) comments and suggestions 🙂
#### Dynamic | ||
- Extract the `Zydis32.dll` or `Zydis64.dll` from the `Bin32`/`Bin64` folder to the directory that contains your application or install the library to your `C:\Windows\System32\` (64-bit) / `C:\Windows\SysWOW64\` (32-bit) directory | ||
- Enable the `{$DEFINE ZYDIS_DYNAMIC_LINK}` compiler-directive (enabled by default) in `Zydis.pas` | ||
|
||
#### Static | ||
- Extract the complete `Bin32`/`Bin64` folder to the root of the pascal bindings directory | ||
- Disable the `{$DEFINE ZYDIS_DYNAMIC_LINK}` compiler-directive in `Zydis.pas` |
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'm not a super huge fan of including binary files in a Git repository, but we can consider going that route, if we feel like this would lower the burden of using the bindings.
Anyways, I think that part of the readme should stay. At least the part about dynamic linking might be important to some users - regardless of whether we bundle the static binaries in the repo or not.
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 think Delphi is still mainly used on Windows, but I'm not sure how the situation is for FPC. It easily gets compilcated when we have to bundle a set of X86(_64) and ARM(64) binaries for different OSs like Windows, Linux, FreeBSD, etc. This was the original reason for not including the binaries in the repo.
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 think we could create a GitHub Actions release workflow that uses GCC or Clang to cross-compile Zydis for different target architectures and operating systems in different formats (.a
, .obj
, .dll
, ...).
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 agree that dynamic linking
is essential for many users.
For me, I only use Delphi for User Interface projects, but Pascal, I do use it for all platforms.
GitHub Actions release workflow would be great for auto-bundling Zydis binaries.
You are welcome ^_^, And thanks for your kind words. |
Move all Formatter types to it's own unit to use it for high-level implementation
Move all Decoder types to it's own unit to use it for high-level implementation
Move all Disassembler types to it's own unit to use it for high-level implementation
Tested on Windows And Linux - x64
Tested on Windows And Linux - x64
Tested on Windows And Linux - x64
Now, all examples are Delphi compatible. |
APIs - ZydisDecoderDecodeInstruction - ZydisDecoderDecodeOperands Types - TZydisDecoderContext
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.
Thanks again for all the work! This looks really good 🙂 Let me know when you feel like you are done for now. We can merge the PR and improve/complete it in some follow up PRs.
I’ll try to find some time to work on the GitHub Action to generate the binary files.
You can merge this pull request, and I'll open a new one for the other examples and updates. |
This work is still in progress.
I'm converting the code based on the examples ^_^
So, all structs and APIs converted are the ones that are needed for the examples to work.
I'll update this based on examples till I convert all of them, and then I will add any other needed APIs.