Cpp2IL Versions Save

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

2022.1.0-pre-release.14

4 months ago

This is a bugfix release

Cpp2IL Core

  • Fixed an issue which resulted in incorrect type analysis contexts being created for ref type signatures, resulting in, for example, out parameters in dummy dlls being decompiled incorrectly as [Out] ParamType paramName instead of out ParamType paramName.

No packages other than core have been updated.

2022.1.0-pre-release.13

4 months ago

Yes, I know it's 2024 and the version number is still 2022.1

Happy 2024! It's been a while (almost a year!) since any super large changes came down the pipeline, so here's another release with various fixes and improvements. Specifically:

Cpp2IL Command Line Application

  • Improved verbose logging around resolution of paths within the provided game-path, to help diagnose issues with locating required files.
  • Fixed broken net7 builds
  • Fixed compilation errors when trying to build with .NET 8 SDK
  • Fixed processing layers running in reverse order to that in which they were passed in via arguments*

Cpp2IL Core

  • Diffable C# Output Format: Fixed an exception that could occur when generating diffable C# forms of custom attributes.
  • Looser filtering on <Module> type name to resolve an issue with some games (notably, Synth Riders). Thanks to @bookdude13 in #233!
  • Fixed an issue with end-of-method pointer calculation going outside the bounds of the binary. If this happens, Cpp2IL will fall back to an alternative calculation method*
  • Resolved some issues with invalid IL being generated in empty method bodies, by way of switching to AssetRipper.CIL for method filling*
  • Added detection of auto-properties and modified the generated IL to output them as actual auto-properties*
  • Fixed incorrect metadata in output dlls related to indexer properties*
  • Implemented discovery and output of native methods (e.g. IL2CPP exception throw helpers) so that information on them can be output*
  • Various improvements to @ds5678's Call Analysis processing layer, including:
    • Full type signatures for generic types*
    • Full method signatures*
    • Support for the new native method discovery*
    • Changing various Type fields to be object fields so that the same field can be re-used for Types and Type Names (where a direct Type reference isn't possible)*
  • Four new output types for dummy dlls*:
    • dll_default is the old dummydll (dummydll will still work and is an alias of dll_default)
    • dll_empty generates completely empty method bodies. Note these will likely not decompile cleanly, but may be desirable for programmatic use.
    • dll_throw_null fills all methods with throw null;.
    • dll_il_recovery will eventually be used for IL recovery like classic CPP2IL, but currently is an alias of dll_throw_null.

LibCpp2IL

  • WASM: Fixed an issue with reading wasm binaries which could result in errors relating to reading beyond the end of a stream.
  • WASM: Fixed an issue with calculating function pointers in WASM binaries.
  • WASM: Fixed an issue with incorrect field offsets in WASM binaries.
  • ELF: Properly handle addresses outside of file-backed regions. Thanks to @LukeFZ in #240!
  • MACH-O: Add support for loading the exported function list.
  • Removed LibCpp2ILUtils.VersionAwareSizeOf, because it used reflection to determine the size of structs, which was slow and didn't work with trimming.
  • Further increased the sanity limit for finding the Il2CppMetadataRegistration struct on metadata version 27 (Unity 2020.2) and later

All Projects

  • Dependency updates, including notably some changes to utilities pulled in from AssetRipper*
  • Miscellanous fixes to ensure proper NativeAOT/Trimming support*

Plugins

  • New plugin: Cpp2IL.Plugin.StrippedCodeRegSupport.
    • Some games have now been observed in the wild, often compiled using "master" compilation settings, which inline the entire Il2CppCodeRegistration struct. This results in errors like "failed to find pCodegenModules!". Using this plugin can allow loading these games, albeit without any information on generic types.
  • As a reminder, plugins are loaded from a Plugins directory in the current working directory. Also, the OrbisPkg plugin requires separate downloading of LibOrbisPkg and the dll to also be placed in the Plugins directory.

* Any changelog entry noted with an asterisk was contributed by @ds5678 via pull requests. Thanks for all the hard work!

Full Changelog: https://github.com/SamboyCoding/Cpp2IL/compare/2022.1.0-pre-release.12...2022.1.0-pre-release.13

2022.1.0-pre-release.12

1 year ago

This is a minor release to address a couple issues

LibCpp2IL

  • Increased the sanity limit when searching for pCodegenModules from 250 -> 400
  • Added support for reading Mach-O export tables

Cpp2IL Core

  • Fixed an issue with reading chars from v29 attribute blobs
  • DummyDll: Fixed invalid dll metadata on structs with explicit layout

Because this is a small/unplanned release, net7 support is still not fixed so those binaries are absent.

2022.1.0-pre-release.11

1 year ago

All projects

  • Dependency updates, including to .NET 7

Cpp2IL Command-line

  • The single-file executables are now built using .NET 7

Cpp2IL Core

  • Call analysis improvements (#165, thanks @ds5678!)
  • Fixed custom attribute blobs in dummydll output format (#172, thanks @ds5678!)
  • MethodAnalysisContext improvements (#182, thanks @ds5678!)
  • Some ISIL updates and refactoring, again thanks to @ds5678
  • Avoid a crash on invalid method pointers
  • Improved IL in dummy dll methods bodies (thanks @ds5678!)
  • Ensured that the __Generated DummyDLL has the .dll extension, which it previously didn't.

Standalone/single-file binaries have been removed because the net7 port broke them, they'll be back in the next release.

2022.1.0-pre-release.10

1 year ago

Cpp2IL

  • Fixed Linux GamePath handling

2022.1.0-pre-release.9

1 year ago

Cpp2IL.Core

  • Refactored the Dummy DLL creation process to allow API users to call it easily.
  • Fixed an exception that could be thrown when loading parameter custom attributes from a non-standard binary
  • Dummy DLL: Constructors now call an appropriate base constructor. Thanks to @ds5678 in #163!
  • New processing layer: Call Analysis. Thanks to @ds5678 in #164!
  • Dummy DLL: Fixed an exception which could occur when saving DLLs that contain an object array custom attribute parameter.

LibCpp2IL

  • Fixes for NSO file loading

2022.1.0-pre-release.8

1 year ago

All projects

  • Dependency cleanup

LibCpp2IL

  • Fixed a small oversight which could cause WASM loading to fail
  • Demoted a rather spammy warning in the WASM loader to a verbose log statement
  • (Experimental) support for IL2CPP v23 (Unity 5.6.5)
  • Decreased the initial backtrack on v27+ to fix issues with some games that have a lot of codegen modules after mscorlib

2022.0.7

1 year ago

Small addendum to the previous release to address the following:

LibCpp2IL

  • Backported support for IL2CPP v29.1 (Unity 2022.0.1b7 and later) from development branch

Cpp2IL.Core has been updated purely to pull in the updated LibCpp2IL. WasmDisassembler has not been updated and remains on 2022.0.2

2022.0.6

1 year ago

LibCpp2IL

  • Cleaned up some behavior around the handling of ELF files
  • Added support for R_AMD64_RELATIVE relocations in ELF binaries, allowing loading of more games successfully
  • Disabled assertion that metadata usage count and pointer are both 0 on v27+, because this isn't always the case

Cpp2IL Core

  • Fixed possible crash when encountering a type named just <

Attribute Restoration

  • Fixed some issues caused by incorrectly sorting the list of attribute type ranges which could cause restoration to fail
  • Fixed a potential crash caused by an out-of-bounds read

Analysis

  • Implemented support for array allocation on Arm64, which has a decently large impact on output code and attribute quality
  • Some improvements to key function address scanning

Command-line wrapper

  • Fixed --simple-attribute-restoration argument being ignored if --skip-analysis was not specified.

WasmDisassembler has not been updated and remains on 2022.0.2

2022.1.0-pre-release.7

1 year ago

Command-line wrapper

  • Support APKM files as game-path argument.

Core

  • Fixed an exception which could occur in the DummyDLL output format when running on IL2CPP v29+ games which use a null array as a custom attribute argument
  • Added support for custom attributes on parameters (mainly params keyword)
  • Stable-namer processing layer now supports all members
  • Attribute injector processing layer now outputs the length of the method body to the address attribute
  • Added a new "EZ-Diff" output format for machine-readable summaries of types and members
  • Rewrote the type context system to properly support generics
  • Updated AsmResolver
  • Some work on ISIL by @Alluseri in #134
  • Added a new plugin hook for unpacking container formats (like APKs)
  • @gompoc re-enabled the jump table detector for x86 ISIL.
  • Performance improvements:
    • Changed TryMapVirtualAddressToRaw to not use exceptions for control flow

General

  • Added a WIP prototype pure-c# Arm64 disassembler and the option to use it (not recommended!) by setting the CPP2IL_NEW_ARM64 environment variable.

OrbisPkg plugin

  • WIP plugin to allow unpacking of Orbis PKG files, using the new hook for container formats.
  • Note that running this requires downloading LibOrbisPkg.Core from here and placing the DLL in the plugins folder

GUI

  • Support single-file APKs. Thanks to @Alluseri in #135