- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 643
Comparing changes
Open a pull request
base repository: jbevain/cecil
base: 0.11.4
head repository: jbevain/cecil
compare: 0.11.5
Commits on Jul 2, 2021
-
Configuration menu - View commit details
-
Copy full SHA for ede17f9 - Browse repository at this point
Copy the full SHA ede17f9View commit details
Commits on Jul 22, 2021
-
Update the version of Microsoft.NETFramework.ReferenceAssemblies.net40 (
#787) since is detected as a package downgrade and a failure in newer SDKs
Configuration menu - View commit details
-
Copy full SHA for 2f1077d - Browse repository at this point
Copy the full SHA 2f1077dView commit details
Commits on Aug 12, 2021
-
* Pose the problem * Quick and v dirty fix * A better and more targeted fix (to fix the previous fix)
Configuration menu - View commit details
-
Copy full SHA for a0a6ce4 - Browse repository at this point
Copy the full SHA a0a6ce4View commit details
Commits on Jan 13, 2022
-
Add support for generating the method and generic method comment sign…
…ature with nested types (#801) * Add support for generating the method and generic method comment signature with nested types from Xiao Luo * Use type.GenericParameters.Count instead of custom method
Michael Jin authoredJan 13, 2022 Configuration menu - View commit details
-
Copy full SHA for 5f69faa - Browse repository at this point
Copy the full SHA 5f69faaView commit details
Commits on Jan 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 75372c7 - Browse repository at this point
Copy the full SHA 75372c7View commit details
Commits on Jan 19, 2022
-
* FieldRVA alignment In support of dotnet/runtime#60948 the linker (an assembly rewriter) will need to be able to preserve the alignment of RVA based fields which are to be used to create the data for `CreateSpan<T>` records This is implemented by adding a concept that RVA fields detect their required alignment by examining the PackingSize of the type of the field (if the field type is defined locally in the module) * Update Mono.Cecil.Metadata/Buffers.cs Co-authored-by: Aaron Robinson <arobins@microsoft.com> * Enhace logic used to ensure type providing PackingSize is local to the module. Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for a56b5bd - Browse repository at this point
Copy the full SHA a56b5bdView commit details -
Harden debug scope update logic (#824)
* Harden debug scope update logic Based on bug reports like #816 it seems there are still cases where the IL and scope offsets are out of sync in weird ways. This change modifies the logic to have no potential to cause the `IndexOutOfRangeException`. While I was not able to determine what combination could cause this, it's better this way. The corner case comes when there's potential problem with the first/second instruction in the method body. The change in this case will potentially make the debug scopes slightly wrong by not pointing to the previous instruction (as there's none). Without having a real repro it's hard to tell what would be a better solution, this way it won't crash and the scopes still make sense. * Fix typo
Configuration menu - View commit details
-
Copy full SHA for 8b593d5 - Browse repository at this point
Copy the full SHA 8b593d5View commit details -
Fix deterministic MVID and add PdbChecksum (#810)
* Fix deterministic MVID and add PdbChecksum (#31) * Fix how pdb path is calculated in the tests * Fix portable PDB stamp in CodeView header (#32) * Introduce ISymbolWriter.Write This mostly cleans up the code to make it easier to understand. `ISymbolWriter.GetDebugHeader` no longer actually writes the symbols, there's a new `Write` method for just that. The assembly writer calls `Write` first and then the image writer calls `GetDebugHeader` when it's needed. This is partially taken from #617.
Configuration menu - View commit details
-
Copy full SHA for 79b43e8 - Browse repository at this point
Copy the full SHA 79b43e8View commit details
Commits on Feb 21, 2022
-
Fix custom attribute with enum on generic type (#827)
* Fix custom attribute with enum on generic type Fixes both the reader and the write to correctly handle values of type enum on a generic type. Cecil represents generic instantiations as typeref which has etype GenericInst, so the exising check for etype doesn't work. Also since attributes only allow simple values and enums (and types), there's technically no other way to get a GenericInst then the enum case. Added several test for various combinations of boxed an unboxed enums on generic type. Added a test case provided by @mrvoorhe with array of such enums. * Disable the new tests on .NET 4 The CodeDom compiler doesn't support parsing enums on generic types in attributes (uses the "old" csc.exe from framework).
Configuration menu - View commit details
-
Copy full SHA for f7b64f7 - Browse repository at this point
Copy the full SHA f7b64f7View commit details
Commits on Jun 15, 2022
-
Fix mixed module ReadSymbols() (#851)
Fix reading some pdb generated by the C++ compiler for mixed mode assemblies. Co-authored-by: Marco Rossignoli <mrossignol@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 2c68927 - Browse repository at this point
Copy the full SHA 2c68927View commit details -
Configuration menu - View commit details
-
Copy full SHA for 49b1c52 - Browse repository at this point
Copy the full SHA 49b1c52View commit details
Commits on Sep 29, 2022
-
Add support for generic attributes (#871)
* Add support for generic attributes * Compile test assembly against mscorlib To satisfy PEVerify
Configuration menu - View commit details
-
Copy full SHA for 42b9ef1 - Browse repository at this point
Copy the full SHA 42b9ef1View commit details -
InvariantCulture for operand to string conversion in Instruction.ToSt…
…ring() (#870) * Use InvariantCulture for operand to string conversion in Instruction.ToString()
Configuration menu - View commit details
-
Copy full SHA for 6f94613 - Browse repository at this point
Copy the full SHA 6f94613View commit details -
Fix corrupted debug header directory entry when writing multiple such…
… entries. (#869) Basically the first two entries are written correctly, and any after that which has data will have the RVA correct, but the virtual address field will be wrong. Depending on the consumer this can work (if they use RVA) or fail (if they use virtual address) as they would read garbage data. Currently this mostly affects embedded protable PDBs since in that case we write 4 headers: CodeView, PdbChecksum, EmbeddedPdb and Deterministic (in this order), so the embedded PDB data is effectively wrong. Also adds a test which validates that both the RVA and virtual address point to the same thing.
Configuration menu - View commit details
-
Copy full SHA for 7d36386 - Browse repository at this point
Copy the full SHA 7d36386View commit details -
ILProcessor should also update custom debug info (#867)
* ILProcessor should also update custom debug info (#34) * ILProcessor should also update custom debug info When eidting IL with ILProcessor various pieces of debug information have references to the origin IL instructions. These references can be either resolved (point to Instruction instance), in which case the editting mostly works, or unresolved (store IL offset only) in which case they need to be resolved before the editting can occur (after the edit the original IL offsets are invalid and unresolvable). This is effectively a continuation of #687 which implemented this for local scopes. This change extends this to async method stepping info and state machine scopes. The change refactors the code to make it easier to reuse the same logic between the various debug infos being processed. Updated the existing tests from #687 to include async and state machine debug info (completely made up) and validate that it gets updated correctly. * PR Feedback Renamed some parameters/locals to better match the existing code style. * PR Feedback * Fix test on Linux Native PDB is not supported on Linux and the test infra falls back to portable PDB automatically. Since the two PDB implementations read the custom debug info from a different place the test constructing the input needs to adapt to this difference as well.
Configuration menu - View commit details
-
Copy full SHA for 9eb00e4 - Browse repository at this point
Copy the full SHA 9eb00e4View commit details -
Add more style configuration (#854)
This sets up .NET naming for fields, locals and parameters to use snake_case, so that editors won't complain about those. It also disables trimming of trailing blanks to avoid accidentally including such whitespace diffs in PRs.
Configuration menu - View commit details
-
Copy full SHA for 65a2912 - Browse repository at this point
Copy the full SHA 65a2912View commit details -
Fix a race condition between certain Has properties and their collect…
…ion property. (#843) We found a rare race condition between `MethodDefinition.HasOverrides` and `MethodDefinition.Overrides`. What can happen is 1) Thread 1 get's past the null check in `MethodDefinition.HasOverrides` and then is suspended. 2) Thread 2, calls `MethodDefinition.Overrides` and executes at least as far as the `metadata.RemoveOverrideMapping (method)` call in `AssemblyReader.ReadOverrides` 3) Thread 1 resumes on `return HasImage && Module.Read (this, (method, reader) => reader.HasOverrides (method));` It now proceeds to AssemblyReader.HasOverrides. No overrides are found and false is returned due to the overrides for that method having been removed from `MetadataSystem` To recap, the two notable behaviors are triggering this are a) The following check in `MethodDefinition.HasOverrides` happens outside of the lock. ``` if (overrides != null) return overrides.Count > 0; ``` b) The call to `metadata.RemoveOverrideMapping` in `AssemblyReader.ReadOverrides` means that `AssemblyReader.ReadOverrides` and `AssemblyReader.HasOverrides` cannot be called again after the first call to `AssemblyReader.ReadOverrides` I did not attempt to reproduce this vulnerability for every pair of properties that follows this pattern. However, I think it's safe to assume any pair of properties that follows this same pattern is vulnerable. Using `ReadingMode.Deferred` also appears to be a required prerequisite to encounter this problem. We had two thoughts on how to fix this 1) Repeat the collection null check after obtaining the module lock in `Module.Read` during `MethodDefinition.HasOverrides` 2) Remove the behavior of `AssemblyReader` removing data from the `MetadataSystem`. I decided to go with Fix 2 because it was easy to find all of problematic property pairings by searching `MetadataSystem.cs` for `Remove`. I also feel that this behavior of modifying the metadata system is asking for problems and probably not worth the freed memory is provides. If you'd prefer Fix 1 instead. Or both Fix 1 & Fix 2 let me know and I can change around the PR.
Configuration menu - View commit details
-
Copy full SHA for c4cfe16 - Browse repository at this point
Copy the full SHA c4cfe16View commit details -
Add
MethodImplAttributes.AggressiveOptimization
(#855)In .NET Core 3.0 and later, `MethodImplOptions` got a new flag value, `AggressiveOptimization` (512). This adds that same flag to `MethodImplAttributes` (and a corresponding property to `MethodDefinition`). It also updates the comments for the flags to match the `MethodImplOptions` documentation better.
Configuration menu - View commit details
-
Copy full SHA for 92f32da - Browse repository at this point
Copy the full SHA 92f32daView commit details -
* Address issue #873 * Be explicit as to what we support writing * Use normal test infrastructure * Restore writing primitives * Restore style * Can't verify .net core assembly Co-authored-by: Jb Evain <jb@evain.net>
Configuration menu - View commit details
-
Copy full SHA for e052ab5 - Browse repository at this point
Copy the full SHA e052ab5View commit details
Commits on Nov 15, 2022
-
Treat instance and static methods as different methods during resolut…
…ion (#882) When all other comparisons (return type, parameters, etc.) are the same, treat instance and static methods with the same name as different methods. This corrects a problem we noticed in IL2CPP in Unity.
Joshua Peterson authoredNov 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 341fb14 - Browse repository at this point
Copy the full SHA 341fb14View commit details
Commits on Nov 16, 2022
-
Fix a StackOverflowException reading windows runtime assemblies. (#879)
During `AssemblyReader.ReadCustomAttributes` there is a call to `WindowsRuntimeProjections.Project` ``` if (module.IsWindowsMetadata ()) foreach (var custom_attribute in custom_attributes) WindowsRuntimeProjections.Project (owner, custom_attributes, custom_attribute); ``` `WindowsRuntimeProjections.Project` would call `WindowsRuntimeProjections.HasAttribute`, which would then call `type.CustomAttributes`, which would end up back in `AssemblyReader.ReadCustomAttributes`. This would lead to a StackOverflowException. This wasn't an issue previously. My PR #843 caused this sequence of calls to start resulting in a StackOverflowException. Prior to my PR, there was a call to `metadata.RemoveCustomAttributeRange (owner);` before the call to `WindowsRuntimeProjections.Project`. This meant that when `WindowsRuntimeProjections.HasAttribute` would call `type.CustomAttributes`, we'd still end up in `AssemblyReader.ReadCustomAttributes`, however, no attributes would be found because the following if would be true and lead to returning an empty collection. ``` if (!metadata.TryGetCustomAttributeRanges (owner, out ranges)) return new Collection<CustomAttribute> (); ``` The old behavior was probably the wrong. Although I'm not certain what the tangible impact was. The fix was pretty easy. `AssemblyReader.ReadCustomAttributes` will now pass in the custom attributes to `WindowsRuntimeProjections.Project` avoiding the need to call `type.CustomAttributes`
Configuration menu - View commit details
-
Copy full SHA for cc48622 - Browse repository at this point
Copy the full SHA cc48622View commit details
Commits on Nov 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4ad9c0f - Browse repository at this point
Copy the full SHA 4ad9c0fView commit details
Commits on Jan 18, 2023
-
Fix RVA field alignment (#888)
* Fix RVA field alignment * Use non-latest images to run tests * Revert windows-2019 change * Don't align code segment This wasn't aligned to begin with. Attempting to align it causes problems due to the way CodeWriter gets the code RVA - it computes the RVA from the CLI Header length, which doesn't take into account the code's alignment requirements. * Revert "Don't align code segment" This reverts commit 9410f1e. * Keep alignment values for code
Configuration menu - View commit details
-
Copy full SHA for 870ce3e - Browse repository at this point
Copy the full SHA 870ce3eView commit details
Commits on Apr 19, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 8c123e1 - Browse repository at this point
Copy the full SHA 8c123e1View commit details
There are no files selected for viewing