From 9a4bca0a6709bd684185efd339ac540a85d36185 Mon Sep 17 00:00:00 2001 From: Cn33liz Date: Wed, 23 Oct 2019 12:44:16 +0200 Subject: [PATCH] Parameter Bugfix --- SharpHide/Program.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SharpHide/Program.cs b/SharpHide/Program.cs index 75bbdb4..e746c90 100755 --- a/SharpHide/Program.cs +++ b/SharpHide/Program.cs @@ -180,7 +180,16 @@ static void Main(string[] args) } } else { - UNICODE_STRING ValueData = new UNICODE_STRING("\"" + arguments["keyvalue"] + "\" " + arguments["arguments"]); + UNICODE_STRING ValueData; + if (arguments.ContainsKey("arguments")) + { + ValueData = new UNICODE_STRING("\"" + arguments["keyvalue"] + "\" " + arguments["arguments"]); + } + else + { + ValueData = new UNICODE_STRING("\"" + arguments["keyvalue"] + "\""); + } + Status = NtSetValueKey(regKeyHandle, ValueNamePtr, 0, RegistryKeyType.REG_SZ, ValueData.buffer, ValueData.MaximumLength); if (Status.Equals(STATUS_SUCCESS)) { Console.WriteLine("[+] Key successfully created.");