Move methods to DotNetUtils
This commit is contained in:
parent
1fd7319b19
commit
a6d8762d13
|
@ -131,6 +131,22 @@ namespace de4dot.blocks {
|
|||
public static class DotNetUtils {
|
||||
public static readonly TypeCaches typeCaches = new TypeCaches();
|
||||
|
||||
public static bool isLeave(Instruction instr) {
|
||||
return instr.OpCode == OpCodes.Leave || instr.OpCode == OpCodes.Leave_S;
|
||||
}
|
||||
|
||||
public static bool isBr(Instruction instr) {
|
||||
return instr.OpCode == OpCodes.Br || instr.OpCode == OpCodes.Br_S;
|
||||
}
|
||||
|
||||
public static bool isBrfalse(Instruction instr) {
|
||||
return instr.OpCode == OpCodes.Brfalse || instr.OpCode == OpCodes.Brfalse_S;
|
||||
}
|
||||
|
||||
public static bool isBrtrue(Instruction instr) {
|
||||
return instr.OpCode == OpCodes.Brtrue || instr.OpCode == OpCodes.Brtrue_S;
|
||||
}
|
||||
|
||||
public static bool isLdcI4(Instruction instruction) {
|
||||
return isLdcI4(instruction.OpCode.Code);
|
||||
}
|
||||
|
|
|
@ -128,19 +128,19 @@ namespace de4dot.blocks {
|
|||
}
|
||||
|
||||
public bool isLeave() {
|
||||
return OpCode == OpCodes.Leave || OpCode == OpCodes.Leave_S;
|
||||
return DotNetUtils.isLeave(instruction);
|
||||
}
|
||||
|
||||
public bool isBr() {
|
||||
return OpCode == OpCodes.Br || OpCode == OpCodes.Br_S;
|
||||
return DotNetUtils.isBr(instruction);
|
||||
}
|
||||
|
||||
public bool isBrfalse() {
|
||||
return OpCode == OpCodes.Brfalse || OpCode == OpCodes.Brfalse_S;
|
||||
return DotNetUtils.isBrfalse(instruction);
|
||||
}
|
||||
|
||||
public bool isBrtrue() {
|
||||
return OpCode == OpCodes.Brtrue || OpCode == OpCodes.Brtrue_S;
|
||||
return DotNetUtils.isBrtrue(instruction);
|
||||
}
|
||||
|
||||
public bool isConditionalBranch() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user