RE: "fake" hive in the registry on 64 bit windows

Joel Friedman <[email protected]> Sun, 14 Apr 2013 02:02:25 +0000
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <86B20F757070D240B59AD629366077C30C9B2012@exmbsmq07.datapipe-corp.net>
--===============0560522339==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_86B20F757070D240B59AD629366077C30C9B2012exmbsmq07datapi_"

--_000_86B20F757070D240B59AD629366077C30C9B2012exmbsmq07datapi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I'm not certain if this is your problem, but if you are running an x86 copy=
 of Perl on an x64 system, and you are using backticks for execution, Windo=
ws filesystem redirection will kick in and actually execute %windir%\SysWOW=
64\reg.exe.  The x86 version of reg.exe is different, and may (purposefully=
) not have access to the 64bit registry.

Try executing $ENV{SYSTEMROOT} . '\\SysNative\\reg.exe' instead.  You won't=
 see the SysNative directory from the standard (x64) command prompt, but it=
 will exist from within an x86 shell with filesystem redirection.

--Joel

From: [email protected] [mailto:activeperl-bounce=
[email protected]] On Behalf Of Perlmutter, Joshua B
Sent: Thursday, April 11, 2013 12:39 PM
To: [email protected]
Subject: "fake" hive in the registry on 64 bit windows

Dear Perl Gurus,

I have an issue with reading registries in Perl. I know there is a ppm for =
this, but requirements prohibit the use of this package. I am instead using=
 "reg"
I have posted on the Active State Forums, yet they seem infrequently used.,=
 so I am reposting here.

Originally posted to: http://community.activestate.com/node/9693


In the attached sample script I get an extra copy of the 32 bit hive in the=
 64 bit section. This is even after creating a fake 64 bit section that has=
 one key called "isThisReal" with value "Do You See Me?" as a Reg_SZ

Instead I get the attached output.
Any help on figuring out how to get the real 64 bit hive section would be G=
REATLY appreciated.

There should be an attachment of a zip file containing the test script and =
its output.

(Notice: This is a REGISTRY QUERYING SCRIPT. if you are uncomfortable touch=
ing your windows registry, please do not execute.)

What i tried for testing was to run the commands OUTSIDE of perl in the com=
mand shell and i get the correct output there.

This is being developed to gather information on server machines so i've be=
en using Windows 2008 R2.

I'm sure it is me missing something as this is not something i would expect=
 to be uncommon, so i apologize in advance if this seems stupidly simple. G=
oogle and other search engines have not helped as i have not found anything=
 particular to this.

Again, thank you in advance for any assistance.

Josh Perlmutter
CA Technologies


Sincerely,
Josh Perlmutter
CA SiteMinder Technical Support Engineer
Contacting support...
...By Phone: 1-800-CALL CAI (225-5224)
...Via the Web: https://support.ca.com

Any questions or concerns, please feel free to contact my manager Bill Mill=
er Manager, CA Technologies Support
(508) 628-8858
[email protected]<mailto:[email protected]>

This e-mail and any files transmitted with it are for the sole use of the i=
ntended recipient(s) and contain information that may be privileged and con=
fidential.  Any unauthorized review, use, disclosure or distribution is pro=
hibited.  If you are not the intended recipient of this e-mail, please dele=
te this e-mail and any files transmitted with it and notify the sender imme=
diately.

________________________________

This message may contain confidential or privileged information. If you are=
 not the intended recipient, please advise us immediately and delete this m=
essage. See http://www.datapipe.com/legal/email_disclaimer/ for further inf=
ormation on confidentiality and the risks of non-secure electronic communic=
ation. If you cannot access these links, please notify us by reply message =
and we will send the contents to you.

--_000_86B20F757070D240B59AD629366077C30C9B2012exmbsmq07datapi_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<style>
<!--
@font-face
	{font-family:"Cambria Math"}
@font-face
	{font-family:Calibri}
@font-face
	{font-family:Tahoma}
