Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » MSIL   (RSS)

MSIL Injection: Rewrite a non dynamic method at runtime

The .Net Framework contains classes to create dynamic methods at runtime but what about rewriting existing methods at runtime? Is it even possible? It turns out yes, but with some stringent constraints. We are going to create a sample program where we
Posted by ZiadElmalki | 3 Comments
Filed under: , , , , , ,

Attachment(s): TestRuntimeMethodReplace.zip

Create dynamic WCF Clients without any configuration/service references

The other day I wanted to do some simple perf tests against a bunch of different wcf services that I am working on. I wrote a little test tool to do this but I had some problems with my test tool. My test application was very tightly coupled to the services.
Posted by ZiadElmalki | 5 Comments
Attachment(s): ClientFactory.cs

Performance when creating objects using generic new constraint

I got an email asking about the performance when creating objects using the generic new constraint. You can learn more about the generic new constraint here http://msdn.microsoft.com/en-us/library/sd2w2ew5.aspx and here http://msdn.microsoft.com/en-us/library/d5x73970.aspx
Posted by ZiadElmalki | 0 Comments
Attachment(s): Program.cs

Reflection : Fast Object Creation

Reflection is a powerful api in the .net framework. Reflection allow us to inspect types at runtime, dynamically invoke methods, create objects, etc. Using reflection developers can make highly modular applications where functionality can be replaced
Posted by ZiadElmalki | 1 Comments
Attachment(s): Program.cs

Why are these nop instructions in my debug build?

If you run the sample code from the last post in release mode and debug mode you will notice that the msil for the test method are different. Method Program.TestMethod -- DEBUG ------------------------------- 0x0000 nop 0x0001 ldc.i4.0 0x0002 stloc.0
Posted by ZiadElmalki | 0 Comments
Filed under: , , , ,

Msil Parser Quick Update

Here is a quick update. The code will now resolve any tokens in the msil so now you can see the methods, strings, types, etc. I added a new method called GetData that takes a module, opcode, and the raw data byte array. As you can see they are very few
Posted by ZiadElmalki | 0 Comments
Filed under: , , , ,

Msil Parser

I just moved into a new apartment last Saturday and have had no internet access till today. Life without internet is like being cut off from the world. I can't check my email, I can't work from home, I got to call and talk to people to order food ;{ It
Posted by ZiadElmalki | 1 Comments
Filed under: , , , ,
 
Page view tracker