Skip to content

support 16-bit X86 #223

@tomsons26

Description

@tomsons26

By doing these hacks in src/arch/x86.rs it's possible to load a 16 bit coff and it correctly disassembles
in
Decoder::with_ip(
change Architecture::X86 => 32, to Architecture::X86 => 16,

in
Architecture::X86 => match flags {
add

                RelocationFlags::Coff(pe::IMAGE_REL_I386_DIR16 | pe::IMAGE_REL_I386_REL16) => {
                    let data = 
                        section.data()?[address as usize..address as usize + 2].try_into()?;
                    Ok(self.endianness.read_i16_bytes(data) as i64)
                }

Proper 16 bit support would be much better of course
A setback seems that object module assumes X86 is 32 bit and doesn't reserve a 16-bit Architecture

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions