本文整理汇总了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 = fieldToInfo.find(ldsfld.Operand as FieldReference);
if (info == null)
return false;
var ldci4 = instrs[i + 1];
if (!ldci4.isLdcI4())
return false;
var ldelem = instrs[i + 2];
if (ldelem.OpCode.Code != Code.Ldelem_U1)
return false;
block.remove(i, 3 - 1);
instrs[i] = new Instr(DotNetUtils.createLdci4(info.array[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 = fieldToInfo.find(ldsfld.Operand as FieldReference);
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 (stelem.OpCode.Code != Code.Stelem_I1)
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 = DotNetUtils.getLocalVar(blocks.Locals, ldloc.Instruction);
if (local == null)
return false;
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 (ldelem.OpCode.Code != Code.Ldelem_U1)
return false;
block.remove(i, 3 - 1);
instrs[i] = new Instr(DotNetUtils.createLdci4(info.array[ldci4.getLdcI4Value()]));
return true;
}