Click here to Skip to main content
15,897,371 members
Articles / Desktop Programming / Win32

CLR Injection: Runtime Method Replacer

Rate me:
Please Sign up or sign in to vote.
4.99/5 (44 votes)
23 Jun 2009CPOL8 min read 258.5K   4.9K   156  
Replace any method with another method at runtime. Updated for 3.5 SP1.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace NativeAssemblerInjection
{
    // http://msdn.microsoft.com/en-us/kb/kb00318785.aspx
    public static class FrameworkVersions
    {
        public static readonly Version Net35 = new Version(3,5,21022,8);
        public static readonly Version Net35SP1 = new Version(3,5,30729,1);
        public static readonly Version Net30 = new Version(3,0,4506,30);
        public static readonly Version Net30SP1 = new Version(3,0,4506,648);
        public static readonly Version Net30SP2 = new Version(3,0,4506,2152);
        public static readonly Version Net20 = new Version(2,0,50727,42);
        public static readonly Version Net20SP1 = new Version(2,0,50727,1433);
        public static readonly Version Net20SP2 = new Version(2,0,50727,3053);

//1.1	Original release	1.1.4322.573
//1.1	Service Pack 1	1.1.4322.2032
//1.1	Service Pack 1 (Windows Server 2003 32-bit version*)	1.1.4322.2300
//1.0	Original release	1.0.3705.0
//1.0	Service Pack 1	1.0.3705.209
//1.0	Service Pack 2	1.0.3705.288
//1.0	Service Pack 3	1.0.3705.6018
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions