Skip to content

5.0.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@Washi1337 Washi1337 released this 18 Oct 19:22
· 470 commits to master since this release
16362a8

This marks the first major version bump since the rewrite of AsmResolver. Note that, this is still a pre-release. last-minute breaking API changes may still happen before the full release.

New Features

  • Read / Write support for PortablePDB metadata streams and tables (#348)
  • A new WIP package called AsmResolver.Symbols.Pdb for reading and writing Windows PDB files using only managed code (#324, #326, #342)
  • Add SignatureComparer::Default (#366, thanks @ds5678)
  • Add TypeDefinition::IsByRefLike (#358, #362)
  • Add the notion of IMemberClonerListeners, allowing for automatically post-processing cloned metadata (e.g., automatically injecting it into the target module) as the cloner is cloning metadata (#333, #337, #354, thanks @CursedLand)
  • AsmResolver.DotNet is now trimmable (#304, thanks @ds5678)
  • Add DotNetRuntimeInfo::IsNetCoreApp, IsNetFramework and IsNetStandard properties for easily identifying whether a module targets .NET Core, .NET Framework or .NET Standard (505da7a).
  • Add MetadataTable::IsSorted property (#348)
  • DynamicMethodDefinition now supports dynamic methods that are initialized via DynamicILInfo (b0b13c8)
  • Add convenience constructors for BinaryStreamReader that take a byte[] or a IDataSource alone (54c65ee).
  • Add OriginalMetadataTokenProvider (#361)

Breaking Changes

  • Make SignatureComparer immutable (#366, thanks @ds5678)
  • Make BlobReadContext a struct (#356).
  • Change ISegment::UpdateOffsets's method signature (#236, #346)
  • Remove ITlsDirectory::ImageBase and CodeSegment::ImageBase (#346)
  • Remove SegmentReference::CanUpdateOffsets and SegmentReference::UpdateOffsets (#346)
  • Add setter for TypeDefOrRefSignature::Type and GenericInstanceTypeSignature::Type (#338, thanks @JPaja)
  • Move AsmResolver.DotNet.Dynamic into a separate nuget package (#304).
  • Rename Entrypoint to EntryPoint (b6fa3ed).
  • Rename OptionalHeaderMagic::Pe32 and Pe32Plus to PE32 and PE32Plus (d954be0).
  • Let LazyVariable lock on itself (16367c1)
  • Consolidate ContinuousMetadataRange and RedirectedMetadataRange to a single struct MetadataRange (3bb6b6a)
  • Let OneToManyRelation return a ValueSet with a struct enumerator instead of a generic ICollection (07b09c3)
  • Change type of MemberClonerContext::Importer to CloneContextAwareReferenceImporter.

Performance Improvements

  • Precomputing capacity properties for lists containing read metadata reduced memory consumption by roughly 5%-10% (#316)
  • Many small buffers and temporary memory streams are being reused during the writing process where possible. This reduces the number of allocations by up to 20% (#317).
  • Various reader context types are now stack allocated (#356).
  • Custom attribute signatures are now only read when absolutely necessary, preventing many unnecessary expensive type resolutions and thus many allocations (#336, #351).
  • MethodImplementation now implements IEquatable<MethodImplementation>, drastically reducing allocations and increasing performance for large binaries with lots of interface implementations (d10cf47).
  • Replace PE section lookup LINQ code with expanded for loop, drastically reducing allocations in general (1ff0a0f)
  • OneToManyRelation now returns a ValueSet with a struct enumerator instead of an interface (07b09c3)

Bug Fixes

  • Modifications to a LazyList (and all its derivatives) are now guarded with locks to prevent concurrency issues (#364).
  • Importing a nested type via System.Reflection now correctly imports the declaring type. This was especially a problem when converting DynamicMethods to a DynamicMethodDefinition. (#365)
  • Various CIL body parsing improvements, allowing for better recovery of invalid method body code / data (#361)
  • Metadata stream selection is now properly reflecting the behavior of the runtime for both compressed and EnC metadata (#352)
  • ExpandMacros correctly expands ldarga.s and bge.un.s to their correct expanded forms (#322, thanks @N78750469)