Skip to content

Cant encode using ZYDIS_ENCODABLE_BRANCH_TYPE_NEAR32 #266

@ZehMatt

Description

@ZehMatt
ZydisEncoderRequest req{};
req.mnemonic = ZYDIS_MNEMONIC_JMP;
req.branch_type = ZydisEncodableBranchType::ZYDIS_ENCODABLE_BRANCH_TYPE_NEAR32;
req.operand_count = 1;
req.operands[0].type = ZYDIS_OPERAND_TYPE_IMMEDIATE;
req.operands[0].imm.u = 0xFF;

When specifying NEAR32 I sort of expected it to encode jmp <rel32> considering 0xFF is in range but it appears I have to either specify ZYDIS_ENCODABLE_BRANCH_TYPE_NEAR64 or ZYDIS_ENCODABLE_BRANCH_TYPE_SHORT.

Also to my understanding there is no encoding variant that encodes 64 bit relative address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-encoderArea: EncoderC-bug-invalidCategory: Invalid bug reportC-enhancementCategory: Enhancement of existing featuresP-mediumPriority: Medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions