使用 dnlib 添加 DLL 引用

问题描述 投票:0回答:0

在 (https://github.com/0xd4d/dnlib/blob/master/Examples/Example3.cs) 有一个很好的例子,其中一个程序集是使用 dnlib 创建的。如何在此示例中添加 DLL 引用?到目前为止我失败的是我需要创建一个 AssemblyRef,但是如何在示例中添加这个 AssemblyRef 作为参考我在任何地方都找不到。有谁知道吗?

AssemblyDef assembly = AssemblyDef.Load("MyDll.dll"); AssemblyRef assemblyRef = assembly.ToAssemblyRef();

module.GetAssemblyRefs().Add(assenblyRef); <- Unfortunately this is not working.

c# dll dll-injection dnlib
© www.soinside.com 2019 - 2024. All rights reserved.