Jacky S. L. Ting

15 papers Journal 15
YearRankTypeTitle / Venue / Authors
2017 J jnl
Int. J. RF Technol. Res. Appl.
Jacky S. L. Ting, Albert H. C. Tsang
2015 J jnl
Enterp. Inf. Syst.
Jacky S. L. Ting, Andrew W. H. Ip
2014 J jnl
Inf. Syst. Frontiers
Benny C. F. Cheung, Jacky S. L. Ting, Albert H. C. Tsang, Wing Bun Lee
2013 J jnl
Comput. Ind.
Jacky S. L. Ting, Albert H. C. Tsang
2013 J jnl
J. Medical Syst.
Jacky S. L. Ting, Eric Wing Kuen See-To, Ying Kei Tse
2012 J jnl
J. Syst. Inf. Technol.
Jacky S. L. Ting, W. H. Ip, Albert H. C. Tsang, George T. S. Ho
2011 J jnl
Knowl. Based Syst.
Jacky S. L. Ting, S. K. Kwok, Albert H. C. Tsang, Wing Bun Lee
2011 J jnl
J. Medical Syst.
Jacky S. L. Ting, S. K. Kwok, Albert H. C. Tsang, Wing Bun Lee
2011 J jnl
J. Medical Syst.
Jacky S. L. Ting, S. K. Kwok, Albert H. C. Tsang, Wing Bun Lee, K. F. Yee
2011 J jnl
Ind. Manag. Data Syst.
Jacky S. L. Ting, Wai Ming Wang, Ying Kei Tse, W. H. Ip
2010 J jnl
Ind. Manag. Data Syst.
S. K. Kwok, Jacky S. L. Ting, Albert H. C. Tsang, Benny C. F. Cheung
2010 J jnl
Expert Syst. Appl.
Jacky S. L. Ting, S. K. Kwok, Albert H. C. Tsang, Wing Bun Lee
2010 J jnl
Comput. Ind.
S. K. Kwok, Jacky S. L. Ting, Albert H. C. Tsang, Wing Bun Lee, Benny C. F. Cheung
2010 J jnl
Expert Syst. Appl.
Jacky S. L. Ting, Wai Ming Wang, S. K. Kwok, Albert H. C. Tsang, Wing Bun Lee
2009 J jnl
J. Softw. Eng. Appl.
Jacky S. L. Ting, C. C. Shum, S. K. Kwok, Albert H. C. Tsang, Wing Bun Lee
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