From 89e0e420d8246f87df6da7d8becd6f73fcf8877a Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Thu, 28 Sep 2023 12:09:04 +0300 Subject: [PATCH] Add flag --obfuscate-guid: Print the obfuscated form of the UUID --- .github/workflows/build.yml | 2 +- MsiZapEx/Program.cs | 7 +++++++ MsiZapEx/Settings.cs | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7517173..a438814 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: version: description: 'Build & package version' required: true - default: 0.1.3 + default: 0.1.4 type: string jobs: Build: diff --git a/MsiZapEx/Program.cs b/MsiZapEx/Program.cs index ce7c212..61756ce 100644 --- a/MsiZapEx/Program.cs +++ b/MsiZapEx/Program.cs @@ -153,6 +153,13 @@ static void Main(string[] args) } } } + if (!string.IsNullOrEmpty(Settings.Instance.ObfuscateGuid)) + { + Guid obfuscated = GuidEx.MsiObfuscate(Settings.Instance.ObfuscateGuid); + Console.WriteLine($"Supplied UUID: {Settings.Instance.ObfuscateGuid}"); + Console.WriteLine($"Obfuscated UUID (N format): {obfuscated.ToString("N")}"); + Console.WriteLine($"Obfuscated UUID (B format): {obfuscated.ToString("B")}"); + } } catch (Exception ex) { diff --git a/MsiZapEx/Settings.cs b/MsiZapEx/Settings.cs index e1c4d52..19fa8d3 100644 --- a/MsiZapEx/Settings.cs +++ b/MsiZapEx/Settings.cs @@ -8,6 +8,9 @@ public class Settings { internal static Settings Instance { get; set; } + [Option("obfuscate-guid", Required = false, HelpText = "Print the obfuscated form of the UUID", Group = "codes")] + public string ObfuscateGuid { get; set; } + [Option("bundle-upgrade-code", Required = false, HelpText = "Detect bundles by UpgradeCode", Group = "codes")] public string BundleUpgradeCode { get; set; }