Skip to content

ARM BE8 cannot be lifted: instruction and data endianness are not separable #565

Description

@zardus

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

ARM BE8 objects decode as garbage, because instruction endianness and data endianness cannot currently be set independently. Measured against the binaries' own symbol tables across a large corpus, this is 10 objects and 706 function symbols with no block at their entry.

In BE8, data is big-endian but instructions are stored little-endian. CLE does not read EF_ARM_BE8, and ArchARM with memory_endness big means BE32, so instruction words are fetched byte-swapped and almost nothing lifts.

The awkward part is below archinfo. libVEX's ARM front end fetches instruction words through the same endness the guest state uses — guest_arm_toIR.c reads them with getUInt under archinfo->endness — so a single VexEndness drives both, and there is no knob to split them. pyvex already defines ARCH_ARM_BE_LE for exactly this case, but nothing selects it and libVEX has no corresponding mode.

So the options seem to be a libVEX change that separates instruction fetch endianness from data endianness, a pyvex-level pre-swap of instruction words before lifting, or leaving BE8 unsupported but detected, so CLE reports it rather than producing an empty CFG.

Any ARMv7 big-endian toolchain reproduces it: BE8 is the default for big-endian ARMv7, and the resulting binary has EF_ARM_BE8 set in e_flags.

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