Skip to content

'subtracted' flag is set incorrectly #695

Closed
@vnd

Description

@vnd

0xe1f200b2 (ldrh r0, [r2, #2]! in ARMv7) is decoded as:

Insn {
    address: 1614951176,
    size: 4,
    mnemonic: Some(
        "ldrh"
    ),
    op_str: Some(
        "r0, [r2, #2]!"
    )
}
ARMDetail {
    usermode: false,
    vector_size: 0,
    vector_data: 0,
    cps_mode: ARM_CPSMODE_INVALID,
    cps_flag: ARM_CPSFLAG_INVALID,
    cc: ARM_CC_AL,
    update_flags: false,
    writeback: true,
    mem_barrier: 0,
    op_count: 2,
    operands: [
        ARMOp {
            vector_index: -1,
            shift_type: 0,
            shift_value: 0,
            ty: ARM_OP_REG,
            data: [
                66,
                0
            ],
            subtracted: false
        },
        ARMOp {
            vector_index: -1,
            shift_type: 0,
            shift_value: 0,
            ty: ARM_OP_MEM,
            data: [
                68,
                8589934593
            ],
            **subtracted: true**
        }
    ]
}

Data of the second operand is:

Mem(
    ARMOpMem {
        base: 68,
        index: 0,
        scale: 1,
        disp: 2
    }
)

(the above is an output from Rust wrapper around capstone but I've checked it via plain C program as well)

'subtracted' for the second operands seems to be set incorrectly.

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