Karl Gerlach

19 papers Misc 1Journal 18
YearRankTypeTitle / Venue / Authors
2011 J jnl
IEEE Trans. Aerosp. Electron. Syst.
Shannon D. Blunt, Tszping Chan, Karl Gerlach
2011 J jnl
IEEE Trans. Aerosp. Electron. Syst.
Karl Gerlach, Michael L. Picciolo
2011 J jnl
IEEE Trans. Aerosp. Electron. Syst.
Karl Gerlach, Michael R. Frey, Michael J. Steiner, Aaron K. Shackelford
2007 J jnl
J. Sel. Topics Signal Processing
Karl Gerlach, Aaron K. Shackelford, Shannon D. Blunt
2007 J jnl
Digit. Signal Process.
Karl Gerlach, Shannon D. Blunt
2005 J jnl
Digit. Signal Process.
Karl Gerlach, Michael R. Frey
2004 J jnl
Signal Process.
Muralidhar Rangaswamy, Freeman C. Lin, Karl Gerlach
2004 J jnl
Digit. Signal Process.
Karl Gerlach
2002 J jnl
Signal Process.
Michael R. Frey, Karl Gerlach
2002 J jnl
Quantum Inf. Comput.
Robert Lockhart, Michael J. Steiner, Karl Gerlach
2000 J jnl
IEEE Trans. Signal Process.
Karl Gerlach, Michael J. Steiner
2000 J jnl
IEEE Trans. Aerosp. Electron. Syst.
Michael J. Steiner, Karl Gerlach
2000 Misc conf
ICASSP
Karl Gerlach, Michael R. Frey
1999 J jnl
IEEE Trans. Signal Process.
Karl Gerlach, Michael J. Steiner
1997 J jnl
IEEE Trans. Signal Process.
Karl Gerlach, Michael J. Steiner
1997 J jnl
IEEE Signal Process. Lett.
Karl Gerlach, Michael J. Steiner, Freeman C. Lin
1995 J jnl
IEEE Trans. Signal Process.
Karl Gerlach
1994 J jnl
IEEE Trans. Inf. Theory
Karl Gerlach, Kevin J. Sangston
1993 J jnl
IEEE Trans. Inf. Theory
Karl Gerlach, Kevin J. Sangston
redb/extractors/decompiler/bninja/analysis/medium_level_normalization.py
← Index redb/extractors/decompiler/bninja/analysis/medium_level_normalization.py python
from binaryninja import (
    MediumLevelILInstruction,
    Variable, SSAVariable,
    ILIntrinsic,
)


class MediumLevelNormalization:
    def __init__(self):
        return

    def _collect_ops(self, il, ops):
        if il is None:
            return
        ops.append(int(il.operation))
        operands = getattr(il, "operands", None)
        if not operands:
            return
        for op in operands:
            if isinstance(op, MediumLevelILInstruction):
                self._collect_ops(op, ops)
            elif isinstance(op, (list, tuple)):
                for sub in op:
                    if isinstance(sub, MediumLevelILInstruction):
                        self._collect_ops(sub, ops)

    def normalize_instruction_all_levels(self, instr_il):
        ops = []
        self._collect_ops(instr_il, ops)
        return ops

    def _leaf_type(self, val):
        if isinstance(val, SSAVariable):
            return "SSA_VAR"
        if isinstance(val, Variable):
            return "VAR"
        if isinstance(val, ILIntrinsic):
            return "INTRINSIC"
        if isinstance(val, bool):
            return "BOOL"
        if isinstance(val, float):
            return "FLOAT_CONST"
        if isinstance(val, int):
            return "CONST"
        if isinstance(val, str):
            return "STR"
        return type(val).__name__.upper()

    def _collect(self, il, out_op):
        if il is None:
            return
        out_op.append(int(il.operation))
        operands = getattr(il, "operands", None)
        if not operands:
            return
        for op in operands:
            if isinstance(op, MediumLevelILInstruction):
                self._collect(op, out_op)
            elif isinstance(op, (list, tuple)):
                for sub in op:
                    if isinstance(sub, MediumLevelILInstruction):
                        self._collect(sub, out_op)
                    else:
                        out_op.append(self._leaf_type(sub))
            else:
                out_op.append(self._leaf_type(op))

    def normalize_instr_with_operands(self, instr_il):
        ops = []
        self._collect(instr_il, ops)
        return ops