If you are using .NET 4.0. or higher, take a look at the: MethodRental.SwapMethodBody Method
Other way: CLR Injection: Runtime Method Replacer
If you are using .NET 4.0. or higher, take a look at the: MethodRental.SwapMethodBody Method
Other way: CLR Injection: Runtime Method Replacer