Let's start with the famous Hello.cs:
[sourcecode language="CSharp"]
using System;
public class Hello
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
[/sourcecode]
build it:
csc /target:exe Hello.cs
de-assemble:
ildasm /out:Hello.il Hello.exe
edit the string "Hello World!" in the Hello.il file to something like "Hello Andre Broers!"
assemble:
ilasm /out:Hello2.exe /res:Hello.res Hello.il
Now we have the altered assembly.
By signing the assembly we can get sure the assembly isn't tampered with. I will explain this in a next blog.