Remove all invalid methods
This commit is contained in:
parent
4691c805d8
commit
c2d13d9059
|
@ -273,6 +273,8 @@ namespace de4dot.code.deobfuscators.CodeVeil {
|
||||||
addTypeToBeRemoved(proxyDelegateFinder.MethodInfoType, "Obfuscator proxy method MethodInfo type");
|
addTypeToBeRemoved(proxyDelegateFinder.MethodInfoType, "Obfuscator proxy method MethodInfo type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addMethodsToBeRemoved(InvalidMethodsFinder.findInvalidMethods(module), "Anti-reflection method");
|
||||||
|
|
||||||
base.deobfuscateEnd();
|
base.deobfuscateEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,22 @@
|
||||||
along with de4dot. If not, see <http://www.gnu.org/licenses/>.
|
along with de4dot. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.CodeVeil {
|
namespace de4dot.code.deobfuscators.CodeVeil {
|
||||||
class InvalidMethodsFinder {
|
class InvalidMethodsFinder {
|
||||||
|
public static List<MethodDefinition> findInvalidMethods(ModuleDefinition module) {
|
||||||
|
var list = new List<MethodDefinition>();
|
||||||
|
foreach (var type in module.GetTypes()) {
|
||||||
|
foreach (var method in type.Methods) {
|
||||||
|
if (isInvalidMethod(method))
|
||||||
|
list.Add(method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
public static bool isInvalidMethod(MethodDefinition method) {
|
public static bool isInvalidMethod(MethodDefinition method) {
|
||||||
if (method == null)
|
if (method == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user