1209 Commits
Author SHA1 Message Date
dxbjavid 17bc6fb158 fix dropped leading zero in hex append at padding boundary 2026-06-04 10:56:40 +02:00
dxbjavid 2d9e9b3867 Formatter: resolve PADDING_AUTO for signed immediates in print_imm 2026-06-04 10:20:44 +02:00
dxbjavid 7bc04ecd4f compute rex.B node index with bitwise or 2026-06-04 09:58:31 +02:00
mappzor cb5f4040f6 Fixed mask handling for instructions without masks 2026-05-30 22:00:42 +02:00
dxbjavid 4a586d686b Formatter: drop redundant ATT PrintAddressABS wrapper 2026-05-30 20:37:27 +02:00
dxbjavid 2220fc0e8e att: emit indirect-branch '*' for all memory operand forms 2026-05-30 20:37:27 +02:00
dxbjavid 41011c6656 Decoder: mask base field in no-base test for uses_egpr 2026-05-29 23:35:42 +02:00
dxbjavid ebc2ccf6a2 att: apply case_mnemonic to size suffix in print_mnemonic 2026-05-29 21:34:43 +02:00
dxbjavid 1a5f13f203 Formatter: fix inverted post_operand status check 2026-05-29 21:34:36 +02:00
dxbjavid e9219ac916 Decoder: drop dead duplicate EVEX V4 check after assignment 2026-05-28 20:31:17 +02:00
dxbjavid ddc687df58 Encoder: byte-swap rip-rel patch on big endian 2026-05-28 19:57:54 +02:00
dxbjavidandClaude Opus 4.7 abaecd4a28 Decoder: fix uses_egpr for R20/R28 used as SIB index
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 08:39:34 +02:00
dxbjavid 291d6f3746 Decoder: remove dead IP_ASZ implicit-register type
No operand in the database uses ZYDIS_IMPLREG_TYPE_IP_ASZ, so the switch
case in ZydisDecodeOperandImplicitRegister is unreachable. Drop the type
and its handler; the IP_SSZ path keeps the existing EIP mapping.
2026-05-28 08:18:08 +02:00
dxbjavid b0499000ff Formatter: handle FAR/ABSOLUTE in print_branch_size switch 2026-05-25 21:33:48 +02:00
dxbjavid 50919902ce Decoder: handle R21/R21D in SIB no-base special case 2026-05-25 20:17:38 +02:00
dxbjavid 299facc420 FormatterATT: propagate status from mnemonic size suffix append 2026-05-23 19:28:15 +02:00
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
dxbjavid 7cc7e68483 FormatterBuffer: reject GetToken on non-token-list buffers
ZydisFormatterBufferGetToken unconditionally dereferences
`(ZydisFormatterTokenConst*)buffer->string.vector.data - 1`. When the
buffer was initialized for plain-string formatting (is_token_list ==
ZYAN_FALSE, as set up by ZydisFormatterBufferInit), no
ZydisFormatterToken header precedes the data pointer, so this read
goes two bytes before the user-provided output buffer.

Mirror the guard already present in ZydisFormatterBufferGetString and
return ZYAN_STATUS_INVALID_OPERATION up front when the buffer is not
a token list, so the function no longer reads (and reports back to
the caller a pointer into) memory outside the buffer.
2026-05-22 12:42:15 +02:00
dxbjavid 1935b44583 String: avoid double-append in ZydisStringAppendDecU on 32-bit hosts
On 32-bit targets, ZydisStringAppendDecU calls both the 64-bit and the
32-bit decimal append helpers when the input value has any of its upper
32 bits set, because the 32-bit fallback branch is missing the `else`
that the sibling ZydisStringAppendHexU has. This silently appends the
value twice (once correctly as a 64-bit decimal, once incorrectly as
the truncated low 32 bits) and consumes roughly twice the expected
buffer space, which can also turn into a spurious
ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE for callers that sized their
output buffer based on the documented decimal width.

Mirror the structure of ZydisStringAppendHexU by guarding the
ZydisStringAppendDecU32 fallback with `else` so exactly one of the
two helpers runs.
2026-05-22 12:40:45 +02:00
jmestwa-coder 6cf4b74a84 Decoder: copy offset/size from the matching raw immediate
ZydisDecodeOperands writes operands[i].imm.value/.is_signed/.is_address/
.is_relative from instruction->raw.imm[imm_id], but populated .offset
and .size via the bare `instruction->raw.imm->offset` / `->size`, which
always indexes element 0. For any instruction with two immediates (e.g.
ENTER imm16, imm8) the second decoded operand inherits the offset and
size of the first immediate.

