added more checks to RR plug-ins to not display path of module when key is not found

This commit is contained in:
Brian Carrier 2014-04-03 15:36:25 -04:00
parent 4c79d8871e
commit a00c429069
3 changed files with 50 additions and 36 deletions

View File

@ -49,23 +49,30 @@ sub pluginmain {
eval { eval {
::rptMsg(""); ::rptMsg("");
::rptMsg("Domain secret - \$MACHINE\.ACC"); ::rptMsg("Domain secret - \$MACHINE\.ACC");
my $c = $key->get_subkey("\$MACHINE\.ACC\\CupdTime")->get_value("")->get_data(); my $v1 = $key->get_subkey("\$MACHINE\.ACC\\CupdTime")->get_value("");
if (defined $v1) {
my $c = $v1->get_data();
my @v = unpack("VV",$c); my @v = unpack("VV",$c);
my $cupd = gmtime(::getTime($v[0],$v[1])); my $cupd = gmtime(::getTime($v[0],$v[1]));
::rptMsg("CupdTime = ".$cupd); ::rptMsg("CupdTime = ".$cupd);
}
else {
::rptMsg("CupdTime value not found");
}
my $o = $key->get_subkey("\$MACHINE\.ACC\\OupdTime")->get_value("")->get_data();
$v1 = $key->get_subkey("\$MACHINE\.ACC\\OupdTime")->get_value("")
if (defined $v1) {
my $c = $v1->get_data();
my @v = unpack("VV",$c); my @v = unpack("VV",$c);
my $oupd = gmtime(::getTime($v[0],$v[1])); my $oupd = gmtime(::getTime($v[0],$v[1]));
::rptMsg("OupdTime = ".$oupd); ::rptMsg("OupdTime = ".$oupd);
}
else {
::rptMsg("OupdTime value not found");
}
}; };
::rptMsg("Error: ".$@) if ($@); ::rptMsg("Error: ".$@) if ($@);
} }
else { else {
::rptMsg($key_path." not found."); ::rptMsg($key_path." not found.");

View File

@ -69,14 +69,10 @@ sub pluginmain {
my $key; my $key;
my $key_path = "ControlSet00".$curr."\\Control\\ProductOptions"; my $key_path = "ControlSet00".$curr."\\Control\\ProductOptions";
if ($key = $root_key->get_subkey($key_path)) { if ($key = $root_key->get_subkey($key_path)) {
my $prod;
eval { eval {
$prod = $key->get_value("ProductPolicy")->get_data(); my $v1 = $key->get_value("ProductPolicy");
}; if (defined $v1) {
if ($@) { my $prod = $v1->get_data();
::rptMsg("Error getting ProductPolicy value: $@");
}
else {
my %pol = parseData($prod); my %pol = parseData($prod);
::rptMsg(""); ::rptMsg("");
::rptMsg("Note: This plugin applies to Vista and Windows 2008 ONLY."); ::rptMsg("Note: This plugin applies to Vista and Windows 2008 ONLY.");
@ -92,6 +88,13 @@ sub pluginmain {
::rptMsg("Kernel\-ProductInfo = ".$prodinfo{$pol{"Kernel\-ProductInfo"}}); ::rptMsg("Kernel\-ProductInfo = ".$prodinfo{$pol{"Kernel\-ProductInfo"}});
} }
} }
else {
::rptMsg("Error getting ProductPolicy value");
}
};
if ($@) {
::rptMsg("Error getting ProductPolicy value: $@");
}
} }
else { else {
::rptMsg($key_path." not found."); ::rptMsg($key_path." not found.");

View File

@ -45,13 +45,17 @@ sub pluginmain {
::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)"); ::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)");
::rptMsg(""); ::rptMsg("");
my $install;
eval { eval {
$install = $key->get_subkey("Installer")->get_value("DonwloadLastModified")->get_data(); my $v1 = $install = $key->get_subkey("Installer")->get_value("DonwloadLastModified");
if (defined $v1) {
my $install = $v1->get_data()
::rptMsg("DonwloadLastModified = ".$install); ::rptMsg("DonwloadLastModified = ".$install);
}
else {
::rptMsg("DonwloadLastModified value not found");
}
}; };
::rptMsg("DonwloadLastModified value not found: ".$@) if ($@); ::rptMsg("DonwloadLastModified value not found: ".$@) if ($@);
} }
else { else {
::rptMsg($key_path." not found."); ::rptMsg($key_path." not found.");