修改运行时组件?组件

2023-09-03 06:37:50 作者:假装不帅

如何修改内存中加载的方法给出总成,使CLR实例化时,对一些类是在它与修改code新对象的新对象?

how can i modify memory loaded methods in given assembly so that clr when instantiates new objects for some class it makes new objects with modified code in it?

推荐答案

您可以使用单塞西尔修改组件,然后再加载它。

You can use Mono Cecil to modify the assembly before you load it.

您可以修改的组件保存为一个字节数组,然后调用的Assembly.Load 加载字节数组。

You can save the modified assembly to a byte array, then call Assembly.Load to load the byte array.