Skip to content

Can't encode an invalid instruction : 0x40000C (bad) #588

@Alleexxi

Description

@Alleexxi

Hello! I'm encountering an issue while assembling the decoded executable. For testing purposes, I'm using a simple Hello World program, and when I attempt to assemble it, I get the following error:

IcedError { error: "Can't encode an invalid instruction : 0x40000C (bad)" }

This is my code:

fn disassemble_exe(exe_bytes: &[u8]) -> Vec<u8> {
    let mut decoder = Decoder::with_ip(64, exe_bytes, 0x00400000, DecoderOptions::NONE);
    let mut assembler = CodeAssembler::new(64).unwrap();

    while decoder.can_decode() {
        assembler.add_instruction(decoder.decode()).unwrap();
    }

    let result = assembler.assemble(0x00400000).unwrap();
    result
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions