DumpMiner – UI tool for playing with ClrMD

ClrMD is a library built by Lee Culver. This a process and crash dump introspection library. This allows you to write tools and debugger plugins which can do thing similar to SOS and PSSCOR.

I’m not going to write here about ClrMD, there are plenty of explanations on the net, but I want to talk about tool called DumpMiner I built using ClrMD.

When ClrMD came out, maybe three years ago, I started playing with it and I was very impressed. It gives you fairly easily, with managed code, to build tools which analyze dumps or live process (like WinDbg with SOS).

After I wrote a few examples, I decided to build a simple UI tool to demonstrate the operations you can do with ClrMD .

Continue reading

Posted in .NET | Tagged , , , , , , , , , , | Leave a comment

Mono.Cecil – Simplify and Optimize macros

You may have seen it, but what does it actually do? Do I need to add them?

When we write IL macros, we emit instruction after instruction to the method body. Instruction, is operation to do (e.g. math operations, load\store, invocations etc.) and it may have operand. The instruction is 1-byte or 2-bytes length.

Lets look on an example of loading method argument: Continue reading

Posted in .NET, c# | Tagged , , , , , | Leave a comment

Mono.Cecil – IAssemblyResolver

One of the important thing you need to know when you start to do real work with Cecil is the IAssemblyResolver

public interface IAssemblyResolver
    AssemblyDefinition Resolve(AssemblyNameReference name);

    AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters);

    AssemblyDefinition Resolve(string fullName);

    AssemblyDefinition Resolve(string fullName, ReaderParameters parameters);

The role of this interface, is to handle module resolving. Continue reading

Posted in .NET, c# | Tagged , , , | Leave a comment

Mono.Cecil – Generics

Till now we saw an overview on Cecil and two simple examples. Today I want to show how you can handle generics in Cecil.

For the example I’m going to use EqualityComparer<> Continue reading

Posted in .NET, c# | Tagged , , , | Leave a comment

Value type methods – call, callvirt, constrained and hidden boxing

Long time ago I wrote a post here on  call vs callvirt and the needed of the this null check. Here I want to wrote about this topic but on value types.

Look on these three ToString() calls: Continue reading

Posted in .NET, c#, Roslyn | Tagged , , , , , , , | Leave a comment