How to use the reil.x86.conditional 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 / x86 / control_flow.py View on Github external
def conditional_jump(ctx, i, condition):
    c = conditional.condition(ctx, condition)
    dst = operand.get(ctx, i, 0)

    ctx.emit(  jcc_   (c, dst))
github c01db33f / reil / x86 / memory.py View on Github external
def conditional_mov(ctx, i, condition):
    c = conditional.condition(ctx, condition)

    value = None

    if len(i.operands) == 1:
        # source is the accumulator
        value = ctx.accumulator
    else:
        value = operand.get(ctx, i, 1)

    ctx.emit(  jcc_  (c, 'do_mov'))
    ctx.emit(  jcc_  (imm(1, 8), 'done'))

    ctx.emit('do_mov')
    operand.set(ctx, i, 0, value, clear=True)

    ctx.emit('done')
github c01db33f / reil / x86 / misc.py View on Github external
def conditional_set(ctx, i, condition):
    c = conditional.condition(ctx, condition)
    operand.set(ctx, i, 0, c)
github c01db33f / reil / x86 / control_flow.py View on Github external
def x86_jo(ctx, i):
    """jump if overflow"""
    conditional_jump(ctx, i, conditional.O)
github c01db33f / reil / x86 / misc.py View on Github external
def x86_setno(ctx, i):
    """set if not overflow"""
    conditional_set(ctx, i, conditional.NO)
github c01db33f / reil / x86 / memory.py View on Github external
def x86_cmovl(ctx, i):
    """mov if less"""
    conditional_mov(ctx, i, conditional.L)