本文整理汇总了C#中de4dot.blocks.Block.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Block.Remove方法的具体用法?C# Block.Remove怎么用?C# Block.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de4dot.blocks.Block
的用法示例。
在下文中一共展示了Block.Remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deobfuscate2
bool Deobfuscate2(Block block, int i)
{
var instrs = block.Instructions;
if (i >= instrs.Count - 2)
return false;
var ldsfld = instrs[i];
if (ldsfld.OpCode.Code != Code.Ldsfld)
return false;
var info = arrayBlockState.GetFieldInfo(ldsfld.Operand as IField);
if (info == null)
return false;
var ldci4 = instrs[i + 1];
if (!ldci4.IsLdcI4())
return false;
var ldelem = instrs[i + 2];
if (!IsLdelem(info, ldelem.OpCode.Code))
return false;
block.Remove(i, 3 - 1);
instrs[i] = new Instr(Instruction.CreateLdcI4((int)info.ReadArrayElement(ldci4.GetLdcI4Value())));
return true;
}
示例2: Deobfuscate3
bool Deobfuscate3(Block block, int i)
{
var instrs = block.Instructions;
if (i + 1 >= instrs.Count)
return false;
int start = i;
var ldsfld = instrs[i];
if (ldsfld.OpCode.Code != Code.Ldsfld)
return false;
var info = arrayBlockState.GetFieldInfo(ldsfld.Operand as IField);
if (info == null)
return false;
if (!instrs[i + 1].IsLdcI4())
return false;
var constants = GetConstantsReader(block);
int value;
i += 2;
if (!constants.GetInt32(ref i, out value))
return false;
if (i >= instrs.Count)
return false;
var stelem = instrs[i];
if (!IsStelem(info, stelem.OpCode.Code))
return false;
block.Remove(start, i - start + 1);
return true;
}
示例3: Deobfuscate1
bool Deobfuscate1(Block block, int i)
{
var instrs = block.Instructions;
if (i >= instrs.Count - 2)
return false;
var ldloc = instrs[i];
if (!ldloc.IsLdloc())
return false;
var local = ldloc.Instruction.GetLocal(Blocks.Locals);
if (local == null)
return false;
ArrayBlockState.FieldInfo info;
if (!localToInfo.TryGetValue(local, out info))
return false;
var ldci4 = instrs[i + 1];
if (!ldci4.IsLdcI4())
return false;
var ldelem = instrs[i + 2];
if (!IsLdelem(info, ldelem.OpCode.Code))
return false;
block.Remove(i, 3 - 1);
instrs[i] = new Instr(Instruction.CreateLdcI4((int)info.ReadArrayElement(ldci4.GetLdcI4Value())));
return true;
}