示例#1
0
文件: Block.cs 项目: kidhudi/de4dot
 public void replaceLastNonBranchWithBranch(int numInstrs, Block target)
 {
     if (LastInstr.isBr())
     {
         numInstrs++;
     }
     replaceLastInstrsWithBranch(numInstrs, target);
 }
示例#2
0
文件: Block.cs 项目: kidhudi/de4dot
 public bool canAppend(Block other)
 {
     if (other == null || other == this || getOnlyTarget() != other)
     {
         return(false);
     }
     // If it's eg. a leave, then don't merge them since it clears the stack.
     return(LastInstr.isBr() || Instr.isFallThrough(LastInstr.OpCode));
 }
示例#3
0
文件: Block.cs 项目: kidhudi/de4dot
        // If last instr is a br/br.s, removes it and replaces it with a fall through
        public void removeLastBr()
        {
            if (!LastInstr.isBr())
            {
                return;
            }

            if (fallThrough != null || (LastInstr.Operand != null && (targets == null || targets.Count != 1)))
            {
                throw new ApplicationException("Invalid block state when last instr is a br/br.s");
            }
            fallThrough = LastInstr.Operand != null ? targets[0] : null;
            targets     = null;
            instructions.RemoveAt(instructions.Count - 1);
        }