@font-face
	{font-family:Consolas}
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline}
p
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman","serif"}
span.EmailStyle18
	{font-family:"Calibri","sans-serif";
	color:#1F497D}
span.EmailStyle19
	{font-family:"Calibri","sans-serif";
	color:#1F497D}
.MsoChpDefault
	{font-size:10.0pt}
@page WordSection1
	{margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
	{}
-->
</style>
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">I&#8217;m not certain i=
f this is your problem, but if you are running an x86 copy of Perl on an x6=
4 system, and you are using backticks for execution, Windows filesystem
 redirection will kick in and actually execute %windir%\SysWOW64\reg.exe.&n=
bsp; The x86 version of reg.exe is different, and may (purposefully) not ha=
ve access to the 64bit registry.</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">Try executing $ENV{SYST=
EMROOT} . '\\SysNative\\reg.exe&#8217; instead.&nbsp; You won&#8217;t see t=
he SysNative directory from the standard (x64) command prompt, but it will
 exist from within an x86 shell with filesystem redirection.</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">--Joel</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D"></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<div>
<div style=3D"border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0i=
n 0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt; font-family:&quo=
t;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style=3D"font-=
size:10.0pt; font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> active=
[email protected] [mailto:[email protected]=
ctiveState.com]
<b>On Behalf Of </b>Perlmutter, Joshua B<br>
<b>Sent:</b> Thursday, April 11, 2013 12:39 PM<br>
<b>To:</b> [email protected]<br>
<b>Subject:</b> &quot;fake&quot; hive in the registry on 64 bit windows</sp=
an></p>
</div>
</div>
<p class=3D"MsoNormal">&nbsp;</p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">Dear Perl Gurus,</span>=
</p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">I have an issue with re=
ading registries in Perl. I know there is a ppm for this, but requirements =
prohibit the use of this package. I am instead using &#8220;reg&#8221;</spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">I have posted on the Ac=
tive State Forums, yet they seem infrequently used., so I am reposting here=
.</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">Originally posted to:</=
span>
<span style=3D"font-size:11.0pt; font-family:&quot;Calibri&quot;,&quot;sans=
-serif&quot;; color:#1F497D">
<a href=3D"http://community.activestate.com/node/9693">http://community.act=
ivestate.com/node/9693</a></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">In the attached sample script I get an extra copy of the 32 bit hive in t=
he 64 bit section. This is even after creating a fake 64
 bit section that has one key called &#8220;isThisReal&#8221; with value &#=
8220;Do You See Me?&#8221; as a Reg_SZ</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">Instead I get the attached output.<br>
Any help on figuring out how to get the real 64 bit hive section would be G=
REATLY appreciated.</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">There should be an attachment of a zip file containing the test script an=
d its output.</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">(Notice: This is a REGISTRY QUERYING SCRIPT. if you are uncomfortable tou=
ching your windows registry, please do not execute.)</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">What i tried for testing was to run the commands OUTSIDE of perl in the c=
ommand shell and i get the correct output there.
</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">This is being developed to gather information on server machines so i've =
been using Windows 2008 R2.</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">I'm sure it is me missing something as this is not something i would expe=
ct to be uncommon, so i apologize in advance if this seems
 stupidly simple. Google and other search engines have not helped as i have=
 not found anything particular to this.</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">Again, thank you in advance for any assistance.</span></p>
<p style=3D"line-height:16.8pt; background:white"><span style=3D"font-size:=
10.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:#333333=
">Josh Perlmutter<br>
CA Technologies</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt; font-family:&quot;C=
alibri&quot;,&quot;sans-serif&quot;; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">Sincerely,</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">Josh Perlmutter</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">CA SiteMinder Technical Support Engineer</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">Contacting support...</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">...By Phone: 1-800-CALL CAI (225-5224)</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">...Via the Web:
<a href=3D"https://support.ca.com"><span style=3D"font-family:&quot;Times N=
ew Roman&quot;,&quot;serif&quot;">https://support.ca.com</span></a></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">Any questions or concerns, please feel free to contact my=
 manager Bill Miller Manager, CA Technologies Support</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">(508) 628-8858</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D"><a href=3D"mailto:[email protected]"><span style=3D"=
font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">William.Miller2@=
ca.com</span></a></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">&nbsp;</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt; font-family:Consola=
s; color:#1F497D">This e-mail and any files transmitted with it are for the=
 sole use of the intended recipient(s) and contain information that may be =
privileged and confidential.&nbsp; Any unauthorized
 review, use, disclosure or distribution is prohibited.&nbsp; If you are no=
t the intended recipient of this e-mail, please delete this e-mail and any =
files transmitted with it and notify the sender immediately.</span></p>
</div>
<br>
<hr>
<font face=3D"Arial" color=3D"Gray" size=3D"1"><br>
This message may contain confidential or privileged information. If you are=
 not the intended recipient, please advise us immediately and delete this m=
essage. See http://www.datapipe.com/legal/email_disclaimer/ for further inf=
ormation on confidentiality and
 the risks of non-secure electronic communication. If you cannot access the=
se links, please notify us by reply message and we will send the contents t=
o you.<br>
</font>
</body>
</html>

--_000_86B20F757070D240B59AD629366077C30C9B2012exmbsmq07datapi_--

--===============0560522339==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0560522339==--