📈 GH Trending Explorer 🎲 Surprise me

← all repos

SamboyCoding / Cpp2IL

git clone https://github.com/SamboyCoding/Cpp2IL.git 2022.0.7 · 4y ago 🔥 on GitHub Trending today

Work-in-progress tool to reverse unity's IL2CPP toolchain.

—
stars, 24h
—
stars, 7 days
+419
stars, 30 days · #645
3.0k
★ total
406
forks · 32 open issues

Star history starts 2026-10-20; the chart appears after the second daily snapshot.

LanguageC#
LicenseMIT
Created2019-06-19 (7y ago)
Last push1mo ago
Watchers46
OwnerUser

Seen on GitHub Trending

  • 2026-10-20 — #12 monthly in c# · +419 ★

GitHub topics

Links

README excerpt
# Cpp2IL
### Need Help? Join the discord!
WIP Tool to reverse Unity's IL2CPP build process back to the original managed DLLs.
The information below almost entirely applies to the CLI application available on github releases. For documentation on
using the "core" module - which the CLI is just a wrapper around - in your own projects,
see README_CORE.md
Uses LibCpp2IL for the initial parsing and loading of metadata structures. LibCpp2IL is obtainable from the
build artifacts if you want to do something yourself with IL2CPP metadata, and is released under the MIT license. The
link above will take you to the documentation for LibCpp2IL.
## Decompiler
The decompiled CIL is pretty messy right now, the next thing is probably pattern matching to convert il2cpp specific stuff into C#
(generic ISIL should be converted into more C# specific ISIL, new object, throw, etc. instructions should be added to ISIL),
but most of the times it's at least possible to see what the method does.
Use ILSpy because it works with broken CIL better than dnSpy.
The entry point to decompilation is `MethodAnalysisContext.Analyze()`, it translates platform specific assembly into ISIL with `Cpp2IlInstructionSet`,
builds the control flow graph and dominator info, and the rest of the decompilation is done with `IAction` classes (`MethodAnalysisContext.analysisActions`),
these include stack analysis, simplification, applying metadata, etc. and then `Ilgenerator.GenerateIl()` translates the ISIL into CIL that's saved into managed dlls.
### Development Branch Notes
Cpp2IL has undergone a major rewrite. This branch represents work in progress, and is subject to change.
CI builds for developers can be obtained from My Nuget Feed. 
The command-line interface has been simplified, going from a lot of command line options to a concept of output formats
and processing layers. However, a lot of these formats and layers are not yet implemented, so functionality is limited
compared to the previously released versions.
#### Obvious Changes:
Many options, such as `--analysis-level`, `--skip-analysis`, etc, have been removed. Analysis is now off by default and can be enabled with `--output-as dll_il_recovery`.
Equally, options like `--supress-attributes`, which previously suppressed the Cpp2ILInjected attributes, have been replaced with a process layer - this one is actually implemented,
and is called `attributeinjector`. You can enable this layer using the `--use-processor` option, and you can list other options using `--list-processors`. 
Metadata dumps and method dumps will be their own output format too, instead of both being default-on, and controlled via a dedicated option. Currently this means you'll need to run
Cpp2IL multiple times if you want both dumps, though this may change in the future if we add support for outputting to multiple formats simultaneously. Like processing layers,
output formats can be listed via the `--list-output-formats` option, and are selected via the `--output-as`