GitPedia
Washi1337

Washi1337/AsmResolver

A library for creating, reading and editing PE files and .NET modules.

28 Releases
Latest: 1mo ago
6.0.0v6.0.0Latest
Washi1337Washi1337ยท1mo agoยทMay 16, 2026
GitHub

๐Ÿ“‹ Changes

  • Expanded Architecture Support: A new `Platform` abstraction enables support for more architectures, including ARM32 and ARM64. Furthermore, this version revamps the entire PE file building mechanism, and introduces `TemplatedPEFileBuilder` as a flexible foundation for building native Windows PEs and mixed-mode .NET modules.
  • Multi-Assembly Processing: A single .NET assembly is rarely fully self-contained and typically references code in external assemblies (e.g., DLLs). This version introduces `RuntimeContext`, which mimics an `AppDomain` or `AssemblyLoadContext`. It is responsible for automating assembly resolution and shared metadata caching, and significantly improves .NET cross-binary processing.
  • API Simplification: The API has undergone many Quality-of-Life improvements, removing many redundant interfaces and namespaces, adding more NRT annotations, and improving AOT trimming support. Furthermore, it is no longer required to manually import metadata as AsmResolver now auto-importing references at build time.
  • Improved Portability: With the help of @MonoMod, we now support more build targets, including .NET Framework 3.5. We thereby extend compatibility to legacy environments like older versions of Unity/Mono.
  • Performance Boosts: Next to `RuntimeContext`'s shared caching model and more lazy evaluation, we now leverage `Span<T>`, source generators, and other modern .NET features in more places, delivering significantly faster PE processing with fewer allocations and lowering memory consumption across the board.

๐Ÿ“‹ General Changes

  • <details>
  • <summary>12 changes</summary>

