Change IL code on the fly

I want to change the .Net IL code of an existing class on the fly. Is it possible somehow? I found some links to the .Net Profiling API, but according to the documentation it does not support self-editing applications. The main goal is to replace getters and setters of some properties. Any hint would be greatly appreciated.

amuses, Achim

+3
source share
2 answers

I suggest you check out Mono Cecil . Do not think that you cannot use Mono executables in a Windows.NET application.

Cecil is like a reflection on steroids. You can not only reflect on the assembly, but also change its IL and save the result.

- .

+3

Source: https://habr.com/ru/post/1773256/


All Articles