Fast and lightweight x86/x86-64 disassembler and code generation library.
- Optimized for high performance, runs almost as fast as native Zydis
- No dependencies on Cgo
- Thread-safe by design
- Very small file-size overhead compared to other common disassembler libraries
- Supports all x86 and x86-64 (AMD64) instructions
The following example program uses Zydis to disassemble a given memory buffer and prints the output to the console.
zydis-go/examples/disasm-simple/main.go
Lines 12 to 42 in 229b8bb
The above example program generates the following output:
007FFFFFFF400000 push rcx
007FFFFFFF400001 lea eax, [rbp-0x01]
007FFFFFFF400004 push rax
007FFFFFFF400005 push [rbp+0x0C]
007FFFFFFF400008 push [rbp+0x08]
007FFFFFFF40000B call [0x008000007588A5B1]
007FFFFFFF400011 test eax, eax
007FFFFFFF400013 js 0x007FFFFFFF42DB15
zydis-go/examples/encode-simple/main.go
Lines 11 to 32 in 229b8bb
The above example program generates the following output:
48 C7 C0 37 13 00 00
More examples can be found in the examples directory of this repository.
Simply get the package using go get
:
go get -u github.com/zyantific/zydis-go
If you are not on Windows AMD64
or Linux AMD64
, you need to build the Zydis library for your platform and place the shared library nearby your executable. You can find the instructions for building the Zydis library here.
zydis-go is licensed under the MIT license, Zydis's license also applies under the same terms. See LICENSE.md for more information.