我想从加载的程序集中执行一个方法,我看到了这个 Dnlib - Execute IL MethodBody from loaded assembly
并且,我想做同样的想法,我搜索我的功能感谢RVA地址(硬编码),它很好找到,我试图导入它,如你所说:
BindingFlags eFlags = BindingFlags.Instance |BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
foreach (TypeDef type in module.GetTypes())
{
Type classInstance = type.GetType();
foreach (MethodDef method in type.Methods)
{
if (method.RVA.ToString() == RVA.ToString())
{
importedMethod = classInstance.GetMethod(method.Name, eFlags);
但它失败了,执行了classInstance.GetMethod,但变量importedMethod始终为null。你知道我犯了哪个错误吗?
谢谢