How to use the reil.arm.operand.get function in reil

To help you get started, we’ve selected a few reil examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github c01db33f / reil / arm / memory.py View on Github external
def arm_push(ctx, i):
    for op in i.operands:
        value = operand.get(ctx, i, 0)

        ctx.emit(  sub_  (ctx.stack_ptr,
                          imm(ctx.word_size // 8, ctx.word_size),
                          ctx.stack_ptr))

        if value.size != ctx.word_size:
            prev_value = value
            value = ctx.tmp(ctx.word_size)
            ctx.emit(  sex_  (prev_value, value))

        ctx.emit(  stm_  (value, ctx.stack_ptr))
github c01db33f / reil / arm / memory.py View on Github external
def arm_movt(ctx, i):
    # first extract the low 16 bits of the destination
    prev_value = operand.get(ctx, i, 0)
    value = ctx.tmp(ctx.word_size)

    ctx.emit(  and_  (prev_value, imm(mask(16), 32), value))

    # then compute the high 16 bits
    prev_result = operand.get(ctx, i, 1)
    result = ctx.tmp(ctx.word_size)

    ctx.emit(  str_  (prev_result, result))
    ctx.emit(  lshl_ (result, imm(16, 32), result))

    ctx.emit(  or_   (value, result, result))

    if i.update_flags:
        set_N(ctx, result)
        set_Z(ctx, result)
github c01db33f / reil / arm / arithmetic.py View on Github external
def arm_sub(ctx, i):
    a = operand.get(ctx, i, 0)
    b = operand.get(ctx, i, 1)
    
    print i.update_flags
    
    print dir(i)