Posts Tagged ‘reverse engineering’

Decompiling C# Code with ILSpy and PowerShell

This week at the PowerShell Summit in Redmond, I gave a talk about using .NET reflection in PowerShell. We took a quick look at ILSpy and how to read the decompiled C# code that makes up compiled .NET assemblies. After a comment by Karl Prosser, I figured it would be cool to take it a […]

Catch me at the PowerShell Summit spring 2013!

Coming this spring is the first PowerShell Summit! It will be held in Redmond on the Microsoft campus. There will be PowerShell team members, MVPs and others (like me) speaking about all kinds of PowerShell topics. I’ll be digging in to some really advanced topics that probably won’t help you get your job done any […]

A Quick Overview of .NET Reflector

I’ve spent A LOT of time using .NET Reflector. It’s how I figured out how to create PowerGUI VSX and how I figured out how to compile PowerShell. This is a must have tool for any .NET developer. I use it all the time to look at libraries I’m using, including the .NET framework libraries, […]

What Compiled PowerShell Might Look Like

I’ve done it! I’ve compiled PowerShell! Does it run? I don’t know. Is it even the correct interpretation of the script I compiled? I believe so, but I can’t be sure. After writing about the new AST and compiler in PowerShell v3, I spent some time trying to get a script to compile. The CompileToMethod method cannot construct complex […]

Inside PowerShell 3: The New Parser and Compiler

If I’m not mistaken, Jeffery Snover was quoted, during Microsoft build, that PowerShell 3.0 scripts run up to six times faster than the same 2.0 scripts. This is a dramatic improvement! One of the reasons the new version is so much faster is that the PSObjects now derive from the DynamicObject. This allows for all […]

Inside PowerShell: Script Parsing and Node Execution

A parse tree is a way of describing a string in a some sort of grammar, or syntax, that is rooted by a single node. Nodes within the tree are related to their parent in some way and may have child nodes underneath them. In terms of a scripting or programming language, we can use […]

PowerShell Tracing

I spend a lot of time digging around in the System.Management.Automation.dll with Reflector. I love trying to understand how this whole PowerShell thing works. One thing I’ve noticed with PowerShell is that it utilizes the .NET TraceSource class to enable internal logging. Trace sources allow you to tag particular operations with a source and, amazingly, […]

Invoking Private Members with PowerShell

I love digging through code and figuring out how it works. I use Reflector all the time. Although Reflector is great for static analysis, sometimes it’s nice to be able to actually run the code. Using reflection in Visual Studio is taxing to say the least. The number of parameters and guess and check work […]