How to use the reil.x86.conditional.condition 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 x86_loope(ctx, i):
    c = conditional.condition(ctx, conditional.E)
    dst = operand.get(ctx, i, 0)

    tmp0 = ctx.tmp(8)

    ctx.emit(  sub_  (ctx.counter, imm(1, ctx.counter.size), ctx.counter))
    ctx.emit(  equ_  (ctx.counter, imm(0, ctx.counter.size), tmp0))
    ctx.emit(  or_   (c, tmp0, c))
    ctx.emit(  jcc_  (c, dst))
github c01db33f / reil / x86 / control_flow.py View on Github external
def x86_loopne(ctx, i):
    c = conditional.condition(ctx, conditional.NE)
    dst = operand.get(ctx, i, 0)

    tmp0 = ctx.tmp(8)

    ctx.emit(  sub_  (ctx.counter, imm(1, ctx.counter.size), ctx.counter))
    ctx.emit(  equ_  (ctx.counter, imm(0, ctx.counter.size), tmp0))
    ctx.emit(  or_   (c, tmp0, c))
    ctx.emit(  jcc_  (c, dst))