From 7e229a29b7b5e16ce34051190cf4311a637d72b8 Mon Sep 17 00:00:00 2001 From: de4dot Date: Sun, 5 Feb 2012 16:14:13 +0100 Subject: [PATCH 01/78] Add updated cecil submodule --- cecil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cecil b/cecil index 9b28c58c..9d3c2ac9 160000 --- a/cecil +++ b/cecil @@ -1 +1 @@ -Subproject commit 9b28c58c35470f7cef5f03d3c50c9ba1e65b6843 +Subproject commit 9d3c2ac91cfcbdce0e2c389a4229ae9b3abfba7c From 82cc64bd77d93522f206aeb81e5d37ba947921e1 Mon Sep 17 00:00:00 2001 From: de4dot Date: Sun, 5 Feb 2012 16:14:46 +0100 Subject: [PATCH 02/78] Add Sections property --- de4dot.code/PE/PeImage.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/de4dot.code/PE/PeImage.cs b/de4dot.code/PE/PeImage.cs index ab702f0d..b9a880af 100644 --- a/de4dot.code/PE/PeImage.cs +++ b/de4dot.code/PE/PeImage.cs @@ -47,6 +47,10 @@ namespace de4dot.code.PE { get { return resources; } } + internal SectionHeader[] Sections { + get { return sectionHeaders; } + } + public uint FileHeaderOffset { get { return fileHeader.Offset; } } From 23c72927b57e037ee24c2725116ad119292b1a8c Mon Sep 17 00:00:00 2001 From: de4dot Date: Sun, 5 Feb 2012 16:17:47 +0100 Subject: [PATCH 03/78] Add CV and methods decrypter --- de4dot.code/de4dot.code.csproj | 2 + .../deobfuscators/CodeVeil/Deobfuscator.cs | 144 ++++++++ .../CodeVeil/MethodsDecrypter.cs | 309 ++++++++++++++++++ .../deobfuscators/Unknown/Deobfuscator.cs | 2 - de4dot.cui/Program.cs | 1 + 5 files changed, 456 insertions(+), 2 deletions(-) create mode 100644 de4dot.code/deobfuscators/CodeVeil/Deobfuscator.cs create mode 100644 de4dot.code/deobfuscators/CodeVeil/MethodsDecrypter.cs diff --git a/de4dot.code/de4dot.code.csproj b/de4dot.code/de4dot.code.csproj index 8a368666..3aaaa13f 100644 --- a/de4dot.code/de4dot.code.csproj +++ b/de4dot.code/de4dot.code.csproj @@ -79,6 +79,8 @@ + + diff --git a/de4dot.code/deobfuscators/CodeVeil/Deobfuscator.cs b/de4dot.code/deobfuscators/CodeVeil/Deobfuscator.cs new file mode 100644 index 00000000..33c041c5 --- /dev/null +++ b/de4dot.code/deobfuscators/CodeVeil/Deobfuscator.cs @@ -0,0 +1,144 @@ +/* + Copyright (C) 2011-2012 de4dot@gmail.com + + This file is part of de4dot. + + de4dot is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + de4dot is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with de4dot. If not, see . +*/ + +using System.Collections.Generic; +using Mono.Cecil; +using Mono.MyStuff; +using de4dot.blocks.cflow; + +namespace de4dot.code.deobfuscators.CodeVeil { + public class DeobfuscatorInfo : DeobfuscatorInfoBase { + public const string THE_NAME = "CodeVeil"; + public const string THE_TYPE = "cv"; + + public DeobfuscatorInfo() + : base() { + } + + public override string Name { + get { return THE_NAME; } + } + + public override string Type { + get { return THE_TYPE; } + } + + public override IDeobfuscator createDeobfuscator() { + return new Deobfuscator(new Deobfuscator.Options { + ValidNameRegex = validNameRegex.get(), + }); + } + + protected override IEnumerable