๐Ÿ“ฆ Improvements

  • Remove `System.Text.Json` as a hard dependency for older .NET (FX) targets (#450, #538).
  • Remove many redundant interfaces (e.g., `IPEFile` and `IPEImage`) (#445, #561, #562).
  • Flatten many namespaces, drastically reducing the required using directives for typical use (#446, #560).
  • Use `EmptyErrorListener.Instance` for reading input files by default (#472, #564).
  • Add `IInputFile::BaseAddress` (a1af121)
  • Add `IReadOnlyList<T>` explicitly to collection classes for better compatibility with lower .NET targets (62ed463)
  • Add `PatchContext::WriterBase` (#653)

โšก Performance

  • Improve the internal mechanisms for lazy-initialization using source generated lazy properties, significantly reducing the number of allocations across the entire library (#683)
  • Use built-in memory-mapped file APIs on newer .NET build targets (#619, thanks @teo-tsirpanis)
  • Optimize `BinaryStreamWriter` for .NET 10+ targets (#695, thanks @Sergio0694).
  • Add `Utf8String::CreateUnsafe` factory method which avoids cloning many small byte arrays (#709, thanks @Windows10CE)
  • Let `Utf8String` implement `ISpanFormattable` and `IUtf8SpanFormattable` (#699, thanks @Sergio0694).
  • </details>

๐Ÿ“ฆ AsmResolver.PE.File

  • <details>
  • <summary>8 changes</summary>

๐Ÿ“ฆ Improvements

  • Change `PESection::Name` to be of type `Utf8String` (#454).
  • Add `OptionalHeader::SetDataDirectory` helper method (7b27c91).
  • Add `DataDirectory.CreateForSegment` helper method (7b27c91).
  • Add support for debug data to be read from EOF / overlay segments (#583, thanks @DaZombieKiller).
  • Add `BinaryStreamReader::ReadBytes(int32)` (5863886)

โšก Performance

  • Add support for reading PE files from streams (#664, thanks @ds5678)

๐Ÿ› Bug Fixes

  • Fix an issue where UTF8 strings were not concatenated properly (#650, thanks @ds5678)
  • Fix an issue related to patched segments not being serialized properly to the final PE file (#653)
  • </details>

๐Ÿ“ฆ AsmResolver.PE

  • <details>
  • <summary>40 changes</summary>

๐Ÿ“ฆ Improvements

  • Add `Platform` class (#643, #653)
  • Add `PEImage::ToPEFile`
  • Add `EmptyDebugDataSegment` (798a4ed)
  • Exception data directory improvements:
  • Rename `IExceptionDirectory::GetEntries` to `GetFunctions` (#643)
  • Add `IRuntimeFunction::UnwindInfo` and add support for ARM `RUNTIME_FUNCTION` parsing (#643)
  • .NET metadata directories improvements:
  • Add `TargetRuntimeProber` to detect the target runtime of a PE image without loading it as a full `ModuleDefinition` (#704).
  • + 12 more

โšก Performance

  • Let all `IMetadataRow` structures implement `IEquatable`, avoiding lots of boxing and reflection calls (aaf4d6e)
  • Add `FastCilReassembler` for allocationless patching of CIL method bodies (#672)

๐Ÿ› Bug Fixes

  • 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 an issue where the RSDS parser would incorrectly include a null terminator byte in the PDB path (#584, thanks @Windows10CE)
  • Fix an issue where zero base relocation blocks were duplicated unnecessarily (fd9cbb5)
  • Fix an issue where computing the offset range for a single metadata row would be incorrect (e1f3a9c)
  • Fix an issue where some ReadyToRun metadata read from a file would not be assigned an offset/rva (490176a)
  • Fix an issue where offsets in TLS data directories would not roundtrip properly (#706, #708).
  • Fix an issue where relocation table entries would be duplicated or misaligned in some cases (#708).
  • Fix an issue where debug data directories would not be read properly when files are loaded using MMIO (#718, thanks @js6pak).
  • + 10 more

๐Ÿ“ฆ AsmResolver.PE.Win32Resources

  • <details>
  • <summary>1 change</summary>

๐Ÿ“ฆ Improvements

  • Rewrite `IconResource` into a more intuitive API that also supports language-specific icons and cursors (#565).
  • </details>

๐Ÿ“ฆ AsmResolver.DotNet

  • <details>
  • <summary>62 changes</summary>

๐Ÿ“ฆ Improvements

  • Assembly resolution improvements:
  • Introduce `RuntimeContext`s, allowing for better multi-assembly processing.
  • Remove all parameterless `Resolve` methods in favor of the new `Resolve` and `TryResolve` methods taking a `RuntimeContext`. Additionally, all properties and methods that may have implicitly required resolution will now take a `RuntimeContext` as well.
  • Simplified and improved `DotNetCorePathProvider`, add `MonoPathProvider` and add NIX support (#657)
  • Add various known corlib targets for .NET 9, 10, 11 and generic fallback support for future unsupported versions (#548, #645, #651, 8e11fef, #702, 55c847f, thanks @Sergio0694 and @ds5678).
  • Add more default assembly resolvers: `NullAssemblyResolver`, `PathAssemblyResolver` and `BundleAssemblyResolver` (2fc1872, #721, thanks @js6pak)
  • Metadata builder improvements:
  • Reference importing is now done automatically at build-time. In most cases there is no need for `ReferenceImporter`/`ImportWith` calls any more.
  • + 35 more

โšก Performance

  • Add lazy initialized `SerializedCilMethodBody` that aggressively avoids unnecessarily fully decoding a method body where possible (#672)
  • Add allocation-less `HasX` properties, drastically reducing memory footprint when roundtripping assemblies with no or only minor changes (#680)
  • Use built-in `RuntimeTypeHandle::FromIntPtr` of .NET 7+ for resolving type handles in dynamic methods when possible (#617, thanks @teo-tsirpanis)
  • Optimize `CorLibTypeFactory.FromType` to avoid many unnecessary string allocations (#717, thanks @wondercrash).

๐Ÿ› Bug Fixes

  • Various blob signature parsing fixes:
  • Fix an issue where `System.Enum` itself would incorrectly be classified as a value type (#635. #636, thanks @AndrewSav)
  • Various custom attribute parsing fixes (#598, #616, #647, #648, 61f9115, #697, thanks @Windows10CE)
  • Fix an issue related to reading and writing signed compressed integers for lower bounds in array type signatures (c7bc9f6).
  • Various builder fixes:
  • Fix an off-by-one error that would result in some binaries with large amounts of methods and custom attributes to throw `BadImageFormatExceptions` (#608, #609)
  • Ensure a newly created `<Module>` type always has RID 1 (#625)
  • Fix an issue where unreachable exception handlers in a CIL method body would incorrectly still be included in max stack calculation (#652)
  • + 17 more

๐Ÿ“ฆ AsmResolver.Symbols.Pdb

  • <details>
  • <summary>2 changes</summary>

๐Ÿ“ฆ Improvements

  • Add rich models for `S_TRAMPOLINE` and `S_GTHREAD32` and `S_LTHREAD32` PDB symbols (#711, thanks @dongle-the-gadget).
  • Add missing `Class2`, `Structure2`, `Union2` and `Interface2` PDB leaf record types (#714, thanks @ds5678).
  • </details>
6.0.0-rc.1v6.0.0-rc.1Pre-release
Washi1337Washi1337ยท3mo agoยทMarch 6, 2026
GitHub

๐Ÿ“‹ Changes

  • Add `NullAssemblyResolver` and `PathAssemblyResolver` (#721, thanks @js6pak)
  • Optimize `CorLibTypeFactory.FromType` to avoid many unnecessary string allocations (#717, thanks @wondercrash).
  • Add `ImportWith` methods with more specific return types (#720, thanks @js6pak).
  • Add support for `IMemberDescriptor` equality checks in `SignatureComparer` (#722, thanks @js6pak).
  • Add missing NRT attributes for various `TryResolve` methods (e2bf223392c433e27b1ae2455da864a384601176).
  • Relax restrictions on input corlib for `CorLibTypeFactory`, making it easier to create one yourself (367968a73ab33e4fed98812c2f7662bbd8c96e9a)
  • Remove redundant factory methods and remove `params` overloads in favor of using more explicit collection expressions for parameter types.
  • Fix an issue where `TargetRuntimeProber` would crash with an `ArgumentNullException` when using AsmResolver in a .NET FX host (#723).
  • + 4 more
6.0.0-beta.6v6.0.0-beta.6Pre-release
Washi1337Washi1337ยท4mo agoยทFebruary 23, 2026
GitHub

๐Ÿ“‹ Changes

  • Breaking change: Revamp of metadata resolution system and `RuntimeContext`s (#704).
  • `IAssemblyResolver` is drastically simplified and is no longer responsible for caching anymore.
  • `IMetadataResolver` and friends are removed.
  • `RuntimeContext` construction is drastically simplified.
  • `RuntimeContext` is now responsible for resolving and maintaining assembly and metadata caches.
  • Add `RuntimeContext::LoadAssembly` methods to load assemblies into the context (similar to `AssemblyDefinition::FromX`, but using the context for reader parameters, cache and automatic wiring of dependencies).
  • Remove all `Resolve` methods in favor of a `Resolve` and `TryResolve` method taking a `RuntimeContext`. Additionally, all properties and methods that may have implicitly required resolution will now take a `RuntimeContext` as well.
  • `SignatureComparer` can now take a `RuntimeContext` in its constructor. When none is provided, the comparer will no longer try to resolve forwarder types and compare signatures as-is.
  • + 18 more
6.0.0-beta.5v6.0.0-beta.5Pre-release
Washi1337Washi1337ยท7mo agoยทNovember 24, 2025
GitHub

๐Ÿ“‹ Changes

  • Add `FastCilReassembler` for allocationless patching of CIL method bodies (#672)
  • Add `TypeAttributes::ExtendedLayout` and `TypeDefinition::IsExtendedLayout` to reflect .NET 10 runtime changes to struct layout (dcc9162aecbdaeb8fc30655f57f900520066856e)
  • Add `MethodImplAttributes.Async` and `MethodDefinition::IsRuntimeAsync` to reflect .NET 10 runtime changes on async methods (#687, thanks @Windows10CE)
  • Add automatic importing of external type/field/method definitions (#689, thanks @Windows10CE)
  • Add .NET 10 build targets (8e11fef929eebbf40eccf23c8809fe07a59cbf0b)
  • Improve the internal mechanisms for lazy-initialization using source generated lazy properties, significantly reducing the number of allocations across the entire library (#683)
  • Add lazy initialized `SerializedCilMethodBody` that avoids unnecessarily fully decoding a method body where possible (#672)
  • Add allocation-less `HasX` properties, reducing memory footprint of roundtripping assemblies (#680)
  • + 10 more
6.0.0-beta.4v6.0.0-beta.4Pre-release
Washi1337Washi1337ยท9mo agoยทSeptember 8, 2025
GitHub

๐Ÿ“‹ Changes

  • Add ARM64 platform support, including native thunk stub codegen and exception handlers (#643)
  • Add ARM32 platform support, including native thunk stub codegen (#653)
  • Add Generic platform for unsupported platforms to prevent unnecessary crashes on opening/saving these types of files (#653)
  • Add `Platform::GetOrGeneric` factory method (#653)
  • Add `IRuntimeFunction::UnwindInfo` (#643)
  • Add new `GenericParameterAttributes::AllowByRefLike` attribute and corresponding `GenericParameter::HasAllowByRefLike` property (#623, thanks @ds5678)
  • Add `PatchContext::WriterBase` (#653)
  • Add `MonoPathProvider` (#657)
  • + 41 more
6.0.0-beta.3v6.0.0-beta.3Pre-release
Washi1337Washi1337ยท1y agoยทMarch 8, 2025
GitHub

๐Ÿ“‹ Changes

  • Add `IReadOnlyList<T>` explicitly to collection classes for better compatibility with lower .NET targets (62ed463f78970f310a4be0d332e0104f8146fc6a)
  • Mark `ManagedPEFileBuilder` and `UnmanagedPEFileBuilder`'s method body and field RVA data methods as `virtual` (166b541406808348c65dff81ffaee4eded6df698)
  • Add `PEReaderContext::Platform` that can be reused throughout the PE parsing stage (0660ccb6bd3b8db2396ff0b204c334bc88862e71)
  • Ensure `Culture` appears before `PublicKeyToken` in assembly full names to keep Mono happy (#614, thanks @ds5678)
  • Rework type signature parsing in custom attribute blobs (#598, #616)
  • Use built-in `RuntimeTypeHandle::FromIntPtr` of .NET 7+ for resolving type handles in dynamic methods when possible (#617, thanks @teo-tsirpanis)
  • Fix an issue where parsed `TypeSignature`s in a Custom Attribute would not always have the correct `IsValueType` property set (#598, #616)
  • Fix an issue where R2R x86_64 RuntimeFunctions sections could not be read correctly for non-Windows binaries (0660ccb6bd3b8db2396ff0b204c334bc88862e71)
  • + 2 more
6.0.0-beta.2v6.0.0-beta.2Pre-release
Washi1337Washi1337ยท1y agoยทJanuary 11, 2025
GitHub

๐Ÿ“‹ Changes

  • Add more nullable attributes (#575, #604, thanks @ds5678)
  • Add `GenericParameter::Variance` property (#578, thanks @ds5678)
  • `SentinelTypeSignature` is now a singleton (#581, thanks @ds5678)
  • Add `Insert` and `TryGetRidByKey` to `MetadataTable` (0acd8ca2f7e5e038e4b2b1ca54f9be9e52cc156b)
  • Add support for debug data to be read from EOF / overlay segments (#583, thanks @DaZombieKiller).
  • Add `EmptyDebugDataSegment` (798a4edc1eaeeb7f65358893458ad0f2067a6c11)
  • Add `BinaryStreamReader::ReadBytes(int32)` (5863886a328240e84c7cd707fe751ad34241da13)
  • Let `IMetadataTable` implement `ISegment` (9251f1976501385717d13b6d67dc2aab9a77f992)
  • + 13 more
6.0.0-beta.1v6.0.0-beta.1Pre-release
Washi1337Washi1337ยท2y agoยทJune 15, 2024
GitHub

๐Ÿ“‹ Changes

  • Add `UnmanagedPEFileBuilder`, allowing for `PEImage`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&lt;T&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.runtimehelpers.isreferenceorcontainsreferences?view=net-8.0) but determined statically (#530, #539).
  • Add `BundleAssemblyResolver` (2fc18727d2b3de02f78d31d4572fa43d2b504599)
  • + 20 more
5.5.1v5.5.1
Washi1337Washi1337ยท2y agoยทFebruary 27, 2024
GitHub

๐Ÿ“‹ Changes

  • Add support for importing function pointer type signatures via reflection (#523, thanks @Windows10CE).
  • Add `BinaryStreamWriter::AlignRelative` (af2e49d434a6e6071a3f03f6930858207b992c08)
  • Add .NET 8.0 target.
  • Fix a couple issues regarding hash computation of generic instance and custom modifier type signatures in `SignatureComparer` (#512, thanks @rstarkov)
  • Fix an issue where optimizing `ldloca` and `ldarga` opcodes would not shorten to their shorter variants (9ab4e94d5e18e6c5fe373a22fcb31d9f2add3554)
  • Fix an issue where the same metadata members could be added twice to the exact same collection, resulting in ownership problems (#513)
  • Fix an issue where .NET modules containing a metadata directory at an unaligned offset would read stream headers incorrectly (af2e49d434a6e6071a3f03f6930858207b992c08).
5.5.0v5.5.0
Washi1337Washi1337ยท2y agoยทNovember 19, 2023
GitHub

๐Ÿ“‹ Changes

  • Add support for low level .NET ReadyToRun assembly parsing (#294, #495). See [documentation](https://docs.washi.dev/asmresolver/guides/peimage/ready-to-run.html).
  • Add basic `Span<T>` support for `IDataSource`s and `Utf8String` (#483, thanks @DaZombieKiller).
  • Add option to suppress .NET resource data deduplication (#492).
  • Add `TypeDefinition::GetConstructor`, `MethodDefinition::CreateConstructor` and similar (#480).
  • Add `ReferenceTable` primitive segment class, representing structures like VTables that can be directly used as a writable `ISegment`.
  • Add `BinaryStreamReader::RemainingLength`.
  • Reduce allocations of null `SegmentReference`s.
  • Add `netstandard2.1` target.
  • + 15 more
5.4.0v5.4.0
Washi1337Washi1337ยท2y agoยทJuly 16, 2023
GitHub

๐Ÿ“‹ Changes

  • Add read/write support for PE certificate tables (#451).
  • Add support for arbitrary symbols to be references in `NativeMethodBody` (#444, #449).
  • Let assembly resolution mechanism respect `ModuleReaderParameters::WorkingDirectory` (#438, #441).
  • Add read/write support for `ExportedSymbol::IsForwarder` (#437, #440).
  • Add `ManagedPEFileBuilder::ErrorListener` (#468).
  • Allow for `ITypeDescriptor::Scope` to be `null` and of type `ModuleDefinition`. (#466)
  • Add language identifiers for Version Info win32 resources (#457)
  • Add support for attaching multiple listeners to the `MemberCloner` (#461)
  • + 10 more
5.3.0v5.3.0
Washi1337Washi1337ยท3y agoยทMay 13, 2023
GitHub

๐Ÿ“‹ Changes

  • Add support for arbitrary `IErrorListener` objects as opposed to just `DiagnosticBag`s in `ManagedPEImageBuilder` (#367, thanks @ds5678 for the help!).
  • Add `LazyVariable<TOwner, TValue>`, reducing the number of allocations made by AsmResolver's internals significantly for larger binaries (#428)
  • Add `Platform::Is32Bit`, `Platform::Is64Bit` and `Platform::PointerSize` (#430)
  • Add `ZeroesSegment` and `ZeroesDataSource` for creating, reading and writing memory-efficient segments containing only zero bytes (#430).
  • Migrate documentation to DocFX with full API reference (2545e1a4374fd070e2b1f3667d7aa053c7caf3be).
  • Fixed an issue where `SignatureComparer::GetHashCode` for assembly descriptors did not respect the configuration flags passed into the constructor (#427, #429).
  • Field RVA reader now correctly supports reading the data for `IntPtr` and `UIntPtr` typed fields (#430).
  • Fixed an issue where reading from a section that is empty on the disk would throw even if the section has a non-zero virtual size (#430).
  • + 4 more
5.2.0v5.2.0
Washi1337Washi1337ยท3y agoยทMarch 22, 2023
GitHub

๐Ÿ“‹ Changes

  • Add `TypeSignature::IsCompatibleWith` and `TypeSignature::IsAssignableTo` methods (#421)
  • Add support for patching AppHost / SingleFileHost files without requiring the original SDK template file (#420, #424)
  • Add support for metadata tokens and unmanaged entry points in `DotNetDirectory` (#422)
  • Add `Parameter::GetOrCreateDefinition()` (#418, thanks @ElektroKill)
  • Add read support for PDB modules (#412)
  • Add read support for many more PDB symbol and leaf record types (#412)
  • Add basic metadata properties to `PdbImage` (e28df25ba827d4112e3edfebdfca980814c6a2e1)
  • Add `OptionalHeader::SetDataDirectory` helper method (8357a77dd4873facb5af59473e12a279dede12f7)
  • + 10 more
5.1.0v5.1.0
Washi1337Washi1337ยท3y agoยทJanuary 29, 2023
GitHub

๐Ÿ“‹ Changes

  • Add fluent patching API, allowing for easy and quick binary patches on PE files as well as individual segments (#403, #405). Check out the [documentation](https://asmresolver.readthedocs.io/en/latest/core/segments.html#patching-segments).
  • Add option to preserve spurious metadata streams and their order (#394, #406)
  • Add generic `ModuleDefinition::LookupMember<T>` and `ModuleDefinition::TryLookupMember<T>` methods (#392, #402)
  • Add `TypeDefinition::IsModuleType` (#391, thanks @sunnamed434)
  • Add rudimentary custom attribute validation, avoiding the accidental construction of incorrect attribute signatures (#389, #407)
  • Fix generic custom attributes reader errors (#397, #401)
  • Fix `GetModuleType()` behavior for .NET Core / .NET 5+ modules (#395, #396)
  • Fix .NET runtime detection when multiple corlibs references are present in the binary (a0bb1dfe282def3e6ec394fdae8170ad8ad599e4)
  • + 2 more
5.0.0v5.0.0
Washi1337Washi1337ยท3y agoยทDecember 7, 2022
GitHub

๐Ÿ“‹ Changes

  • Significant performance boost and memory consumption reductions across the board.
  • Rudimentary read support for PDB files (both Windows PDB and Portable PDB).
  • Various Quality-of-Life improvements of the API.
  • Overall robustness improvements against malformed input binaries and/or edge-cases.

โœจ New Features

  • Add read / write support for PortablePDB metadata streams and tables (#348)
  • Add a new WIP package called `AsmResolver.Symbols.Pdb` for reading and writing Windows PDB files using only managed code (#324, #326, #342, #368 (thanks @ds5678))
  • Add the notion of `IMemberClonerListener`s, 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)
  • Add `DotNetRuntimeInfo::IsNetCoreApp`, `IsNetFramework` and `IsNetStandard` properties for easily identifying whether a module targets .NET Core, .NET Framework or .NET Standard (505da7a9255a96bb649023f7a36b9d628a41ad63).
  • Add `SignatureComparer::Default` (#366, thanks @ds5678)
  • Add `TypeDefinition::IsByRefLike` (#358, #362)
  • Make `AsmResolver.DotNet` trimmable (#304, thanks @ds5678)
  • Add `MetadataTable::IsSorted` property (#348)
  • + 4 more

๐Ÿ’ฅ Breaking Changes

  • Make `SignatureComparer` immutable (#366, thanks @ds5678)
  • Refactor `class BlobReadContext` to a mutable `struct BlobReaderContext` (#356, c0283c721957ddbb149a1edbfa77b16b1555ae2d).
  • Change `ISegment::UpdateOffsets`'s method signature (#236, #346)
  • Remove `ITlsDirectory::ImageBase` and `CodeSegment::ImageBase` (#346)
  • Remove `SegmentReference::CanUpdateOffsets` and `SegmentReference::UpdateOffsets` (#346)
  • Add setter to `TypeDefOrRefSignature::Type` and `GenericInstanceTypeSignature::Type` (#338, thanks @JPaja)
  • Move `AsmResolver.DotNet.Dynamic` into a separate nuget package (#304).
  • Rename `Entrypoint` to `EntryPoint` (b6fa3edd613a0521c2fc9dbecb554605ac25706e).
  • + 7 more

โšก 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, c0283c721957ddbb149a1edbfa77b16b1555ae2d).
  • 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 (d10cf47c1eef0a7974f162285310b38df4621f3f).
  • Replace PE section lookup LINQ code with expanded for loop, drastically reducing allocations in general (1ff0a0ffaf70cd8f72e80650de184276add24148)
  • `OneToManyRelation` now returns a `ValueSet` with a struct enumerator instead of an interface (07b09c33cbc7a98d616e64c7baed834a767e20df)
  • Avoid many string allocations from `Utf8String` instances when resolving types and members (baf25ac0e3881e31698f0367a8ea03ce4fc0e652)
  • + 4 more

๐Ÿ› Bug Fixes

  • Modifications to a LazyList<T> (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 `DynamicMethod`s to a `DynamicMethodDefinition`. (#365)
  • Local variables are now properly resolved from `DynamicMethod`s initialized with `DynamicILInfo`.
  • Reading and importing complex `COR_ELEMENT_TYPE_INTERNAL` types should be fixed.
  • 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)
  • Importing via Reflection of `MethodBase`s that use generic parameters of its declaring type in its signature should now be fixed.
  • + 4 more
5.0.0-beta.2v5.0.0-beta.2Pre-release
Washi1337Washi1337ยท3y agoยทOctober 26, 2022
GitHub

๐Ÿ“‹ Changes

  • Local variables are now properly resolved from `DynamicMethod`s.
  • Reading and importing complex `COR_ELEMENT_TYPE_INTERNAL` types should be fixed
  • Importing via Reflection of `MethodBase`s that use generic parameters of its declaring type in its signature should now be fixed.
5.0.0-beta.1v5.0.0-beta.1Pre-release
Washi1337Washi1337ยท3y agoยทOctober 18, 2022
GitHub

๐Ÿ“‹ Changes

  • 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 `IMemberClonerListener`s, 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 (505da7a9255a96bb649023f7a36b9d628a41ad63).
  • Add `MetadataTable::IsSorted` property (#348)
  • + 28 more
Hotfix 4.11.2v4.11.2
Washi1337Washi1337ยท3y agoยทJuly 9, 2022
GitHub

๐Ÿ“‹ Changes

  • Fixed an issue where preserving type reference tokens would cause nested type references to get the wrong RIDs assigned occasionally and cause a "Token is already in use" error (#329, #330).
  • Fixed an issue where metadata resolution would fail if the target assembly used an older .NET version (#321, #331)
Hotfix 4.11.1v4.11.1
Washi1337Washi1337ยท4y agoยทMay 26, 2022
GitHub

๐Ÿ“‹ Changes

  • Fixed an issue where the full name of methods include generic parameter brackets even if the method didn't have generic parameters
  • Fixed a signature comparison issue where nested types with the same name but different declaring types were considered equal (#318, #319)
4.11.0v4.11.0
Washi1337Washi1337ยท4y agoยทMay 13, 2022
GitHub

๐Ÿ“‹ Changes

  • Add `ModuleDefinition.DefaultImporter` reference importer (#302)
  • Add convenience factory methods for building up and importing new type and member references directly from `IResolutionScope` and `ITypeDefOrRef` instances (#303, #312)
  • The possibility to define symbols that are local to a single native method body (#305, #310).
  • Add support for 64-bit address relocations in native method bodies (d7e11c89b6808ddd618ee7db29155467bf88b6d6)
  • Reduced boxing of row structures in metadata tables (46f4d09c76a9cf45d2a1a32e6c7becbd1437a333)
  • Updated System.Text.Json to 6.0.4 (#313)
  • Fixed a race condition that would result in collections such as `type.Methods` and `type.Fields` being initialized incorrectly when accessed from multiple threads at the same time (#299, #300)
  • Fixed an issue where importing an instance field via `System.Reflection` produced a member reference with an invalid signature (#307, #308)
  • + 3 more
4.10.0v4.10.0
Washi1337Washi1337ยท4y agoยทApril 9, 2022
GitHub

๐Ÿ“‹ Changes

  • Read/write support for End-of-File (EOF) data in `PEFile` (#284).
  • Read/write support for bundled and fully self-contained .NET applications (#246, #279).
  • `MemberCloner` now allows for customizing the behavior of the underlying reference importer, and now redirects `System.Object` from other .NET framework versions by default. This can be useful e.g. for cloning members into modules targeting a different .NET framework version (#93, #280, #283, thanks @ds5678).
  • Various metadata models now implement `IImportable`, which defines an `IsImportedInModule` convenience method.
  • `PropertyDefinition` and `EventDefinition` now define a `SetSemanticMethods` method for attaching new get/set/add/remove/fire methods easily (#168, #286, thanks @ds5678)
  • `AsmResolver`, `AsmResolver.PE.File`, `AsmResolver.PE` and `AsmResolver.Win32Resources` are now trimmable packages (#287, thanks @ds5678).
  • Various small performance improvements (#278)
  • Fixed an issue where importing a nested type definition would not properly import the parent type (#273, #275)
  • + 4 more
4.9.0v4.9.0
Washi1337Washi1337ยท4y agoยทMarch 11, 2022
GitHub

๐Ÿ“‹ Changes

  • Add .NET 7.0 file support (#256, thanks @ds5678)
  • Add .NET Core 3.1 and .NET 6.0 build targets for additional performance (#266).
  • Add `DataBlobSignature.FromValue` and `Constant.FromValue` factory methods (#244, thanks @ds5678)
  • Add `MakeGenericInstanceMethod` helper method (5b49ddc65a51aa2fdd877af831fc1a718f1dc421)
  • Method bodies that could not be parsed (e.g. native entry points) are now represented using `UnresolvedMethodBody` (#255).
  • Add `CilInstruction.ReplaceWith` and `CilInstruction.ReplaceWithNop` helper methods (#259).
  • Various performance improvements in `CilAssembler`, looking up serialized metadata members, and other places (#260, #261, 826157feb131a461f317f6990240328272f1f7be, #265).
  • Bumped package version of `System.Text.Json` to `6.0.2` (#258, thanks @ds5678)
  • + 5 more
4.8.0v4.8.0
Washi1337Washi1337ยท4y agoยทDecember 29, 2021
GitHub

๐Ÿ“‹ Changes

  • .NET 6.0 CorLib support (#228, thanks @ds5678)
  • Read/Write support for resource sets stored in `.resources` manifest resource files (#169, #216)
  • Read/Write support TLS data directories (#207, #218)
  • The concept of target platforms, represented by `Platform` classes. These are architecture specific services such as creating unmanaged thunk stubs. This simplifies the builder API a lot and removes the need for all `BootstrapperSegment` classes. Built-in support for i386 and AMD64 architectures.
  • Read/Write support for method definitions that are exported by a PE header export entry (#178, #179, #230).
  • Undocumented OS masks to `MachineType` (0149d5fb536256777b3f33573f3254d4c7584f2f).
  • `ModuleDefinition.FromModule` convenience method to load a module from a `System.Reflection.Module` instance (#233, #234).
  • Various convenience Win32 resource directory traversal methods (#220)
  • + 11 more
Hotfix 4.7.1v4.7.1
Washi1337Washi1337ยท4y agoยทOctober 4, 2021
GitHub

๐Ÿ“‹ Changes

  • Fixes an issue with invalid string offsets being calculated as a result of using multibyte UTF-8 code-points.
  • Assume explicitly typed CA arguments are enum types if they cannot be resolved.
  • Fixes an issue where `EndLabel` was not considered during the label verification of a CIL body.
  • Fixes an issue where `mscoree.dll` was not included as module import in the build process when the binary targeted the i386 machine type.
  • Adds missing NRT annotations in `GenericContext`.
4.7.0v4.7.0
Washi1337Washi1337ยท4y agoยทOctober 1, 2021
GitHub

๐Ÿ“‹ Changes

  • C#9.0 Nullable Reference Type (NRT) Annotations for all main packages of AsmResolver (#132, #185, #186, #188, #189).
  • Add implementations for ImpHash and TypeRefHash, which are used by many AV companies and other vendors to identify malware families based on imported symbols and type references (#195, #199, thanks @evandrix).
  • Preservation of names with invalid UTF-8 byte sequences in .NET metadata (#200, #201).
  • String folding in `#Strings` stream, resulting in smaller output files (#192, #204).
  • Metadata tables and rows are now fully mutable. Rows in a table can now be accessed and updated by reference using the new `MetadataTable<TRow>.GetRowRef` method.
  • Memory consumption reduced for some of the core reader methods.
  • `DefaultMethodBodyReader.ReadMethodBody` is now marked `virtual` (#190, thanks @CursedLand).
  • Add `MethodSignature.ReturnsValue` convenience property (#183, thanks @CursedLand).
  • + 10 more
4.6.0v4.6.0
Washi1337Washi1337ยท5y agoยทMay 26, 2021
GitHub

๐Ÿ“‹ Changes

  • Replace `IBinaryStreamReader` classes with stack allocated `BinaryStreamReader` structs, reducing memory consumption by up to 40% (#136, #166).
  • Added concept of `IFileService`s and `IInputFile`s. This allows for memory mapped I/O on input binaries as well as caching of previously read PE files. This vastly reduces the memory consumption on reading large PE files and resolving dependent dll files (#115, #174).
  • Revisited representation of raw CIL method bodies, which reduces the memory consumption of the reader significantly when dealing with large method bodies that have megabytes worth of code in them (#171, #180)
  • Add rich read/write support for VTable entries in the .NET data directory (#63, #173, thanks @Anonym0ose)
  • Add support for reading PEs and modules from a `HINSTANCE` / module base address (#177).
  • Add read/write support for function pointer (`FnPtr`) type signatures (#167, #172)
  • Add shortcut method `MethodSignature.MakeFunctionPointerType` (655adc89f1019fd03ca4ffe78cbf49eb3529b047)
  • Add shortcut method `BlobSignature.MakeStandAloneSignature` (08e510e4ff04cfa876299cc512e124b93b86828c)
  • + 14 more
Hotfix 4.5.1v4.5.1
Washi1337Washi1337ยท5y agoยทApril 5, 2021
GitHub

Removes the redundent xunit dependency from AsmResolver.DotNet (Thanks @HoLLy-HaCKeR) For full change log of 4.5.x, check the change log of [4.5.0](https://github.com/Washi1337/AsmResolver/releases/v4.5.0).

4.5.0v4.5.0
Washi1337Washi1337ยท5y agoยทMarch 29, 2021
GitHub

๐Ÿ“‹ Changes

  • Automatic detection of .NET Core / .NET 5+ installation folders (#105)
  • Add support for .NET Core / .NET 5+ `runtimeconfig.json` file parsing and interpretation (#137).
  • Significant improvements in assembly and member resolution (#104)
  • Add RSDS CodeView Debug Data read/write support (#140, thanks @dr4k0nia)
  • Add final token mapping as an artifact of the module serialization. This allows for easy lookup of members in the constructed PEImage for post processing (#121 #148).
  • Add `TypeMemoryLayout.IsPlatformDependent` flag to easily determine whether a memory layout is dependent on the bitness of the environment (#143 #153)
  • Add better CIL assembler/disassembler diagnostics, allowing for better support of invalid instruction streams without crashing the main readers/writers of AsmResolver (fb31c424af7267aec05d4a55e02a1c68f252ec66)
  • Add `ICilOperandResolver` to `CilDisassembler`.
  • + 12 more