两个嵌套的 DLL
我们有一个dll文件;假设是 X.DLL。
我们现在正在编写另一个 DLL,假设“A.DLL”使用 X.DLL 的一些(很少)函数。我们无法访问 X.DLL 的源代码。另外,我们不想向客户提供 X.DLL 和 A.DLL。
相反,我们希望将 X.DLL 封装在 A.DLL 中,这样分发 A.DLL 就足够了。
有可能吗?
感谢您的帮助。
新手编码员
We have a dll file; let's say X.DLL.
We are now writing another DLL, let's say "A.DLL" that uses some (very few) of the functions of X.DLL. We have no access to source code of X.DLL. Also, we don't want to give our clients X.DLL along with A.DLL.
Instead, we want to encapsulate X.DLL within A.DLL, so that distributing A.DLL will suffice.
Is it something possible?
Your help is appreciated.
Novice Coder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
ILMerge
ILMerge
您用 c# 标记了您的问题。
如果这些是托管程序集 DLL(如果代码是 C#,则它们将是),那么您可以使用 ILMerge。
You tagged your question with c#.
If these are managed assembly DLL's, which they will be if the code is c#, then you can do exactly what you want with ILMerge.
将源代码从 x.dll 复制到具有所需功能的 a.dll。
或者将 x.dll 拆分为两个 dll
copy source code from x.dll to a.dll with required functions.
or split x.dll to two dll's
将一个 dll 封装到另一个 dll 中是不可能的。
如果您可以从 X.DLL 供应商那里获取一个库,并使用您的代码静态链接到它,则可能是一种解决方法。
黑客可能会将 X.DLL 作为 dll 内的资源,然后在运行时解压并加载。
It is impossible to encapsulate one dll into another.
A way out may be if you can obtain a lib from the X.DLL vendors, and statically link to it with your code.
A hack out may be carrying the X.DLL as a resource inside you dll, then unpack and load in in the runtime.