Add a getDumpedMethod() method
This commit is contained in:
parent
583d4201f5
commit
9c64165d15
|
@ -37,8 +37,12 @@ namespace de4dot.code {
|
||||||
this.dumpedMethods = dumpedMethods;
|
this.dumpedMethods = dumpedMethods;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual RawMethodRow ReadRow(uint rid) {
|
DumpedMethod getDumpedMethod(uint rid) {
|
||||||
var dm = dumpedMethods.get(0x06000000 | rid);
|
return dumpedMethods.get(0x06000000 | rid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RawMethodRow ReadRow(uint rid) {
|
||||||
|
var dm = getDumpedMethod(rid);
|
||||||
if (dm == null)
|
if (dm == null)
|
||||||
return null;
|
return null;
|
||||||
return new RawMethodRow(dm.mdRVA, dm.mdImplFlags, dm.mdFlags, dm.mdName, dm.mdSignature, dm.mdParamList);
|
return new RawMethodRow(dm.mdRVA, dm.mdImplFlags, dm.mdFlags, dm.mdName, dm.mdSignature, dm.mdParamList);
|
||||||
|
@ -58,11 +62,11 @@ namespace de4dot.code {
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasMethodBody(uint rid) {
|
public bool HasMethodBody(uint rid) {
|
||||||
return dumpedMethods.get(0x06000000 | rid) != null;
|
return getDumpedMethod(rid) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MethodBody GetMethodBody(uint rid, RVA rva, IList<Parameter> parameters) {
|
public MethodBody GetMethodBody(uint rid, RVA rva, IList<Parameter> parameters) {
|
||||||
var dm = dumpedMethods.get(0x06000000 | rid);
|
var dm = getDumpedMethod(rid);
|
||||||
if (dm == null)
|
if (dm == null)
|
||||||
return null;
|
return null;
|
||||||
return MethodBodyReader.Create(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok);
|
return MethodBodyReader.Create(module, dm.code, dm.extraSections, parameters, dm.mhFlags, dm.mhMaxStack, dm.mhCodeSize, dm.mhLocalVarSigTok);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user