Port MPRESS unpacker

This commit is contained in:
de4dot 2012-11-07 01:52:15 +01:00
parent d98d4b10bb
commit 427ea38595
5 changed files with 8 additions and 9 deletions

View File

@ -322,15 +322,15 @@ namespace de4dot.blocks {
return (MethodDef)method;
return getMethod(getType(module, declaringType), method);
}
#endif
public static MethodDef getMethod(TypeDefinition type, string returnType, string parameters) {
public static MethodDef getMethod(TypeDef type, string returnType, string parameters) {
foreach (var method in type.Methods) {
if (isMethod(method, returnType, parameters))
return method;
}
return null;
}
#endif
public static MethodDef getMethod2(ModuleDef module, IMethod method) {
if (method == null)

View File

@ -223,8 +223,8 @@
<Compile Include="deobfuscators\MethodCollection.cs" />
<Compile Include="deobfuscators\MethodsDecrypter.cs" />
<Compile Include="deobfuscators\MethodStack.cs" />
<None Include="deobfuscators\MPRESS\Deobfuscator.cs" />
<None Include="deobfuscators\MPRESS\Lzmat.cs" />
<Compile Include="deobfuscators\MPRESS\Deobfuscator.cs" />
<Compile Include="deobfuscators\MPRESS\Lzmat.cs" />
<Compile Include="deobfuscators\Operations.cs" />
<Compile Include="deobfuscators\ProxyCallFixerBase.cs" />
<Compile Include="deobfuscators\QuickLZ.cs" />

View File

@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using dot10.DotNet;
using Mono.MyStuff;
using de4dot.PE;
using de4dot.blocks;
@ -140,7 +139,7 @@ namespace de4dot.code.deobfuscators.MPRESS {
new MethodInfo("System.Int32", "(System.String[])"),
};
Version detectVersion() {
var ep = module.EntryPoint;
var ep = module.EntryPoint as MethodDef;
if (ep == null || ep.Body == null)
return Version.Unknown;
var type = ep.DeclaringType;
@ -232,7 +231,7 @@ namespace de4dot.code.deobfuscators.MPRESS {
return true;
}
public override IDeobfuscator moduleReloaded(ModuleDefinition module) {
public override IDeobfuscator moduleReloaded(ModuleDefMD module) {
var newOne = new Deobfuscator(options);
newOne.setModule(module);
return newOne;

View File

@ -54,8 +54,8 @@ namespace de4dot.cui {
new de4dot.code.deobfuscators.Goliath_NET.DeobfuscatorInfo(),
new de4dot.code.deobfuscators.ILProtector.DeobfuscatorInfo(),
new de4dot.code.deobfuscators.MaxtoCode.DeobfuscatorInfo(),
new de4dot.code.deobfuscators.MPRESS.DeobfuscatorInfo(),
#endif
new de4dot.code.deobfuscators.MPRESS.DeobfuscatorInfo(),
new de4dot.code.deobfuscators.Rummage.DeobfuscatorInfo(),
new de4dot.code.deobfuscators.Skater_NET.DeobfuscatorInfo(),
#if PORT

2
dot10

@ -1 +1 @@
Subproject commit 467c01e824587bb5c09608c58adac718c465a356
Subproject commit 71e94c79a8271bbd0abb614ac8b79d31e98674b4