dncil
The FLARE team's open-source library to disassemble Common Intermediate Language (CIL) instructions.
What it is and what it does
dncil is a pure-Python library for parsing and analyzing Common Intermediate Language (CIL) bytecode from .NET managed methods. It exposes the structure of CIL through two main classes: CilMethodBody (representing a complete method with header, instructions, and exception handlers) and Instruction (representing individual CIL operations). The library is designed to let developers write CIL analysis and reverse-engineering tools in Python without needing C# expertise or C#-based tools like dnLib.
Typically used alongside dnfile (a .NET metadata parser) to extract and disassemble managed methods from .NET executables. The library provides both low-level access (raw bytes, opcode/operand decomposition) and high-level helpers (instruction type checks, size queries, flag inspection). It is maintained by Mandiant's FLARE team and is positioned for security research, malware analysis, and .NET binary inspection workflows.
Use it for:
- Reverse-engineer .NET malware by disassembling and analyzing CIL instructions from suspicious executables.
- Build automated CIL analysis tools to detect patterns, extract metadata, or validate .NET binary integrity.
- Integrate .NET binary inspection into Python-based security pipelines without requiring C# or external tools.
- Parse and inspect CIL method bodies to extract control flow, operands, and exception handling logic.
- Develop educational tools or documentation generators that visualize or explain .NET bytecode.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
dncil is a Python library for disassembling Common Intermediate Language (CIL) instructions from .NET managed methods, parsing headers, instructions, and exception handlers into an object-oriented API.
Yes. dncil is a stable, actively maintained library with no security vulnerabilities, low install friction, and a permissive license. Install it if you need to analyze .NET CIL bytecode from Python—particularly for malware analysis, reverse engineering, or security research. It is a specialized tool; install only if you have a concrete need to work with .NET managed methods.
Install
dncil on PyPI
pip
pip install dnciluv
uv add dncilpoetry
poetry add dncilInstalling dncil
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is active with a recent commit on 2026-07-24, though the latest release dates to 2022-12-12.
License in practice
Licensed under Apache License (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install dncil
from dncil.cil.body import CilMethodBody
# Parse CIL from bytes (e.g., from a .NET executable)
method_body = CilMethodBody.from_bytes(cil_bytes)
for insn in method_body.instructions:
print(f"{insn.offset:04x} {insn.mnemonic} {insn.operand}")
Requires Python 3.7 or later. To use example scripts, dnfile (.NET metadata parser) must be installed separately.
Verify before relying
- Whether the library handles all CIL opcode variants or only a subset of the full CIL specification.
- Performance characteristics when processing large or complex .NET assemblies.
- Compatibility with recent .NET Framework and .NET Core versions beyond what the fact sheet indicates.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,341 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 181,576/month — #10,121 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dncil-1.0.2-py3-none-any.whl
Keywords: .net, dotnet, cil, il, disassembly, FLARE
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
dnfileParses .NET executable files to extract and…
permissive · top 15,000 on PyPI
smdaSMDA is a recursive disassembler library that…
permissive · top 15,000 on PyPI
ailmentAILment provides the intermediate language (IL)…
permissive · top 15,000 on PyPI
capstoneCapstone is a disassembly engine that decodes…
permissive · top 5,000 on PyPI
pypcodepypcode provides machine code disassembly and…
permissive · top 15,000 on PyPI
pythonnetpythonnet enables Python code to call .NET and…
permissive · top 5,000 on PyPI
clr_loaderLoads and provides a generic interface to call…
unclear · top 5,000 on PyPI
xdisDisassembles Python bytecode from any Python…
copyleft · top 15,000 on PyPI
pydltPyDLT reads and writes AUTOSAR DLT (Diagnostic…
permissive · top 15,000 on PyPI
pyccoloPyccolo is a library for declarative…
permissive · top 15,000 on PyPI