From 1583552825b5bbd07cc889d0232b11ead8650f79 Mon Sep 17 00:00:00 2001 From: de4dot Date: Wed, 8 Feb 2012 16:14:07 +0100 Subject: [PATCH] Make sure rvas list is never null --- de4dot.code/deobfuscators/CodeVeil/MainType.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/de4dot.code/deobfuscators/CodeVeil/MainType.cs b/de4dot.code/deobfuscators/CodeVeil/MainType.cs index e4f0a8fb..661eefdd 100644 --- a/de4dot.code/deobfuscators/CodeVeil/MainType.cs +++ b/de4dot.code/deobfuscators/CodeVeil/MainType.cs @@ -30,7 +30,7 @@ namespace de4dot.code.deobfuscators.CodeVeil { TypeDefinition theType; MethodDefinition initMethod; ObfuscatorVersion obfuscatorVersion = ObfuscatorVersion.Unknown; - List rvas; // _stub and _executive + List rvas = new List(); // _stub and _executive public bool Detected { get { return theType != null; } @@ -143,11 +143,12 @@ namespace de4dot.code.deobfuscators.CodeVeil { } bool checkMethodsType(TypeDefinition type) { + rvas = new List(); + var fields = getRvaFields(type); if (fields.Count < 2) // RVAs for executive and stub are always present if encrypted methods return true; - rvas = new List(fields.Count); foreach (var field in fields) rvas.Add(field.RVA); return true;