Releases: SamboyCoding/Cpp2IL
Milestone Preview: 2022.1.0 #2
This release is built against an in-development build of the upcoming 4.10.0 release of AsmResolver.DotNet, in case you are trying to build it yourself.
Output formats
DummyDLL:
- Fix nested type references (upstream in AsmResolver)
- Generate assembly definitions in parallel
- Optimize type signature importing
Processing layers
Attribute injector:
- Fix field offset attribute not being applied to all fields
Internal Changes
- Analysis: Convert directly to ISIL, do not build a control flow graph first
Ignore me - MelonLoader bugfix release 2022.0.3
Literally just a reupload of 2022.0.2 with a newer version number to trick ML 0.5.4 into "updating".
Ignore this.
Milestone Preview: 2022.1.0 #1
This is the first preview release of the rewrite. Considering I wanted to get this done by January, having an initial preview by Mid-March isn't ideal, but it's better than nothing.
It's not really possible for me to write changenotes here because so much has changed - but there's an attempt at a summary in the README of the development branch, which I recommend you read if you're curious.
Note that this release does not include any sort of analysis behavior, but it is, I believe, suitable for use with Il2CppAssemblyUnhollower.
It's also considerably faster (up to a 50% reduction in execution time) at doing the same tasks than any previous build.
Also note that the Linux builds have changed from net6-ubuntu to net6-linux.
This release is not published to nuget, but CI builds can be obtained from my nuget feed.
Milestone 2022.0.2
This is a minor bugfix and improvement release
WasmDisassembler
- Some changes to the WasmInstruction struct to conform to microsoft's updated guidelines.
LibCpp2IL
- Updated
LibCpp2ILMain.Reset()
to also dispose of the binary and metadata files and underlying streams. - Added support for what I've dubbed metadata version 24.15, unity 2018.4.34-2018.4.36, which removes a single field in AssemblyNameDefinition.
- Added an initial backtrack to v27+ code registration via codegen module list, to hopefully reduce the excessive time spent here.
- This comes with a buffer which should be large enough in almost all cases (I've not seen any games which break due to this change), but this could cause issues - let me know if CodeRegistration location errors arise from this change.
Cpp2IL.Core
- Updated the Capstone library to a fork which uses proper packaging, until the main one gets an update with this change.
- This should fix errors when running on linux and mac!
- Thanks to @js6pak for PRing a fix both to capstone and here.
- Renamed
Cpp2ILApi.ResetInternalState
toDisposeAndCleanupAll
and made it public, so you can clear out the memory usage (or at least, most of it, in the event I missed something) once you've finished using Cpp2IL.
Milestone 2022.0.1
This is a minor bugfix and improvement release to 2022.0.0
Cpp2IL Command-Line Wrapper
- Add support for specifying a path to an XAPK with
--game-path
- Provide more logging about unity version on windows when running as verbose
Dummy DLL Generation
- Fix a potential InvalidOperationException when recovering explicit overrides
Attribute Restoration
- Fix DLLs failing to save if an attribute used a constructor parameter of type Object[] which was not empty.
LibCpp2IL
- WASM: Add support for name remapping via framework js file
- WASM: Make dynCall offset calculation a little bit more intelligent.
WasmDisassembler has not been updated and remains on 2022.0.0.
Milestone 2022.0.0
Note this is NOT the promised rewrite, but an interim release to get the last 30 commits out in a consumable form
LibCpp2IL
- Support WASM (WebAssembly) files as binaries.
- Fixed a potential NRE in BinarySearcher
- Add WasmDisassembler project
- Better NSO support
Analysis
- Better if statement filtering to remove useless exception throwers. Thanks to @gompoc, merged from his fork in #61.
- Multiple improvements to x86 instruction set thanks to @gompoc:
- Fix errors on il2cpp v27
- Generic method call improvements
Cpp2IL Core
- Add il2cpp::vm::Object::IsInst to key function addresses
- Fixed behavior around invalid method pointers
- Add
CreateAnalyzerForMethod
- Expose
IlContinueThroughErrors
- Fixed behaviour on games which partially strip System.Exception
- Don't emit public key tokens because they break unhollower.
Attribute Restoration
- Process properties themselves, in addition to getters + setters
- Fixed single-character strings overrunning into garbage data
- Fix enum types to be actual enum references instead of integers
Command Line Wrapper
- Fix harmony crash on windows single-file executable
Milestone 2021.6.1
LibCpp2IL
- Fix for a potential Stack Overflow in VersionAwareSizeOf (#57)
Command-Line Wrapper
- Support for manually inputting the unity version if not running on Windows and no asset files are present.
- Reworked the error message when the above issue occurs to be less obscure.
Milestone 2021.6.0
LibCpp2IL
- Removed CppMethodBodyBytes from MethodDefinition as it didn't work very well anyway
- Removed the dependency on Iced
- Implemented support for
Il2CppAssemblyDefinition
s. - Fixes for NSO support
- Changed concrete generic methods in the Il2CppBinary object to be of type
Il2CppGenericMethodRef
, notIl2CppConcreteGenericMethod
, which has been removed. The main advantage is that non-generic methods on generic types (e.g.List<T>.Add
) are now supported. - Minor performance improvements (on the order of about half a second saved, of 6-7 total) to file reading
- Added more verbose logging to BinarySearcher for help in resolving any future issues.
Analysis
- Arm64: STP and LDP instructions are now supported
- Arm64: Functions which return a struct in X8 are now supported
- Arm64: Key function addresses will now be partially reconstructed if the binary strips them from its export table
- X86: Various improvements by @gompoc in #56, including:
- Support for imul reg, reg.
- Better IL for enums being implicitly read
- Locals can be used for length parameter in array instantiation
- Field pointers can be directly boxed
- Unboxing is supported
- Improvements to generic method calls
- Support for sete and setl conditional moves.
- Support for addition and subtraction done via the LEA instruction
- We no longer could crash if a namespace was present in the assembly which was on the list of forbidden file names under NTFS (e.g. CON).
Attribute Restoration
- Metadata v29: Fixes for new attribute restoration of Types and constructor params of type Object.
Dummy DLLs
- As a result of support for Il2CppAssemblyDefinitions being added to LibCpp2IL, generated assemblies now have the correct version number.
Core API
- General code cleanup to reduce hard dependencies on capstone or iced
- Fix Capstone loading on non-windows platforms
- Fix IL not being generated if the method dump path was not provided
- Improved support for determining the unity version. Thanks to @ds5678 in #52
Command Line Wrapper
- Added several new command line arguments, detailed in the README:
--skip-method-dumps
--simple-attribute-restoration
--just-give-me-dlls-asap-dammit
- Upgraded to .NET 6 (from 5), which brings a host of performance improvements on its own.
Milestone 2021.5.3
This is a minor improvement and bugfix release.
Analysis
- Added a new IL post-processor which aims to remove locals that are only used once, often on the immediately following line
- Tuned conditional move actions to be more accurate. Thanks to @gompoc in #50 for contributing part of this.
- Improved some of the generic method handling code. This reduces the chance of exceptions while saving, but this entire section of code is awful and needs rewriting, so as a knock-on effect some methods that previously used to generate clean IL no longer will. This is expected and will be remedied in an upcoming release.
- Fixed methods which fail analysis being marked as extern. They will now throw an AnalysisFailedException.
Dummy DLLs
- Emit packing and type sizes to assemblies
- Added new injected type "AnalysisFailedException"
- Made all injected types internal, not public.
LibCpp2IL
- Experimental support for NSO (Nintendo Switch) binaries. This may not work in all cases. Please report any issues you encounter.
- Corrected the metadata version for unity versions 2019.3.0 to 2019.3.6
- Fixed strings being read using the Default encoding instead of UTF8 always, causing incorrect member names on .NET Framework.
Core API
- Cpp2IL will no longer attempt to write files or folders containing the { or } characters as windows can interpret these as GUIDs in specific circumstances, and fail.
- Performance improvements for finding KeyFunctionAddresses on Arm64.
- Attribute restoration pre-metadata-v29 will now detect useless KeyFunctionAddresses (e.g. for binaries which have no exported il2cpp functions) and fallback to simple restoration.
Command-Line Wrapper
- Moved the initialization of and improved the cecil patch so that errors due to attribute restoration are caught.
- Fixed major performance problems on the NetFramework build caused by Enumerable.Skip being incredibly slow.
Milestone 2021.5.2
This is a hotfix update.
Analysis
- Fixes an issue with constant definition casting causing exceptions.
Once again, LibCpp2IL has not been updated and remains on 2021.5.0