Update code since some dnlib APIs were modified

This commit is contained in:
de4dot 2014-04-14 06:25:42 +02:00
parent c5e242f5ed
commit 032c532809
2 changed files with 9 additions and 9 deletions

View File

@ -19,6 +19,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.Threading;
namespace de4dot.blocks { namespace de4dot.blocks {
public struct GenericArgsSubstitutor { public struct GenericArgsSubstitutor {
@ -291,7 +292,7 @@ namespace de4dot.blocks {
newSig.Params.Add(Create2(sig.Params[i])); newSig.Params.Add(Create2(sig.Params[i]));
newSig.GenParamCount = sig.GenParamCount; newSig.GenParamCount = sig.GenParamCount;
if (sig.ParamsAfterSentinel != null) { if (sig.ParamsAfterSentinel != null) {
newSig.ParamsAfterSentinel = new List<TypeSig>(); newSig.ParamsAfterSentinel = ThreadSafeListCreator.Create<TypeSig>();
for (int i = 0; i < sig.ParamsAfterSentinel.Count; i++) for (int i = 0; i < sig.ParamsAfterSentinel.Count; i++)
newSig.ParamsAfterSentinel.Add(Create2(sig.ParamsAfterSentinel[i])); newSig.ParamsAfterSentinel.Add(Create2(sig.ParamsAfterSentinel[i]));
} }

View File

@ -61,15 +61,14 @@ namespace de4dot.code {
return false; return false;
} }
public bool HasMethodBody(uint rid) { public bool GetMethodBody(uint rid, RVA rva, IList<Parameter> parameters, out MethodBody methodBody) {
return GetDumpedMethod(rid) != null;
}
public MethodBody GetMethodBody(uint rid, RVA rva, IList<Parameter> parameters) {
var dm = GetDumpedMethod(rid); var dm = GetDumpedMethod(rid);
if (dm == null) if (dm == null) {
return null; methodBody = null;
return MethodBodyReader.CreateCilBody(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok); return false;
}
methodBody = MethodBodyReader.CreateCilBody(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok);
return true;
} }
} }
} }