Add isEmptyObfuscated() method
This commit is contained in:
parent
eee2c509be
commit
1d8fe39f59
|
@ -241,7 +241,7 @@ namespace de4dot.blocks {
|
|||
}
|
||||
|
||||
public static bool isEmpty(MethodDefinition method) {
|
||||
if (!method.HasBody)
|
||||
if (method.Body == null)
|
||||
return false;
|
||||
foreach (var instr in method.Body.Instructions) {
|
||||
var code = instr.OpCode.Code;
|
||||
|
@ -251,6 +251,17 @@ namespace de4dot.blocks {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static bool isEmptyObfuscated(MethodDefinition method) {
|
||||
if (method.Body == null)
|
||||
return false;
|
||||
int index = 0;
|
||||
var instr = getInstruction(method.Body.Instructions, ref index);
|
||||
if (instr == null || instr.OpCode.Code != Code.Ret)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static FieldDefinition findFieldType(TypeDefinition typeDefinition, string typeName, bool isStatic) {
|
||||
if (typeDefinition == null)
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user