Files
Alexander Nasonov 938b5158fd Fix ZydisPerfTest on NetBSD.
Do a bare minimum to fix the build. Don't try to use cpuset API
and pthread_setaffinity_np() because they require super-user
privileges (or setting security.models.extensions.user_set_cpu_affinity).

Relevant link: https://man.netbsd.org/NetBSD-10.1/affinity.3
2026-05-22 13:11:55 +02:00
..
2021-11-09 01:16:09 +01:00
2026-05-22 13:11:55 +02:00

Zydis Examples

Decoder

We currently don't have any examples that specifically only demonstrate using the decoder, but all formatter examples also demonstrate decoding instructions. Additionally, the ZydisInfo.c and ZydisDisasm.c examples in the tools directory serve as additional examples for both decoding and formatting.

Formatter

Formatter01

Demonstrates basic hooking functionality of the ZydisFormatter class by implementing a custom symbol-resolver.

Formatter02

Demonstrates basic hooking functionality of the ZydisFormatter class and the ability to completely omit specific operands.

The example demonstrates the hooking functionality of the ZydisFormatter class by rewriting the mnemonics of (V)CMPPS and (V)CMPPD to their corresponding alias-forms (based on the condition encoded in the immediate operand).

Formatter03

Demonstrates the tokenizing feature of the ZydisFormatter class.

Encoder

EncodeFromScratch

Example assembling a basic function returning 0x1337 in rax from scratch.

RewriteCode

Demonstrates how to rewrite ("reassemble") instructions.

Misc

ZydisWinKernel

Implements an example Windows kernel-mode driver.