Index both fields by imm_id to match the rest of the assignment block.
2026-05-22 12:40:35 +02:00
Florian Märkl 8d30eb37e1 Fix ZydisEmitUInt with size 1 on big endian
Even if only a single byte is copied, that byte will not be at the
lowest address of a ZyanU64 value, so a cast to ZyanU8 is still
necessary, only without a byte swap.
2026-05-15 15:50:21 +02:00
Zephyr Lykos 9bfadd6a55 build/meson: fix installing generated headers 2025-12-07 21:55:34 +01:00
mappzor cfd721bf9d Fixed SIB.base handling when ASIZE == 32 (Fixes #592) 2025-11-20 08:11:32 +01:00
0xTowel ae12a099a1 Update help message in CMakeLists.txt 2025-10-27 18:49:54 +01:00
mappzor 04793b1c8e Ignore unsupported properties when fuzzing 2025-09-16 03:11:07 +02:00
mappzor 215481566f Optimized operand definitions 2025-09-16 03:11:07 +02:00
mappzor eb0915270a Fixes for MIB operands and jmpabs 2025-09-16 03:11:07 +02:00
Florian Bernd 754eea6f2f Switch to new generator and decoder tree representation 2025-09-16 03:11:07 +02:00
mappzor f2ad85f92f Improved LibFuzzer support on Windows 2025-07-26 01:52:11 +02:00
mappzor c2d2bab025 Disallow EGPR as VSIB.base for VEX instructions (#579) 2025-07-19 08:13:28 +02:00
Frédéric Recoules 42138fa447 Fix ATT Formatter VSIB extra operand-size suffix (#550) 2025-07-16 20:57:01 +02:00
Zephyr Lykos 3278c86aa6 Bump version number to 5.0.0 (#546)
* Bump version number to 5.0.0

Since we already introduced breaking API changes, so there should be
a way to detect those changes for users.

* Remove type cast in VERSION macros

Allows preprocesser #if statements to use version macros.

* ci: fix meson minimal build
2025-07-16 20:40:32 +02:00
Florian Bernd 2519003ee5 Add APX ISA extension (#450) 2025-07-16 20:39:30 +02:00
Alcaro 48e7506503 Formatter.h: Fix padd typo 2025-06-11 17:51:48 +02:00
Zephyr Lykos a02b741ff3 build/meson: install generated headers (#574) 2025-06-10 17:59:55 +02:00
Zephyr Lykos ff2b17a1d9 build/meson: do not symlink subprojects -> dependencies
https://github.com/zyantific/zydis/pull/547#issuecomment-2664252256
2025-06-10 17:59:55 +02:00
tushar3q34 6372690e30 update zydis with width macros 2025-05-25 08:09:36 +02:00
mappzor 80a9c0137a Big endian support (Fixes #567) 2025-05-21 00:59:21 +02:00
StackOverflowExcept1on 201ca6cf6b chore: bump min cmake version to 3.10 (#569)
* chore: bump min cmake version to 3.10

* update submodule
2025-05-06 14:18:33 +02:00
mappzor 120e0e705f Fixed xchg aliasing (Fixes #560) 2025-03-23 17:38:31 +01:00
mappzor bffbb610cf Updated zydis_encoder_types.py (#531) 2024-11-08 21:20:57 +01:00
Zephyr Lykos 9d298eb806 Add meson build system support (#525) 2024-10-06 18:16:40 +02:00
Jérôme Duval bd73bc03b0 Haiku: fix build for ZydisPerfTest.c (#517) 2024-08-06 16:08:03 +02:00
waddlesplash af792c439a Utils: Handle OPERAND_TYPE_REGISTER in ZydisCalcAbsoluteAddressEx (#520) 2024-08-06 13:27:36 +02:00
Joel Höner 16c6a369c1 CMake: don't unconditionally compile Segment.{h,c} (#516) 2024-07-10 20:33:50 +02:00
$_9 5a68f639e4 Fix zydis not compiling under -Werror (#507) 2024-06-02 15:23:23 +02:00
Kai Pastor 6bedd6c588 Use alias targets (#508) 2024-06-02 10:44:20 +02:00
Florian Bernd fd3e9a6cc8 Add FRED ISA extension (#502) 2024-05-14 13:17:40 +02:00
Clayton 72ec802cbb Fix issue with llvm-rc when ZYDIS_BUILD_SHARED_LIB is enabled (#500)
* Fix issue with `llvm-rc` when `ZYDIS_BUILD_SHARED_LIB` is enabled
* Bump zycore submodule
2024-04-16 12:50:13 +02:00
Joel Höner d347321ba0 Decoder: add missing underscore for ZydisDecodedInstructionRawEvex 2024-04-08 02:55:52 +02:00