Releases: Washi1337/AsmResolver
Hotfix 4.11.2
Note: v4.11.x is very likely the last minor version bump for version 4 of AsmResolver. We are working on version 5.0, which will include some breaking changes. There might be a few more hotfixes before 5.0 will be merged into master, but no more new features will be introduced until the next major version bump.
Bug Fixes
- 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.1
Note: v4.11.x is very likely the last minor version bump for version 4 of AsmResolver. We will be working on version 5.0, which will include some breaking changes. There might be a few hotfixes before 5.0 will be merged into master, but no more new features will be introduced until the next major version bump.
Bug Fixes
- 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)
See full change log of 4.11.0
4.11.0
Note: this is very likely the last minor version bump for version 4 of AsmResolver. We will be working on version 5.0, which will include some breaking changes. There might be a few hotfixes before 5.0 will be merged into master, but no more new features will be introduced until the next major version bump.
New Features
- Add
ModuleDefinition.DefaultImporter
reference importer (#302) - Add convenience factory methods for building up and importing new type and member references directly from
IResolutionScope
andITypeDefOrRef
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 (d7e11c8)
- Reduced boxing of row structures in metadata tables (46f4d09)
- Updated System.Text.Json to 6.0.4 (#313)
Bug Fixes
- Fixed a race condition that would result in collections such as
type.Methods
andtype.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) - Fixed an issue where
MethodSignature.CreateStatic
andMethodSignature.CreateInstance
would not set theGeneric
flag in its header when a non-zero generic parameter count was provided (b12957d) - Names of
MethodDefinition
are now properly stored asUtf8String
s instead ofstring
(e888e43) MethodDefinition::FullName()
andMemberReference::FullName()
now include any generic parameters defined in their signatures (bffed66).
4.10.0
New Features
- 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 redirectsSystem.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 anIsImportedInModule
convenience method. PropertyDefinition
andEventDefinition
now define aSetSemanticMethods
method for attaching new get/set/add/remove/fire methods easily (#168, #286, thanks @ds5678)AsmResolver
,AsmResolver.PE.File
,AsmResolver.PE
andAsmResolver.Win32Resources
are now trimmable packages (#287, thanks @ds5678).- Various small performance improvements (#278)
Bug Fixes
- Fixed an issue where importing a nested type definition would not properly import the parent type (#273, #275)
- Fixed an issue where importing complex type signatures would not be fully imported in some scenarios (#268, #274)
- Fixed a concurrency issue in
DefaultMetadataResolver
(#270, thanks @SamboyCoding) - Fixed an issue in .NET Core installation folder detection on UNIX systems (fb3516a)
Community
- We opened a Discord server. See #291.
4.9.0
New Features
- 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
andConstant.FromValue
factory methods (#244, thanks @ds5678) - Add
MakeGenericInstanceMethod
helper method (5b49ddc) - Method bodies that could not be parsed (e.g. native entry points) are now represented using
UnresolvedMethodBody
(#255). - Add
CilInstruction.ReplaceWith
andCilInstruction.ReplaceWithNop
helper methods (#259). - Various performance improvements in
CilAssembler
, looking up serialized metadata members, and other places (#260, #261, 826157f, #265). - Bumped package version of
System.Text.Json
to6.0.2
(#258, thanks @ds5678)
API Deprecations
FieldSignature.CreateInstance
andFieldSignature.CreateStatic
are deprecated. Use the constructor ofFieldSignature
orFieldDefinition
instead.
Bug Fixes
- Fixed an issue where duplicated metadata members would not be preserved by the metadata builder, even with PreserveAll enabled (#252 , #253)
- Fixed an issue where custom attributes using arguments such as
typeof(object)
caused the resolution scope ofCorLibTypeSignature
s to be removed from the list of imported assemblies (#263, #264). TypeNameParser
now correctly reuses theAssemblyReference
instances that were imported into the parent module if available.- Creating new modules no longer adds the corlib assembly reference twice to
ModuleDefinition.AssemblyReferences
.
4.8.0
New Features
- .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 allBootstrapperSegment
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
(0149d5f). ModuleDefinition.FromModule
convenience method to load a module from aSystem.Reflection.Module
instance (#233, #234).- Various convenience Win32 resource directory traversal methods (#220)
GenericContext
now supports partial resolution of generic parameters within signatures +GenericContext.FromXXX
convenience methods (#225, thanks @JPaja).BlobStream
,StringsStream
,UserStringsStream
andGuidStream
now come with aTryFindXXXIndex
method for finding an index of an existing blob (#227, #229).- XML documentation for all CIL opcodes (#231, thanks @ds5678).
- Reduced the use of seeking in the output file when writing large .NET modules (#232).
Bug Fixes
- Fixed an issue where
FieldDefinition.IsAccessibleFromType
returned the wrong result when the declaring type was accessible (#217, thanks @ElektroKill) - Fixed an issue where
TypeNameBuilder
did not parse generic type arguments properly (#222, #223, thanks @JPaja). - Fixed an issue where a
CustomAttribute
with anull
argument on aSystem.Type
parameter would parse incorrectly (#224). - Fixed an issue where
DotNetDirectoryFlags.ILLibrary
was incorrectly used to identify whether the output file needs an entrypoint or not (2b32f30) - Fixed an issue where
AssemblyDefinition.Write
would not work properly when providing a relative path as output file path (#238, thanks @ds5678) - Fixed an issue regarding the selection of GAC directories during assembly resolution (#240, #242)
- Fixed an issue regarding method resolution that do not use the HideBySig flag (e.g. in modules written in VB.NET) (#241, #243)
Hotfix 4.7.1
For the remainder of the change log of 4.7.x, refer to 4.7.0
Bug fixes
- 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.0
New Features
- 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 markedvirtual
(#190, thanks @CursedLand).- Add
MethodSignature.ReturnsValue
convenience property (#183, thanks @CursedLand). - Add
AssemblyDefinition.HasManifestModule
convenience property (b925d5b).
Bug fixes
- Fixed an issue where an invalid FieldRVA value would crash AsmResolver's metadata parser, regardless of whether
EmptyErrorListener
was provided in the module reader parameters (#184). - Fixed an issue where the
TokenAllocator
would incorrectly assign tokens to members, resulting in conflicting RIDs being used in the final assembly (#187). - Fixed an issue where stack behavior would be computed incorrectly for method calls with a
modreq
ormodopt
modifier added to their return type (#193, thanks @zsr2531). - Fixed an issue where both the file offset and RVA were incorrectly set to zero for the metadata directory and structures within this data directory (#194).
- Fixed various custom attribute type name parsing issues regarding whitespaces (af36ad8).
- Fixed an issue where RVAs in base relocation blocks were not calculated properly (5f07707)
- Fixed an issue where incorrect
GetHashCode
implementations were used inSignatureComparer
, resulting in random hash codes for some types of metadata members (706f5b0). - Fixed an issue where an empty exports directory with zero exported symbols would let AsmResolver believe it is an invalid export directory (b2dde79)
- Various null checks added and overall stability improvements.
4.6.0
New Features:
- Replace
IBinaryStreamReader
classes with stack allocatedBinaryStreamReader
structs, reducing memory consumption by up to 40% (#136, #166). - Added concept of
IFileService
s andIInputFile
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
(655adc8) - Add shortcut method
BlobSignature.MakeStandAloneSignature
(08e510e) - Add
ManifestResource.GetReader
method (#161, thanks @JPaja). - Add
PropertyAttributes.None
(#170, thanks @oSumAtrIX) - Add support for unmanaged calling convention method signatures (a58b4c9)
- Add support for managed entrypoints defined in a separate child module (975bda9)
- Various improvements in reader and writer diagnostics.
Bug Fixes:
- Importing corlib
TypeDefinition
s as signature now properly converts toCorLibTypeSignature
instances instead ofTypeDefOrRefSignature
(#160) - Fixed a bug where a
NullReferenceException
would be thrown when trying to resolve .NET Core dependencies, while running AsmResolver using a .NET Framework host (695235e). - Set default hash algorithm for assemblies to SHA1, preventing all kinds of problems with invalid / incomplete metadata (a9f5eda)
- Fixed incorrect column type in MethodSpec's Method column (afcb7a1).
- Fixed an error where the scope of a parsed type from string was not set properly if the type refers to a type in the same module (d18fa67).
- Fixed a bug where
OptimizeMacros
would crash if theunaligned
prefix opcode was present in the method body (7b8e269). - Fixed a bug where
ldc.i4.s
and similar instructions would have the wrong operand set after callingAdd(CilOpCode, int)
(ad77103) - Fixed a bug where certain new metadata members (e.g. type references) that were manually assigned a metadata token using the
TokenAllocator
would not appear in the final binary (#175, #176). - Fixed a bug where assembly linked resources would be parsed incorrectly and throw exceptions on writing (7fe14d5)
Hotfix 4.5.1
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.