How to use the reil.native.Instruction 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 / translator.py View on Github external
def translate(code_bytes, base_address, thumb=False):
    done = False

    if thumb:
        ctx = ThumbTranslationContext()
    else:
        ctx = ArmTranslationContext()

    for i in ctx.disassembler.disasm(code_bytes, base_address):

        if done:
            raise StopIteration()

        mnemonic = '{} {}'.format(i.mnemonic, i.op_str)
        yield native.Instruction(
            i.address, mnemonic, _translate(ctx, i),
            ends_basic_block(i), i.size)

        if ends_basic_block(i):
            done = True
github c01db33f / reil / x86 / translator.py View on Github external
ctx = _x86_64_ctx
            else:
                ctx = _x86_64_rip_ctx
    else:
        if threadsafe:
            ctx = X86TranslationContext()
        else:
            ctx = _x86_ctx

    for i in ctx.disassembler.disasm(code_bytes, base_address):

        if done:
            raise StopIteration()

        mnemonic = '{} {}'.format(i.mnemonic, i.op_str)
        yield native.Instruction(
            i.address, mnemonic, _translate(ctx, i),
            ends_basic_block(i), i.size)

        if ends_basic_block(i):
            done = True
github c01db33f / reil / arm64 / translator.py View on Github external
def translate(code_bytes, base_address):
    done = False
    ctx = Arm64TranslationContext()

    for i in ctx.disassembler.disasm(code_bytes, base_address):

        if done:
            raise StopIteration()

        mnemonic = '{} {}'.format(i.mnemonic, i.op_str)
        yield native.Instruction(
            i.address, mnemonic, _translate(ctx, i),
            ends_basic_block(i), i.size)

        if ends_basic_block(i):
            done = True