diff --git a/de4dot.blocks/GenericArgsSubstitutor.cs b/de4dot.blocks/GenericArgsSubstitutor.cs index 17d83e66..77e6b95a 100644 --- a/de4dot.blocks/GenericArgsSubstitutor.cs +++ b/de4dot.blocks/GenericArgsSubstitutor.cs @@ -19,6 +19,7 @@ using System.Collections.Generic; using dnlib.DotNet; +using dnlib.Threading; namespace de4dot.blocks { public struct GenericArgsSubstitutor { @@ -291,7 +292,7 @@ namespace de4dot.blocks { newSig.Params.Add(Create2(sig.Params[i])); newSig.GenParamCount = sig.GenParamCount; if (sig.ParamsAfterSentinel != null) { - newSig.ParamsAfterSentinel = new List(); + newSig.ParamsAfterSentinel = ThreadSafeListCreator.Create(); for (int i = 0; i < sig.ParamsAfterSentinel.Count; i++) newSig.ParamsAfterSentinel.Add(Create2(sig.ParamsAfterSentinel[i])); } diff --git a/de4dot.code/DumpedMethodsRestorer.cs b/de4dot.code/DumpedMethodsRestorer.cs index ffd17f25..b4852164 100644 --- a/de4dot.code/DumpedMethodsRestorer.cs +++ b/de4dot.code/DumpedMethodsRestorer.cs @@ -61,15 +61,14 @@ namespace de4dot.code { return false; } - public bool HasMethodBody(uint rid) { - return GetDumpedMethod(rid) != null; - } - - public MethodBody GetMethodBody(uint rid, RVA rva, IList parameters) { + public bool GetMethodBody(uint rid, RVA rva, IList parameters, out MethodBody methodBody) { var dm = GetDumpedMethod(rid); - if (dm == null) - return null; - return MethodBodyReader.CreateCilBody(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok); + if (dm == null) { + methodBody = null; + return false; + } + methodBody = MethodBodyReader.CreateCilBody(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok); + return true; } } }