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 {
::rptMsg("");
::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 $cupd = gmtime(::getTime($v[0],$v[1]));
::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 $oupd = gmtime(::getTime($v[0],$v[1]));
::rptMsg("OupdTime = ".$oupd);
}
else {
::rptMsg("OupdTime value not found");
}
};
::rptMsg("Error: ".$@) if ($@);
}
else {
::rptMsg($key_path." not found.");

View File

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

View File

@ -45,13 +45,17 @@ sub pluginmain {
::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)");
::rptMsg("");
my $install;
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);
}
else {
::rptMsg("DonwloadLastModified value not found");
}
};
::rptMsg("DonwloadLastModified value not found: ".$@) if ($@);
}
else {
::rptMsg($key_path." not found.");