Esempio n. 1
0
        public EHBlockNode AddNewFault()
        {
            EHBlockNode node = NewNode();

            faultNodes.Add(node);
            return(node);
        }
Esempio n. 2
0
        private EHBlockNode NewNode()
        {
            EHBlockNode node = new EHBlockNode();

            node.EncloseBlock = this;
            return(node);
        }
Esempio n. 3
0
        public EHBlockNode AddNewFilter()
        {
            EHBlockNode node = NewNode();

            filterNodes.Add(node);
            return(node);
        }
Esempio n. 4
0
        public EHBlockNode AddNewFinally()
        {
            EHBlockNode node = NewNode();

            finallyNodes.Add(node);
            return(node);
        }
Esempio n. 5
0
        public EHBlockNode AddNewCatch()
        {
            EHBlockNode node = NewNode();

            catchNodes.Add(node);
            return(node);
        }
Esempio n. 6
0
 public EHBlockNode Find(long label)
 {
     if (scopeEnd > scopeStart && (label < scopeStart || label > scopeEnd))
     {
         return(null);
     }
     foreach (EHBlock block in ehBlocks)
     {
         EHBlockNode n = block.Find(label);
         if (n != null)
         {
             return(n);
         }
     }
     return(this);
 }
Esempio n. 7
0
        public EHBlockNode Find(long label)
        {
            EHBlockNode n = tryNode.Find(label);

            if (n != null)
            {
                return(n);
            }
            foreach (EHBlockNode node in catchNodes)
            {
                n = tryNode.Find(label);
                if (n != null)
                {
                    return(n);
                }
            }
            foreach (EHBlockNode node in filterNodes)
            {
                n = tryNode.Find(label);
                if (n != null)
                {
                    return(n);
                }
            }
            foreach (EHBlockNode node in faultNodes)
            {
                n = tryNode.Find(label);
                if (n != null)
                {
                    return(n);
                }
            }
            foreach (EHBlockNode node in finallyNodes)
            {
                n = tryNode.Find(label);
                if (n != null)
                {
                    return(n);
                }
            }
            return(null);
        }
Esempio n. 8
0
        private string AdjustGoto(long srcLv, long _destLv, bool isDecompile)
        {
            string label  = null;
            long   destLv = _destLv;

            for (;;)
            {
                int    ix  = ilLines.Keys.IndexOf(destLv);
                IlIns  il  = ilLines.Values[ix];
                OpCode opc = IlOpcodes.Get(il.Opcode);
                if (opc == OpCodes.Br || opc == OpCodes.Br_S)
                {
                    label  = il.Value;
                    destLv = IlIns.LabelToValue(il.Value);
                }
                else
                {
                    break;
                }
            }
            EHBlockNode ns = rootEHNode.Find(srcLv);
            EHBlockNode nd = ns.Find(destLv);

            if (nd != null && ns != nd)
            {
                EHBlockNode d = nd;
                while (d != null && ns != d.EncloseBlock.EncloseNode)
                {
                    d = d.EncloseBlock.EncloseNode;
                }
                return("IL_" + d.ScopeStart.ToString("X6"));
            }
            if (label != null)
            {
                return(label);
            }
            return(null);
        }