Updating Zydis-Pascal to the latest Zydis version#2
Updating Zydis-Pascal to the latest Zydis version#2Coldzer0 wants to merge 35 commits intozyantific:masterfrom
Conversation
flobernd
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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
flobernd
left a comment
There was a problem hiding this comment.
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.