From 1915d88d84a5cf1b6cca331fe76180caeef0ca57 Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Wed, 11 Oct 2023 19:02:01 +0200 Subject: [PATCH] Escape invalid characters in assembly and module names --- Extensions/ILSpy.Decompiler/ICSharpCode.Decompiler | 2 +- dnSpy/dnSpy.Decompiler/DecompilerBase.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Extensions/ILSpy.Decompiler/ICSharpCode.Decompiler b/Extensions/ILSpy.Decompiler/ICSharpCode.Decompiler index 07104605cd..fec42c8fa7 160000 --- a/Extensions/ILSpy.Decompiler/ICSharpCode.Decompiler +++ b/Extensions/ILSpy.Decompiler/ICSharpCode.Decompiler @@ -1 +1 @@ -Subproject commit 07104605cd90a0b7b17493216df278e67429daed +Subproject commit fec42c8fa7d95e33332d7a6645c97a710499b12b diff --git a/dnSpy/dnSpy.Decompiler/DecompilerBase.cs b/dnSpy/dnSpy.Decompiler/DecompilerBase.cs index c0ccb6e6c9..e1b341d6b3 100644 --- a/dnSpy/dnSpy.Decompiler/DecompilerBase.cs +++ b/dnSpy/dnSpy.Decompiler/DecompilerBase.cs @@ -135,14 +135,14 @@ protected void WriteModule(ModuleDef mod, IDecompilerOutput output, Decompilatio void DecompileInternal(AssemblyDef asm, IDecompilerOutput output, DecompilationContext ctx) { this.WriteCommentLine(output, asm.ManifestModule.Location); if (asm.IsContentTypeWindowsRuntime) - this.WriteCommentLine(output, asm.Name + " [WinRT]"); + this.WriteCommentLine(output, IdentifierEscaper.Escape(asm.Name, true) + " [WinRT]"); else - this.WriteCommentLine(output, asm.FullName); + this.WriteCommentLine(output, IdentifierEscaper.Escape(asm.FullName, true)); } void DecompileInternal(ModuleDef mod, IDecompilerOutput output, DecompilationContext ctx) { this.WriteCommentLine(output, mod.Location); - this.WriteCommentLine(output, mod.Name); + this.WriteCommentLine(output, IdentifierEscaper.Escape(mod.Name, true)); } protected void PrintEntryPoint(ModuleDef mod, IDecompilerOutput output) {