← .NET assemblies
.NET·Guide
All tools

.NET in mobile apps

Apps written in C# with .NET MAUI, Xamarin.Forms or .NET for Android / iOS ship their code as .NET assemblies: files holding metadata (types, members, signatures, attributes, strings) and the methods' CIL bytecode. The tool reads them, lists everything they define and shows each type as decompiled C# or as IL. It all runs in your browser, and nothing is uploaded.

Contents

  1. Where the assemblies are
  2. IL, Mono and AOT
  3. Opening assemblies
  4. Browsing
  5. The C# view
  6. The IL view
  7. Uses and strings
  8. Keyboard shortcuts
  9. Limits
  10. The libraries

1Where the assemblies are

BuildLocationFormat
.NET 9 and later for Android (MAUI)lib/<abi>/libassembly-store.soAn ELF shared library whose payload section is an assembly store (v3). Every assembly is in it, usually LZ4-compressed.
.NET 8 for Androidlib/<abi>/libassemblies.<abi>.blob.soAssembly store v2, wrapped the same way.
Xamarin.Android 11–13, .NET 6 / 7assemblies/assemblies.blob
assemblies/assemblies.<abi>.blob
assemblies/assemblies.manifest
Assembly store v1. The blobs hold the assemblies; the manifest holds their names. Open them together.
Older Xamarin.Androidassemblies/*.dllOne file per assembly, sometimes LZ4-compressed (XALZ header).
.NET for iOS / Xamarin.iOSPayload/<App>.app/*.dllPlain assemblies next to the executable. The code itself is AOT-compiled into the executable (see below).

The APK and IPA inspectors offer a .NET button for these files, and the APK tool flags a .NET app in its overview. Loose .dll files open together with the other assemblies in their folder, so references between them resolve.

The Java side of a .NET for Android app (classes*.dex) holds the Android libraries it binds to and generated wrapper classes that forward Android callbacks into .NET. The app's own logic is in the assemblies.

2IL, Mono and AOT

3Opening assemblies

Drop files on the page, use Open assemblies…, or open them from the APK or IPA tool. You can select several files at once, for example a folder of .dll files or a v1 assemblies.blob with its assemblies.manifest. Each file can be up to 256 MB, and 1 GB in total. Assemblies are decompressed and their metadata read when they load (about a third of a second for 300 assemblies). Method bodies are decompiled only when you open their type.

The Overview shows the container, the target framework, whether the IL is present, and every assembly grouped as:

It also lists native imports ([DllImport] / P/Invoke) and embedded resources, which you can download.

4Browsing

5The C# view

Each method is decompiled from its IL: the evaluation stack becomes expressions, the control flow becomes if / while / for / do / switch, and exception clauses become try / catch / finally. On top of that, the decompiler reverses what the C# compiler generates:

ConstructHow it's recognised
async / awaitThe state machine's MoveNext is rebuilt as straight-line code with await, and shown as the body of the async method. Hoisted locals and parameters are shown by name.
using, foreachtry / finally with Dispose, and GetEnumerator / MoveNext / Current loops.
Properties, indexers, eventsget_X() / set_X(v) as X / X = v, get_Item as […], add_E / remove_E as += / -=. Auto-properties become { get; set; }.
Operatorsop_Equality, op_Addition, … as operators; string.Concat as +.
?:, ??, ?., && / ||From the branch patterns that produce them.
Literalstrue / false, characters, enum members (and [Flags] combinations) and null, from the type where the value is used.
Extension methods, base calls, constructorsCalls read as x.Ext(), base.M(), and : base(…) / : this(…).

Local variables are named from their types (num, text, list, …), since release builds carry no local names. Parameters keep their real names. Lambdas and local functions appear as their compiler-generated methods (<Method>b__0, marked lambda); click one to go to it. When control flow can't be structured, the decompiler falls back to goto and a label (IL_xxxx, the IL offset).

6The IL view

The IL view (i) shows the type the way ildasm does: .class, .field and .method headers, .locals, and every instruction with its offset, with exception blocks nested as .try / catch / finally. Tokens are resolved to types, members and strings, and you can click them like in the C# view. Branch targets are labels you can click to jump to. Switching between C# and IL keeps you on the same member.

7Uses and strings

Uses (x) lists every instruction that refers to the selected type, member or string. It searches the defining assembly and every assembly that references it, and stops at 2,000 results. For a property or event it finds uses of the accessors. Click a result to open the method that contains it.

The Strings tab lists every string literal (the #US heap) of the app assemblies, or of every assembly with the checkbox. This is a quick way to find endpoints, keys, certificate pins and feature flags. Clicking a string lists the methods that load it.

8Keyboard shortcuts

KeyAction
/ · ⌘F · Ctrl+FFind in the open type
Enter · Shift+Enter · F3Next / previous match
d · F12 · ⌘/Ctrl-clickGo to definition
xUses of the selection
c · iC# view · IL view
Alt+← · Alt+→Back / forward
↑ ↓Move the current line (when the code has focus)
EscClear the selection and close Uses

9Limits

10The libraries

The tool is a page on top of four JavaScript modules with no user interface, which can be used elsewhere (another page, a Web Worker, or jsc). Each module imports what it needs; the C# decompiler builds on lib/decompiler-core.js (DecompilerCore), the decompiler engine shared with the native viewers.

import { DotnetAssembly, DotnetSignature } from "../lib/dotnet-metadata.js";
import { CilDecoder } from "../lib/dotnet-il.js";
import { DotnetWorld } from "../lib/dotnet-model.js";
import { CSharpDecompiler } from "../lib/dotnet-csharp.js";

lib/dotnet-metadata.js — DotnetAssembly, DotnetSignature

Assembly containers (single PE files, LZ4 "XALZ" files, assembly stores v1–v3 and their ELF wrapper) and the ECMA-335 metadata of one assembly. A DotnetAssembly is one parsed assembly; its static methods open containers and read constants and attributes.

MethodWhat it does
DotnetAssembly.open(bytes, name, siblings){ kind, info, assemblies }: kind is "pe", "xalz" or "store"; each assembly entry has name, size, compressedSize and load(), which returns the decompressed PE bytes. siblings ([{ name, buffer }]) lets a v1 assemblies.blob find its assemblies.manifest.
DotnetAssembly.parse(bytes, fileName)
new DotnetAssembly(bytes, fileName)
The metadata of one assembly (throws for a native DLL).
assembly.header, fileName, streams, tables, rows, sections, bytes, view, sortedThe CLI header facts (runtime, metadata version, flags, entry point, machine…), the metadata streams and table layouts, the PE sections and the bytes.
assembly.row(table, id), count(table)A row as an object with named columns (coded indexes as tokens, strings as text); the number of rows of a table.
assembly.str(index), blob(offset), guid(index), userString(offset), allUserStrings()The heaps.
assembly.types(), typeDef(id), nestedTypes(id), enclosingOf(id)The type definitions, with their field and method ranges and enclosing type.
assembly.method(id), params(id), field(id), methodOwner(id), fieldOwner(id)Members and their owners.
assembly.properties(id), events(id), interfaces(id), genericParams(token), customAttrs(token), constant(token), hasConstant(token), implMap(token), fieldRva(id), classLayout(id), semanticsOf(id), semanticsFor(token), methodImpls(id)The lookups of the sorted tables.
assembly.asm(), asmRefs(), module(), moduleRefs(), resources(), resourceData(resource)The assembly's identity, its references, its module and its manifest resources.
assembly.body(id), localTypes(signatureToken)A method body with its exception clauses; the types of its locals.
assembly.typeDefFullName(id), typeRefFullName(id), typeRefScope(id), rvaToOffset(rva), readCompressed(offset)Full names (Namespace.Outer/Inner), the assembly a TypeRef points to, file offsets and compressed integers.
DotnetAssembly.readAttribute(assembly, ctorSignature, blob, resolveEnum)The arguments of a custom attribute: { fixed: [{ t, v }], named: [{ field, name, t, v }] }.
DotnetAssembly.readConstant(elementType, blob)A constant's value: { t, v }.
DotnetAssembly.typeName(assembly, type)The full name of a named signature type.
DotnetAssembly.lz4(source, length), unXALZ(bytes), isPE(bytes)LZ4 block decompression, XALZ unwrapping, the MZ test.
DotnetAssembly.SCHEMA, TABLE_NAMES, CODED_INDEXES, ELEMENT_TYPESThe table columns and names, the coded index layouts, the element type names.
DotnetSignature.method(assembly, blob), field, prop, locals, methodSpec, spec, typeSignature blobs. A type is an object such as { k: "p", n: "int" }, { k: "t", tok }, { k: "gi", base, args } or { k: "arr", el, rank }.
DotnetSignature.reader(bytes), kind(blob), tdor(value)A reader of compressed integers, a blob's first byte, a TypeDefOrRef coded index as a token.

lib/dotnet-il.js — CilDecoder

MemberWhat it does
CilDecoder.decode(code)The instructions of a method body: [{ off, op, name, size, arg, kind, flow }]. kind says what arg is: i4, i8, r4, r8, br (target offset), switch (targets), tok (metadata token), str (user string), loc / arg (index).
CilDecoder.ONE_BYTE, TWO_BYTEThe opcode tables (one-byte opcodes, and the second byte after 0xFE).
CilDecoder.tokenOf(instruction)The token an instruction refers to, or null.

lib/dotnet-model.js — DotnetWorld

A set of loaded assemblies (a "world"): it resolves references across assemblies (following type forwarders), formats types and members as C# or IL HTML whose names carry navigation keys (data-k="assemblyIndex:token"), and answers the queries the tool shows.

MethodWhat it does
DotnetWorld.fromFiles(files){ world, kinds, bad }: a world from [{ name, buffer }], every container opened and every assembly parsed.
new DotnetWorld()An empty world; world.add(entry) adds an assembly, world.get(index) parses it, world.index() indexes the names for world.findAsm(name); world.assemblies lists the slots ({ i, name, assembly, error, assemblyName, … }).
world.resolveType, findType, typeKey, typeFullName, shortName, member, memberKey, typeInfo, enumValues, isFlagsEnum, attrs, hasAttr, genNames, typeGenNames, typeGPResolution of tokens to definitions (in any loaded assembly) and facts about them.
world.cs(ai, type, context), typeTokCs, tokType, isRef, typeSig, world.il(…), ilMember, ilTypeTokA signature type or member as C# or IL HTML.
world.methodInfo(ai, methodId), world.ilListing(ai, methodId)A method's signature, owner, generic and parameter names; its IL listing with exception blocks.
world.classify()Groups every assembly (app, lib, platform, bad) and returns them in display order (also kept in world.order; DotnetWorld.GROUP_ORDER).
world.targetFramework(), DotnetWorld.ilPresence(slots)The app's target framework (".NET 8 · android34.0"); whether the method bodies hold IL or AOT stubs.
world.nativeImports(), resources(), userStrings(all)P/Invoke declarations, embedded resources and user strings of the app's assemblies.
world.search(query, cap)Types, and from 3 characters methods, fields and properties, whose name contains the query.
world.locateKey(key), memberNameOfKey(key)Where a definition key is shown (its type, the member to scroll to); a member's name.
world.findUses(key, onProgress)Every IL instruction that refers to a type, member or string: { label, hits: [{ ai, mrid, off }], scope, capped }.
DotnetWorld.stringLiteral(text), stripArity(name), escapeHtml, span, keyword, hex, CSHARP_ALIASESFormatting helpers.

lib/dotnet-csharp.js — CSharpDecompiler

The decompiler: each method's IL becomes a control-flow graph, the shared decompiler core turns it into structured code, and C# idioms (properties, events, operators, foreach, using, lock, async / await, iterators, initializers) are rebuilt. Its methods are static and take a DotnetWorld.

MethodWhat it does
CSharpDecompiler.typeCs(world, ai, typeRowId, options)The C# view of a type: [{ d, h, a, m }] (indent, HTML, the member the line belongs to, the method a body starts).
CSharpDecompiler.typeIL(world, ai, typeRowId)The IL view of a type, in the same format.
CSharpDecompiler.typeLines(world, ai, typeRowId, mode){ lines, ms }: typeCs or typeIL for a viewer, never throwing, with variables keyed per method.
CSharpDecompiler.decompile(world, ai, methodId)One method: { lines: [{ indent, html }], usedGoto }, or { failed }.
CSharpDecompiler.methodBodyLines(world, ai, methodId)A method's body lines, cached, with the IL as comments when decompilation fails.
CSharpDecompiler.stringLiteral(text)A C# string literal.
import { DotnetWorld } from "../lib/dotnet-model.js";
import { CSharpDecompiler } from "../lib/dotnet-csharp.js";

const { world } = DotnetWorld.fromFiles([{ name: "libassembly-store.so", buffer }]);
const index = world.findAsm("Medis.Core");
const assembly = world.get(index);
const type = assembly.types().find(t => assembly.typeDefFullName(t.rid) === "App.LoginViewModel");
for (const line of CSharpDecompiler.typeCs(world, index, type.rid)) {
  console.log("  ".repeat(line.d) + line.h.replace(/<[^>]+>/g, ""));
}

The tool runs the decompiler and the usage search in a module Web Worker built on these libraries (dotnet/dotnet-worker.js).