6.0.0-beta.1
Pre-releaseThis marks the second major bump of AsmResolver since the rewrite. Note that this is still a pre-release and that last-minute breaking API changes may still be introduced before full release.
Summary
Version 6.0.0 of AsmResolver focuses on achieving three very important long-awaited milestones:
-
Unmanaged PE file building: A complete revamp of the underlying PE file building mechanism has finally allowed for a long-awaited
UnmanagedPEFileBuilder
: A robust yet flexible foundation for reconstructing fully native PE files as well as mixed-mode .NET modules. We are not quite there yet with integrating it into theAsmResolver.DotNet
package, but it should pave the way for it as well as help with processing ReadyToRun- and NativeAOT-compiled files in the future. See the new documentation for details. -
.NET Framework 3.5 support: Previously, AsmResolver targeted .NET standard 2.0, allowing developers to use a .NET Framework version as low as 4.6.1. While 4.8.1 is installed by default on modern Windows machines and we are approaching the release of .NET 9, many use-cases still require older versions of .NET (in particular, game-modding and dynamic code deobfuscation). With the awesome help of the people behind the @MonoMod project, we have been finally able to make AsmResolver 6.0.0 fully compatible with .NET Framework 3.5.
-
API simplification and improvements: The existing public API also has undergone many quality-of-life improvements to ensure a better developer experience. This includes removing many of the redundant interfaces, as well as flattening a lot of namespaces to reduce the number of
using
directives required for typical usecases of AsmResolver. Performance has also been improved a lot in various areas, partially thanks to the new concept ofRuntimeContext
s. And of course, many bug fixes have been squashed.
Important to note is that this release introduces breaking changes with respect to 5.x.x. In the following, the important changes are listed:
New Features
- Add
UnmanagedPEFileBuilder
, allowing forPEImage
s containing only native code or both native and managed .NET code to be built with little effort (#554). - It is now much easier to customize existing PE file builders (or create your own) to get full control over the final PE file layout thanks to the new
PEFileBuilder
base class. - Add .NET 3.5 support, using MonoMod.Backports (#536, #540, #544, #450, #439, with the help of @MonoMod and @Windows10CE).
- Add the concept of
RuntimeContext
s, allowing for .NET modules to be loaded under a specific .NET runtime or AppHost bundle context, which avoids many type resolution problems, drastically reduces memory footprint and also increases overall performance (#471, #537). - Add
PEImage::ToPEFile()
. - Add
TrampolineTableBuffer
, allowing for IAT trampolines to be built easily. - Add
TypeMemoryLayout::IsReferenceOrContainsReferences
flag, equivalent to RuntimeHelpers::IsReferenceOrContainsReferences<T> but determined statically (#530, #539). - Add
BundleAssemblyResolver
(2fc1872) - Add
SetAccessorMethods
toPropertyDefinition
andEventDefinition
(#555, thanks @ds5678). - Add
AggressiveInlining
,AggressiveOptimization
andHasSecurityMitigations
flags toMethodDefinition
andMethodImplAttributes
(bf80344). - Add
IInputFile::BaseAddress
(a1af121)
Improvements
- Remove many redundant interfaces (e.g.,
IPEFile
andIPEImage
). Developers are expected to use their immediate implementing class (i.e.,PEFile
andPEImage
) (#445, #561, #562). - Flatten many namespaces, drastically reducing the required
using
directives for typical AsmResolver usecases (#446, #560). - Use
EmptyErrorListener.Instance
for reading input files by default (#472, #564). - Remove
System.Text.Json
as a hard dependency requirement, making the library more portable for older .NET targets ( #450, #538). - Add .NET 9 as a known corlib (#548, thanks @ds5678).
- Add correct interpretation of
#Schema
and#JTD
metadata streams (#557, thanks @ElektroKill). - Add
FunctionPointerTypeSignature
support forSignatureComparer::GetHashCode
(#551, thanks @BadRyuner). - Rewrite
IconResource
into a more intuitive API that also supports language-specific icons and cursors (#565). - Let
PESection::Name
accept arbitrary UTF8 strings (#454). - Add
OptionalHeader::SetDataDirectory
(7b27c91). - Add
SetDataDirectory.CreateForSegment
(7b27c91.)
Bug Fixes
- Fix an issue where EnC metadata streams are looked up using case insensitive name lookup (#557, thanks @ElektroKill).
- Fix an issue where Win32 resources were inserted into a PE's root resource directory out-of-order, causing version info and icons to not be interpreted by Windows correctly (#552, #553).
- Fix a data race in caching mechanism of
StringsStream
andUserStringsStream
(b1ded1f). - Fix an issue related to reading and writing signed compressed integers for lower bounds in array type signatures (c7bc9f6).
Documentation
- Documentation on the new PE file building mechanism was added.
- The
AsmResolver.PE.Win32Resource
package now has its dedicated documentation section.