Nada Bates-Brkljac

12 papers C 10Unranked 2
YearRankTypeTitle / Venue / Authors
2007 C conf
IV
Nada Bates-Brkljac
2006 C conf
CDVE
John Counsell, Steve Smith, Nada Bates-Brkljac
2006 C conf
IV
Nada Bates-Brkljac
2006 C conf
IV
John Counsell, Steve Smith, Nada Bates-Brkljac
2005 C conf
CDVE
Stefanie Dühr, Nada Bates-Brkljac, John Counsell
2005 C conf
IV
Nada Bates-Brkljac, Stefanie Dühr, John Counsell
2003 conf
DEXA Workshops
Nada Bates-Brkljac
2002 C conf
IV
Nada Bates-Brkljac
2001 conf
Virtual Reality, Archeology, and Cultural Heritage
Nada Bates-Brkljac
2000 C conf
IV
Nada Bates-Brkljac, John Counsell
1999 C conf
IV
John Counsell, Nada Bates-Brkljac
1999 C conf
IV
Nada Bates-Brkljac, John Counsell
redb/extractors/decompiler/bninja/analysis/low_level_normalization.py
← Index redb/extractors/decompiler/bninja/analysis/low_level_normalization.py python
from binaryninja import (
    ILRegister, ILRegisterStack, ILFlag,
    ILIntrinsic, ILSemanticFlagGroup,
)

class LowLevelNormalization:
    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 hasattr(op, "operation"):
                self._collect_ops(op, ops)
            elif isinstance(op, (list, tuple)):
                for sub in op:
                    if hasattr(sub, "operation"):
                        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, ILRegister):
            return "REG"
        if isinstance(val, ILRegisterStack):
            return "REG_STACK"
        if isinstance(val, ILFlag):
            return "FLAG"
        if isinstance(val, ILSemanticFlagGroup):
            return "FLAG_GROUP"
        if isinstance(val, ILIntrinsic):
            return "INTRINSIC"
        if isinstance(val, bool):
            return "BOOL"
        if isinstance(val, int):
            return "CONST"
        return type(val).__name__.upper()

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

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