A library for creating, reading and editing PE files and .NET modules.
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.
See full change log of 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.
ModuleDefinition.DefaultImporter
reference importer (#302)IResolutionScope
and ITypeDefOrRef
instances (#303, #312)type.Methods
and type.Fields
being initialized incorrectly when accessed from multiple threads at the same time (#299, #300)System.Reflection
produced a member reference with an invalid signature (#307, #308)MethodSignature.CreateStatic
and MethodSignature.CreateInstance
would not set the Generic
flag in its header when a non-zero generic parameter count was provided (b12957d4cdecdb0626c97598cdfcca26c57281a4)MethodDefinition
are now properly stored as Utf8String
s instead of string
(e888e433220d7f1fedf8053d1d3b8cd897244cbe)MethodDefinition::FullName()
and MemberReference::FullName()
now include any generic parameters defined in their signatures (bffed664253f3eb1a1247aa913f4b6d2bf5e17df).PEFile
(#284).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).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).DefaultMetadataResolver
(#270, thanks @SamboyCoding)DataBlobSignature.FromValue
and Constant.FromValue
factory methods (#244, thanks @ds5678)MakeGenericInstanceMethod
helper method (5b49ddc65a51aa2fdd877af831fc1a718f1dc421)UnresolvedMethodBody
(#255).CilInstruction.ReplaceWith
and CilInstruction.ReplaceWithNop
helper methods (#259).CilAssembler
, looking up serialized metadata members, and other places (#260, #261, 826157feb131a461f317f6990240328272f1f7be, #265).System.Text.Json
to 6.0.2
(#258, thanks @ds5678)FieldSignature.CreateInstance
and FieldSignature.CreateStatic
are deprecated. Use the constructor of FieldSignature
or FieldDefinition
instead.typeof(object)
caused the resolution scope of CorLibTypeSignature
s to be removed from the list of imported assemblies (#263, #264).TypeNameParser
now correctly reuses the AssemblyReference
instances that were imported into the parent module if available.ModuleDefinition.AssemblyReferences
..resources
manifest resource files (#169, #216)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.MachineType
(0149d5fb536256777b3f33573f3254d4c7584f2f).ModuleDefinition.FromModule
convenience method to load a module from a System.Reflection.Module
instance (#233, #234).GenericContext
now supports partial resolution of generic parameters within signatures + GenericContext.FromXXX
convenience methods (#225, thanks @JPaja).BlobStream
, StringsStream
, UserStringsStream
and GuidStream
now come with a TryFindXXXIndex
method for finding an index of an existing blob (#227, #229).FieldDefinition.IsAccessibleFromType
returned the wrong result when the declaring type was accessible (#217, thanks @ElektroKill)TypeNameBuilder
did not parse generic type arguments properly (#222, #223, thanks @JPaja).CustomAttribute
with a null
argument on a System.Type
parameter would parse incorrectly (#224).DotNetDirectoryFlags.ILLibrary
was incorrectly used to identify whether the output file needs an entrypoint or not (2b32f3089a38687a2521f37e5e27b6f6af6ddbc5)AssemblyDefinition.Write
would not work properly when providing a relative path as output file path (#238, thanks @ds5678)For the remainder of the change log of 4.7.x, refer to 4.7.0
EndLabel
was not considered during the label verification of a CIL body.mscoree.dll
was not included as module import in the build process when the binary targeted the i386 machine type.GenericContext
.#Strings
stream, resulting in smaller output files (#192, #204).MetadataTable<TRow>.GetRowRef
method.DefaultMethodBodyReader.ReadMethodBody
is now marked virtual
(#190, thanks @CursedLand).MethodSignature.ReturnsValue
convenience property (#183, thanks @CursedLand).AssemblyDefinition.HasManifestModule
convenience property (b925d5b934aa01d24e9d727f5963d5f8b149a3af).EmptyErrorListener
was provided in the module reader parameters (#184).TokenAllocator
would incorrectly assign tokens to members, resulting in conflicting RIDs being used in the final assembly (#187).modreq
or modopt
modifier added to their return type (#193, thanks @zsr2531).GetHashCode
implementations were used in SignatureComparer
, resulting in random hash codes for some types of metadata members (706f5b0ae5c8c9e2b32cb279b1d95fcb43825270).IBinaryStreamReader
classes with stack allocated BinaryStreamReader
structs, reducing memory consumption by up to 40% (#136, #166).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).HINSTANCE
/ module base address (#177).FnPtr
) type signatures (#167, #172)MethodSignature.MakeFunctionPointerType
(655adc89f1019fd03ca4ffe78cbf49eb3529b047)BlobSignature.MakeStandAloneSignature
(08e510e4ff04cfa876299cc512e124b93b86828c)ManifestResource.GetReader
method (#161, thanks @JPaja).PropertyAttributes.None
(#170, thanks @oSumAtrIX)TypeDefinition
s as signature now properly converts to CorLibTypeSignature
instances instead of TypeDefOrRefSignature
(#160)NullReferenceException
would be thrown when trying to resolve .NET Core dependencies, while running AsmResolver using a .NET Framework host (695235e98c3de684ca496424d178a9555ac3516b).OptimizeMacros
would crash if the unaligned
prefix opcode was present in the method body (7b8e2691934cf7ca951c27c578834437e68709dd).ldc.i4.s
and similar instructions would have the wrong operand set after calling Add(CilOpCode, int)
(ad77103180856febc3eab87c2c1fe2fe4a12d441)TokenAllocator
would not appear in the final binary (#175, #176).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.
runtimeconfig.json
file parsing and interpretation (#137).TypeMemoryLayout.IsPlatformDependent
flag to easily determine whether a memory layout is dependent on the bitness of the environment (#143 #153)ICilOperandResolver
to CilDisassembler
.ITypeSignatureVisitor<in TSTate, out TResult>
variant (#147, thanks @JPaja)=
in their full name would result in an incorrect parsing of the CA signature (460bcf22ba67e5dd9a1d2730a0cd7177a67f2548)TryLookupString
returned false
even if the string was found successfully (5fcc4d2d32330c43627ef5b249c3335376f7e20c)GenericParameter.Index
would not be updated before serialization to PEImage
(#145, thanks @Charterino)ldarg
would result in the wrong operand being selected (#155, thanks @oSumAtrIX)