Skip to content

x86: cmc instruction is unsupported #531

@langston-barrett

Description

@langston-barrett
# clang -nostdlib -static -o magic magic.s
.intel_syntax noprefix
.global magic
.type magic, @function
magic:
    mov edx, edi
    xor eax, eax
    mov ecx, edx
    bswap ecx
    test cl, cl
    js .L_loop
    jmp .L_end

.L_loop:
    shr edx, 1
    cmc
    rcl eax, 1
    jno .L_loop
    add eax, 0x6AF6F607
    sete al

.L_end:
    ret
.size magic, .-magic
cabal run exe:macaw-x86-dump -- discover magic

-- snip --

translation error Unsupported instruction at 0x401010: II {iiLockPrefix = NoLockPrefix, iiAddrSize = Size64, iiOp = "cmc", iiArgs = [], iiPrefixes = Prefixes {_prLockPrefix = NoLockPrefix, _prSP = SegmentPrefix {unwrapSegmentPrefix = 0}, _prREX = 0b00000000, _prVEX = Nothing, _prASO = False, _prOSO = False, _prNoTrack = False}, iiRequiredPrefix = Nothing, iiOpcode = [245], iiRequiredMod = Nothing, iiRequiredReg = Nothing, iiRequiredRM = Nothing}

Program adapted from the binsec tutorial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions