Back to articles

Tag archive

#glassnet

R
Nov 12, 2026

Reading top-level statements in decompiled C#: the synthesized Program class and the Main entry point

A file of top-level statements has no visible class and no visible Main, but the assembly does. The C# compiler wraps your statements in an internal class named Program and an entry-point method with the unspeakable name <Main>$, marked with the .entrypoint directive. Here is exactly what the compiler emits for the sync and async cases, why the entry point is the method you can never write by hand, where your global usings went, and how Glass.NET reads it back as the top-level program you wrote.

Nov 12, 20266 min read0 reactions0 comments
D
Nov 12, 2026

Decompiling boxing, unboxing and the constrained. prefix in C#

An implicit conversion from int to object is invisible in C# but allocates on the heap — and the IL says so with a box opcode. This walks through where box, unbox.any and the constrained. prefix come from, why generic code uses constrained. to dodge a boxing allocation, and how Glass.NET reconstructs readable C# while the IL reveals the allocation that the source hides.

Nov 12, 20267 min read0 reactions0 comments
D
Nov 12, 2026

Decompile and inspect .NET assemblies from the command line — and from an AI assistant

Glass.NET 1.3.0 ships a headless CLI and an MCP server. Reconstruct a buildable C# project or a single member with glass export, generate an SBOM, check NuGet package authenticity, diff two builds, and let an AI coding assistant read decompiled C# over a Model Context Protocol server with glass mcp — all static analysis, all free.

Nov 12, 20267 min read0 reactions0 comments
D
Nov 4, 2026

Decompile a single-file or self-contained .NET app with Glass.NET

You published a .NET app, you drag the .exe onto a decompiler, and nothing readable comes out. The problem is not the decompiler — it is that dotnet publish has several formats and most do not hand you a managed assembly where you expect it. Here is where your IL actually lives in a self-contained, single-file, ReadyToRun or Native AOT build, and how to open it in Glass.NET.

Nov 4, 20266 min read0 reactions0 comments
E
Nov 4, 2026

Extract and read embedded resources from a .NET assembly with Glass.NET

A DLL carries more than code. Baked into the same file are embedded .resources and ResX strings, localized satellite strings, whole files like config, JSON, SQL and certificates, and string and byte constants. Here is how to find and read all of it in Glass.NET — the free, static-only decompiler that never runs the assembly — and export it to disk for inspection outside the tool.

Nov 4, 20267 min read0 reactions0 comments
S
Nov 3, 2026

See what a .NET assembly depends on and calls with Glass.NET

Before you ship a third-party DLL, you want to know its external surface: which assemblies and packages it references, what framework it targets, which native libraries it P/Invokes, and where it reaches out to the network, the file system or another process. Here is how to audit all of that statically in Glass.NET — the free decompiler that reads the binary and never runs it.

Nov 3, 20266 min read0 reactions0 comments
D
Oct 22, 2026

Decompiling C# expression trees: the lambda that became a tree of factory calls

The same `x => x + 1` compiles two completely different ways depending on the type it is assigned to. As a delegate it is a hidden method and an ldftn; as an Expression<Func<int, int>> it is a nest of Expression.Parameter, Expression.Constant, Expression.Add and Expression.Lambda calls with members referenced by ldtoken. Here is exactly what the compiler emits for an expression tree — captured variables as a Constant of a closure, string equality with its op_Equality, nested lambdas wrapped in Quote — and how a decompiler folds the factory calls back into the lambda you wrote.

Oct 22, 202612 min read0 reactions0 comments