<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arnout's Eclectica &#187; Regedit</title>
	<atom:link href="http://grootveld.com/archives/category/regedit/feed" rel="self" type="application/rss+xml" />
	<link>http://grootveld.com</link>
	<description>But I digress...</description>
	<lastBuildDate>Wed, 10 Feb 2010 20:00:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>*UPDATE* on REGEDIT experiments</title>
		<link>http://grootveld.com/archives/27/update-on-regedit-experiments</link>
		<comments>http://grootveld.com/archives/27/update-on-regedit-experiments#comments</comments>
		<pubDate>Thu, 21 Aug 2008 20:03:01 +0000</pubDate>
		<dc:creator>amg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Regedit]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grootveld.com/archives/27</guid>
		<description><![CDATA[In my previous post, I wrote about some findings w.r.t. REGEDIT. One of them was about a limitation on the depth of key hierarchies during a registry export.
When I found out about this limitation, I was actually encountering stack overflows in REGEDIT. However, shortly afterwards I wasn't able to reproduce that behaviour, so I considered [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href='http://grootveld.com/archives/26/regedit-experiments' title='My first post about REGEDIT experiments'>previous post</a>, I wrote about some findings w.r.t. REGEDIT. One of them was about a limitation on the depth of key hierarchies during a registry export.</p>
<p>When I found out about this limitation, I was actually encountering stack overflows in REGEDIT. However, shortly afterwards I wasn't able to reproduce that behaviour, so I considered it to be some fluke and just wrote about the limitation itself.</p>
<p>However, today I managed to overflow REGEDIT's stack again by just having it export a deep hierarchy to <code>.REG</code>, and this time I captured a crash dump:</p>
<pre class='codesample'>
0:000> kb 300
ChildEBP RetAddr  Args to Child
0004308c 77f60938 000002b8 00000000 000430b8 ADVAPI32!LocalBaseRegEnumKey+0x13
000430c4 0100bb37 000002b8 00000000 00043654 ADVAPI32!RegEnumKeyW+0x8c
00043890 0100bb08 000002b8 000438a0 004b0048 regedit!PutBranch+0x124
0004404c 0100bb08 000002bc 0004405c 004b0048 <strong>regedit!PutBranch+0xf5</strong>
00044800 0100bb08 000002c0 00044810 004b0048 <strong>regedit!PutBranch+0xf5</strong>
00044fac 0100bb08 000002c4 00044fbc 004b0048 <strong>regedit!PutBranch+0xf5</strong>

       <em>... Removed 190 lines that all end in</em> <strong>regedit!PutBranch+0xf5</strong>

0007f1d4 0100bb08 00000578 0007f1e4 004b0048 <strong>regedit!PutBranch+0xf5</strong>
0007f458 0100bb08 0000057c 0007f468 004b0048 <strong>regedit!PutBranch+0xf5</strong>
0007f6c8 0100be1b 80000001 0007f6f0 00070e54 <strong>regedit!PutBranch+0xf5</strong>
0007f944 01006be3 0007f974 01059de0 00070e54 regedit!ExportWinNT50RegFile+0x16d
0007f958 01007272 00070e54 00000000 0007f974 regedit!RegEdit_ExportRegFile+0x2e
0007fb80 010062eb 00070e54 0000110a 7739c2ee regedit!RegEdit_OnCommandExportRegFile+0x65
0007fb98 01009751 00070e54 00000293 00000000 regedit!RegEdit_OnCommand+0x7f
0007fbbc 01009947 00070e54 00000293 000ad310 regedit!RegEdit_OnKeyTreeCommand+0xc4
0007fc24 010045ba 00070e54 00160c39 0007fc50 regedit!RegEdit_OnKeyTreeContextMenu+0x1a1
0007fc34 0100689f 00130dc2 00070e54 000002c4 regedit!RegEdit_OnContextMenu+0x2a
0007fc50 7739b6e3 00130dc2 0000007b 00070e54 regedit!RegEditWndProc+0x128
0007fc7c 7739b874 01006777 00130dc2 0000007b USER32!InternalCallWinProc+0x28
0007fcf4 7739c2d3 00000000 01006777 00130dc2 USER32!UserCallWinProcCheckWow+0x151
0007fd30 7739c337 00615210 00615118 00070e54 USER32!SendMessageWorker+0x4bd
0007fd50 7745b0ee 00130dc2 0000007b 00070e54 USER32!SendMessageW+0x7f
0007fd74 7745bcfc 00070e54 00000062 00000025 COMCTL32!TV_SendRButtonDown+0xad
0007fdc4 7739b6e3 00070e54 00000204 00000002 COMCTL32!TV_WndProc+0x616
0007fdf0 7739b874 7745b6e6 00070e54 00000204 USER32!InternalCallWinProc+0x28
0007fe68 7739ba92 00000000 7745b6e6 00070e54 USER32!UserCallWinProcCheckWow+0x151
0007fed0 7739bad0 0007fef8 00000000 0007ff1c USER32!DispatchMessageWorker+0x327
0007fee0 01009cb9 0007fef8 ffffffff 00000000 USER32!DispatchMessageW+0xf
0007ff1c 01016e04 01000000 00000000 000a24a6 regedit!WinMain+0x154
0007ffc0 77e6f23b 00000000 00000000 7ffdf000 regedit!WinMainCRTStartup+0x182
0007fff0 00000000 01016c82 00000000 78746341 kernel32!BaseProcessStart+0x23
</pre>
<p>If somebody wants to dive into the crash dump, let me know.</p>
<p>Exporting a deep key hierarchy on W2K8 X64 didn't work either, BTW:</p>
<p><img src='/images/RegeditStackOverflowW2K8X64.png' width='471' height='385' alt='Screen shot of REGEDIT crashing on W2K8 X64 while trying to export a deep key hierarchy' /></p>
]]></content:encoded>
			<wfw:commentRss>http://grootveld.com/archives/27/update-on-regedit-experiments/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REGEDIT experiments</title>
		<link>http://grootveld.com/archives/26/regedit-experiments</link>
		<comments>http://grootveld.com/archives/26/regedit-experiments#comments</comments>
		<pubDate>Tue, 12 Aug 2008 21:11:16 +0000</pubDate>
		<dc:creator>amg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Regedit]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grootveld.com/archives/26</guid>
		<description><![CDATA[NOTE (2008-08-21): Also see the update to this post.
I've been working on a tool that can export registry information in REGEDIT's .REG format. Since that format doesn't seem to be fully documented, I spent quite some time experimenting with REGEDIT. Here are some of my more interesting findings (all on W2K3).
No expansion beyond 32 levels
When [...]]]></description>
			<content:encoded><![CDATA[<p><span style='background-color: #ffffaa;border-style: solid; border-width: 1px; padding: 3px'><strong>NOTE</strong> (2008-08-21): Also see the <a href='http://grootveld.com/archives/27/update-on-regedit-experiments' title='Update about the export limitations'>update</a> to this post.</span></p>
<p>I've been working on a tool that can export registry information in REGEDIT's <code>.REG</code> format. Since that format doesn't seem to be fully documented, I spent quite some time experimenting with REGEDIT. Here are some of my more interesting findings (all on W2K3).</p>
<p><strong>No expansion beyond 32 levels</strong><br />
When you expand a key in REGEDIT, it passes the "root" <code>HKEY</code> (like <code>HKLM</code>) and the full path to <code>RegOpenKey()</code> instead of the immediate parent and just the name of the key you're trying to expand. This means that it will run into the <a href='http://msdn.microsoft.com/en-us/library/ms724872(VS.85).aspx' title='Registry Element Size Limits'>"up to 32 levels at a time" limitation</a> of the registry API:</p>
<p><img src='/images/Registry33levels.png' height='159' width='568' alt='Error message when opening level 33'/></p>
<p><strong>No export beyond 200 levels</strong><br />
Although the registry supports 512 levels of keys, REGEDIT will only export upto a depth of about 200, silently ignoring anything beyond that...<br />
Granted, that's not a very common scenario, but I would expect at least a warning message or something.</p>
<p><strong>Importing values of non-existing types</strong><br />
<a href='http://source.winehq.org/source/include/winnt.h#L4178' title='Registry value type definitions at Wine HQ'><code>WinNT.h</code> defines 12 value types</a>, ranging from <code>REG_NONE</code> (0) to <code>REG_QWORD</code> (11). REGEDIT however, will gladly accept all other 32-bit values as well...</p>
<p><code>[HKEY_CURRENT_USER\RegistryTest]<br />
"Type Test"=hex(42):47,11</code></p>
<p>results in</p>
<p><img src='/images/RegistryValueTypes.png' width='302' height='75' alt='A value of type 0x42...'/></p>
]]></content:encoded>
			<wfw:commentRss>http://grootveld.com/archives/26/regedit-experiments/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
