Let\'s say I have a buggy application like this:
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args)
You will need unmanaged code to perform this successfully but it can be done...
See http://www.codeproject.com/Articles/463508/NET-CLR-Injection-Modify-IL-Code-during-Run-time