在运行时修改插件 dll 中的 MSIL
我们有一个 .NET 插件机制,但我们的 SDK 尚未冻结,因此我们时不时地进行重大更改。有时,这些仅相当于更改大小写或修复命名约定。
那么,问题;在加载 dll 之前或之后进入 dll 并更改 msil 以便在运行时修复微不足道的 SDK 损坏有多困难?
We have a .NET plug-in mechanism, but our SDK isn't frozen yet so we make breaking changes every now and again. Sometimes these only amount to a change in casing or fixing a naming convention.
So, question; how hard is it to go into a dll before or after it's loaded and change the msil so that trivial SDK breakages can be fixed at runtime?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Cecil 可能会帮助你。
Cecil might help you.
加载后总是太晚了。 JIT 编译器很可能已经将方法体转换为机器代码。尤其是在单声道上。 DLL 已被锁定,您无法再破解它。使用分析器很难证明其合理性。
如果这很重要,请利用“编辑+继续”。
It is invariably too late after it is loaded. The JIT compiler would quite likely already have converted the method bodies to machine code. Especially on Mono. The DLL is locked, you can't hack it anymore. Using the profiler is pretty difficult to justify.
Leverage Edit + Continue if this is important.