Skip to content

Commit 2965a74

Browse files
committedMay 9, 2017
QWORD Support and Exception handling
1 parent 141a7fd commit 2965a74

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed
 

‎Source/REG2CI/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.7.2.*")]
36-
[assembly: AssemblyFileVersion("0.7.2.0")]
35+
[assembly: AssemblyVersion("0.7.3.*")]
36+
[assembly: AssemblyFileVersion("0.7.3.0")]

‎Source/REG2CI/RegClass.cs

+28-3
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ public ValueType DataType
338338
return ValueType.String;
339339
if (_value.ToLower().StartsWith("dword:"))
340340
return ValueType.DWord;
341+
if (_value.ToLower().StartsWith("hex(b):"))
342+
return ValueType.QWord;
341343
if (_value.ToLower().StartsWith("qword:"))
342344
return ValueType.QWord;
343345
if (_value.ToLower().StartsWith("hex(7):"))
@@ -557,11 +559,34 @@ public string GetPSCheckAll(string PSHive)
557559
{
558560
string sResult = "# " + Description + Environment.NewLine;
559561

560-
foreach (RegValue oVal in RegValues.Where(t => t.Key.PSHive == PSHive))
562+
if (PSHive == "HKLM:")
561563
{
562-
sResult = sResult + oVal.PSCheck.Replace("$true", "").Replace("$false", "return $false") + ";" + Environment.NewLine;
564+
foreach (RegValue oVal in RegValues.Where(t => t.Key.PSHive != "HKCU:"))
565+
{
566+
if (!string.IsNullOrEmpty(oVal.Description))
567+
{
568+
sResult += Environment.NewLine;
569+
sResult += "# " + oVal.Description + Environment.NewLine;
570+
}
571+
572+
sResult = sResult + oVal.PSCheck.Replace("$true", "").Replace("$false", "return $false") + ";" + Environment.NewLine;
573+
}
574+
sResult += "return $true";
575+
}
576+
else
577+
{
578+
foreach (RegValue oVal in RegValues.Where(t => t.Key.PSHive == "HKCU:"))
579+
{
580+
if (!string.IsNullOrEmpty(oVal.Description))
581+
{
582+
sResult += Environment.NewLine;
583+
sResult += "# " + oVal.Description + Environment.NewLine;
584+
}
585+
586+
sResult = sResult + oVal.PSCheck.Replace("$true", "").Replace("$false", "return $false") + ";" + Environment.NewLine;
587+
}
588+
sResult += "return $true";
563589
}
564-
sResult += "return $true";
565590
return sResult;
566591
}
567592

0 commit comments

Comments
 (0)
Please sign in to comment.