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 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<TypeSig>();
newSig.ParamsAfterSentinel = ThreadSafeListCreator.Create<TypeSig>();
for (int i = 0; i < sig.ParamsAfterSentinel.Count; i++)
newSig.ParamsAfterSentinel.Add(Create2(sig.ParamsAfterSentinel[i]));
}

View File

@ -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<Parameter> parameters) {
public bool GetMethodBody(uint rid, RVA rva, IList<Parameter> 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;
}
}
}