Wang-Dauh Tseng

21 papers Journal 11Unranked 10
YearRankTypeTitle / Venue / Authors
2021 J jnl
J. Electron. Test.
Wang-Dauh Tseng
2019 J jnl
J. Inf. Sci. Eng.
Jen-Cheng Ying, Wang-Dauh Tseng, Wen-Jiin Tsai
2018 J jnl
Integr.
Jen-Cheng Ying, Wang-Dauh Tseng, Wen-Jiin Tsai
2018 conf
DSC
Jen-Cheng Ying, Wang-Dauh Tseng, Wen-Jiin Tsai
2012 J jnl
IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.
Lung-Jen Lee, Wang-Dauh Tseng, Rung-Bin Lin, Cheng-Ho Chang
2012 conf
MTV
Lung-Jen Lee, Chia-Cheng He, Wang-Dauh Tseng
2012 conf
MTV
Lung-Jen Lee, Wang-Dauh Tseng, Wen-Ting Yang
2012 conf
MTV
Lung-Jen Lee, Wang-Dauh Tseng, Wei-Shun Chen
2010 J jnl
IET Comput. Digit. Tech.
Wang-Dauh Tseng, Lung-Jen Lee, Rung-Bin Lin
2010 J jnl
J. Electron. Test.
Wang-Dauh Tseng, Lung-Jen Lee
2009 conf
Asian Test Symposium
Lung-Jen Lee, Wang-Dauh Tseng, Rung-Bin Lin, Chen-Lun Lee
2009 conf
Asian Test Symposium
Lung-Jen Lee, Wang-Dauh Tseng, Rung-Bin Lin, Chi-Wei Yu
2008 J jnl
IEICE Trans. Electron.
Lung-Jen Lee, Wang-Dauh Tseng, Rung-Bin Lin
2007 J jnl
Photonic Netw. Commun.
I-Shyan Hwang, Ren-Yuan Cheng, Wang-Dauh Tseng
2007 J jnl
J. Electron. Test.
Wang-Dauh Tseng
2007 conf
MTV
Wang-Dauh Tseng, Lung-Jen Lee
2006 J jnl
Comput. Commun.
I-Shyan Hwang, Meng-Yuan Tu, Wang-Dauh Tseng, Zen-Der Shyu
2002 conf
APCCAS (1)
Shuenn-Shi Chen, Wang-Dauh Tseng, Jin-Tai Yan, Sao-Jie Chen
1999 J jnl
IEEE Trans. Very Large Scale Integr. Syst.
Wang-Dauh Tseng, Kuochen Wang
1997 conf
ASP-DAC
Wang-Dauh Tseng, Kuochen Wang
1996 conf
Asian Test Symposium
Wang-Dauh Tseng, Kuochen Wang
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