From 814c3d39444398d0b03894b0d517c632e422f76b Mon Sep 17 00:00:00 2001 From: de4dot Date: Wed, 7 Nov 2012 04:45:36 +0100 Subject: [PATCH] Fix method decrypter --- de4dot.code/DumpedMethodsRestorer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/de4dot.code/DumpedMethodsRestorer.cs b/de4dot.code/DumpedMethodsRestorer.cs index 5932e405..4f677d05 100644 --- a/de4dot.code/DumpedMethodsRestorer.cs +++ b/de4dot.code/DumpedMethodsRestorer.cs @@ -38,7 +38,7 @@ namespace de4dot.code { } public virtual RawMethodRow ReadRow(uint rid) { - var dm = dumpedMethods.get(rid); + var dm = dumpedMethods.get(0x06000000 | rid); if (dm == null) return null; return new RawMethodRow(dm.mdRVA, dm.mdImplFlags, dm.mdFlags, dm.mdName, dm.mdSignature, dm.mdParamList); @@ -58,14 +58,14 @@ namespace de4dot.code { } public bool HasMethodBody(uint rid) { - return dumpedMethods.get(rid) != null; + return dumpedMethods.get(0x06000000 | rid) != null; } public MethodBody GetMethodBody(uint rid, RVA rva, IList parameters) { - var dm = dumpedMethods.get(rid); + var dm = dumpedMethods.get(0x06000000 | rid); if (dm == null) return null; - return MethodBodyReader.Create(module, dm.code, dm.extraSections, parameters); + return MethodBodyReader.Create(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok); } } }