<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Microsoft&#8217;s Rich Signature (undocumented)	</title>
	<atom:link href="https://ntcore.com/microsofts-rich-signature-undocumented/feed/" rel="self" type="application/rss+xml" />
	<link>https://ntcore.com/microsofts-rich-signature-undocumented/</link>
	<description></description>
	<lastBuildDate>Fri, 22 May 2015 17:49:04 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>
		By: Guru Meditation		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-99</link>

		<dc:creator><![CDATA[Guru Meditation]]></dc:creator>
		<pubDate>Fri, 22 May 2015 17:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-99</guid>

					<description><![CDATA[Thank you for the article, I have come back to it a couple of times since it was written, most recently a couple of days ago and this time, noticing the link to the 2004 article was not working anymore, I decided to track down where it could be found... At long last, I found it hidden deep down in a website dedicated to virus programming, and so I will not post any link.
Anyway, I always wanted to say thank you for writing the article, and only now being able to compare, so much more informative than the 2004 version. 
Since it is referenced, I hope you don&#039;t mind me pasting the contents of 29A-8.009 here. If you do however, please moderate my comment.

29A-8.009
: things they didn&#039;t tell you about ms link and the pe header : lw, 7 july 2004 :



* Introduction

The linkers from microsoft store information about used compiler versions
to create the object and library files in the EXE files they produces. This
information is stored right after the DOS stub, and before the start of the
actual PE header.

Appearantly they wanted to hide it, since all this stuff is encrypted using
checksums and other weird ways. I must say that I don&#039;t understand much of
the way they built up the structure, it is inefficient and simply weird.

Also I don&#039;t see much use of it, unless in some strange lawsuit or something
where the question is: is this .exe file created by this compiler+linker?
Or: are these .lib&#039;s used to create this exe file? Still then there is no
good evidence, because only the used compiler versions are stored, compilers
which are used by thousands of other people too. And why does microsoft use
this strange encryption and such?

Well, as you might see, enough questions about the reason why it exists -I can&#039;t 
tell you much about the use of it- but maybe I can tell you something in this 
article about the structure of this stored data though. 

* The Rich-Structure

The name &quot;rich&quot; is used because of one field  of the structure, which contains 
the ASCII values that form &quot;Rich&quot;. After the DOS stub the &quot;rich&quot; structure is 
stored. This structure is created by the ms linker and consists mainly of compiler 
id&#039;s which are gathered by the linker from the used .obj and .lib files. These 
compiler id&#039;s are stored in the files by the ms compiler in the &#039;comp.id&#039; fields, 
and contain the version number of the compiler. Newer linkers from ms also add 
their linker id to the exe file.

The &quot;rich&quot; structure is in the following format:

a, b, b, b      -- identification block / header?

compid^b, r^b   -- from 0
..              --      :
compid^b, r^b   -- to   n

&#039;Rich&#039;, b       -- terminator

padding

Where all variables are dwords. b is the checksum i&#039;ll describe later, and
a=b^0x536e6144. This value is a hardcoded value and appearantly always used.
compid is the compiler id and b is the number of times it was encountered
over all the lib/obj files (that is an assumption, i&#039;m not 100% sure). And
n is number of stored compid&#039;s. compid&#039;s are dwords too, the lower word is
the minor version number (0-9999 decimal), the high word is the major
number. i don&#039;t know how the high word is encoded, but 13.10 appears is
encoded as 0x60, and 7.10 as 0x5a. and yes, i see that 0x60-0x5a is the same
as 13-7 decimal, but where did the 0x53 (0x60-13decimal) came from? and where
is the 10 from the verison number stored?

The size of the &quot;rich&quot; structure is ((b/32)%3 + n)*8 + 0x20 bytes. the unused
space is padded with zeroes.

b is calculated in these steps:

b=sizeof(dos_stub)              // (almost always 0x80)

then the checksum of the dos_stub, with the pointer to the PE zeroed out, is
calculated in the following way:

for(int i=0; i&#060;sizeof(dos_stub); i++)
{
    b += dos_stub[i] ROL i;     // ROL is the x86 rotate over left operation.
}

when the default dos stub of 0x80 bytes is used, b contains now 0x884f3421

next, a checksum over the various compiler id&#039;s is calculated in this way:

for(int i=0; i&#060;n; i++)
{
    b += compid[i] ROL r[i];
}

as stated above, r appears to be the number of times that compid is
encountered in the libs/objs.


* Conclusion

The linker doesn&#039;t store your the MAC address of your NIC nor your DNA profile,
but better remove it anyway ;). You can write a very simple tool that will
zero out the rich structure given an exe file, or patch your linker so that it
won&#039;t get written at all. For my investigation I used the Microsoft Visual C++ 
Toolkit 2003 with the &#034;same compiler and linker that ship with Visual Studio 
.NET 2003 Professional!&#034; which you can download for free from microsoft.com,
google for &#034;VCToolkitSetup.exe&#034;. You can locate the interesting parts of code
by searching link.exe for the string &#039;Rich&#039; or in the function starting at
0x459090.

* Some additional last minute notes:

Disavowed told me on the RCE board that the constant 0x536e6144 is equal to
Dan^ in ASCII, and Silver had an some additional information about &#034;Dan&#034;:
Dan Ruder, Mechanics of Dynamic Linking, Microsoft, MSDN Library 1993, as 
referenced by patent 6253258 filed by Symantec for &#034;Subclassing system for 
computer that operates with portable-executable (PE) modules&#034;. Well, that must
be &#034;our&#034; magic Dan, shouldn&#039;t he?]]></description>
			<content:encoded><![CDATA[<p>Thank you for the article, I have come back to it a couple of times since it was written, most recently a couple of days ago and this time, noticing the link to the 2004 article was not working anymore, I decided to track down where it could be found&#8230; At long last, I found it hidden deep down in a website dedicated to virus programming, and so I will not post any link.<br />
Anyway, I always wanted to say thank you for writing the article, and only now being able to compare, so much more informative than the 2004 version.<br />
Since it is referenced, I hope you don&#8217;t mind me pasting the contents of 29A-8.009 here. If you do however, please moderate my comment.</p>
<p>29A-8.009<br />
: things they didn&#8217;t tell you about ms link and the pe header : lw, 7 july 2004 :</p>
<p>* Introduction</p>
<p>The linkers from microsoft store information about used compiler versions<br />
to create the object and library files in the EXE files they produces. This<br />
information is stored right after the DOS stub, and before the start of the<br />
actual PE header.</p>
<p>Appearantly they wanted to hide it, since all this stuff is encrypted using<br />
checksums and other weird ways. I must say that I don&#8217;t understand much of<br />
the way they built up the structure, it is inefficient and simply weird.</p>
<p>Also I don&#8217;t see much use of it, unless in some strange lawsuit or something<br />
where the question is: is this .exe file created by this compiler+linker?<br />
Or: are these .lib&#8217;s used to create this exe file? Still then there is no<br />
good evidence, because only the used compiler versions are stored, compilers<br />
which are used by thousands of other people too. And why does microsoft use<br />
this strange encryption and such?</p>
<p>Well, as you might see, enough questions about the reason why it exists -I can&#8217;t<br />
tell you much about the use of it- but maybe I can tell you something in this<br />
article about the structure of this stored data though. </p>
<p>* The Rich-Structure</p>
<p>The name &#8220;rich&#8221; is used because of one field  of the structure, which contains<br />
the ASCII values that form &#8220;Rich&#8221;. After the DOS stub the &#8220;rich&#8221; structure is<br />
stored. This structure is created by the ms linker and consists mainly of compiler<br />
id&#8217;s which are gathered by the linker from the used .obj and .lib files. These<br />
compiler id&#8217;s are stored in the files by the ms compiler in the &#8216;comp.id&#8217; fields,<br />
and contain the version number of the compiler. Newer linkers from ms also add<br />
their linker id to the exe file.</p>
<p>The &#8220;rich&#8221; structure is in the following format:</p>
<p>a, b, b, b      &#8212; identification block / header?</p>
<p>compid^b, r^b   &#8212; from 0<br />
..              &#8212;      :<br />
compid^b, r^b   &#8212; to   n</p>
<p>&#8216;Rich&#8217;, b       &#8212; terminator</p>
<p>padding</p>
<p>Where all variables are dwords. b is the checksum i&#8217;ll describe later, and<br />
a=b^0x536e6144. This value is a hardcoded value and appearantly always used.<br />
compid is the compiler id and b is the number of times it was encountered<br />
over all the lib/obj files (that is an assumption, i&#8217;m not 100% sure). And<br />
n is number of stored compid&#8217;s. compid&#8217;s are dwords too, the lower word is<br />
the minor version number (0-9999 decimal), the high word is the major<br />
number. i don&#8217;t know how the high word is encoded, but 13.10 appears is<br />
encoded as 0x60, and 7.10 as 0x5a. and yes, i see that 0x60-0x5a is the same<br />
as 13-7 decimal, but where did the 0x53 (0x60-13decimal) came from? and where<br />
is the 10 from the verison number stored?</p>
<p>The size of the &#8220;rich&#8221; structure is ((b/32)%3 + n)*8 + 0x20 bytes. the unused<br />
space is padded with zeroes.</p>
<p>b is calculated in these steps:</p>
<p>b=sizeof(dos_stub)              // (almost always 0x80)</p>
<p>then the checksum of the dos_stub, with the pointer to the PE zeroed out, is<br />
calculated in the following way:</p>
<p>for(int i=0; i&lt;sizeof(dos_stub); i++)<br />
{<br />
    b += dos_stub[i] ROL i;     // ROL is the x86 rotate over left operation.<br />
}</p>
<p>when the default dos stub of 0x80 bytes is used, b contains now 0x884f3421</p>
<p>next, a checksum over the various compiler id&#039;s is calculated in this way:</p>
<p>for(int i=0; i&lt;n; i++)<br />
{<br />
    b += compid[i] ROL r[i];<br />
}</p>
<p>as stated above, r appears to be the number of times that compid is<br />
encountered in the libs/objs.</p>
<p>* Conclusion</p>
<p>The linker doesn&#039;t store your the MAC address of your NIC nor your DNA profile,<br />
but better remove it anyway ;). You can write a very simple tool that will<br />
zero out the rich structure given an exe file, or patch your linker so that it<br />
won&#039;t get written at all. For my investigation I used the Microsoft Visual C++<br />
Toolkit 2003 with the &quot;same compiler and linker that ship with Visual Studio<br />
.NET 2003 Professional!&quot; which you can download for free from microsoft.com,<br />
google for &quot;VCToolkitSetup.exe&quot;. You can locate the interesting parts of code<br />
by searching link.exe for the string &#039;Rich&#039; or in the function starting at<br />
0x459090.</p>
<p>* Some additional last minute notes:</p>
<p>Disavowed told me on the RCE board that the constant 0x536e6144 is equal to<br />
Dan^ in ASCII, and Silver had an some additional information about &quot;Dan&quot;:<br />
Dan Ruder, Mechanics of Dynamic Linking, Microsoft, MSDN Library 1993, as<br />
referenced by patent 6253258 filed by Symantec for &quot;Subclassing system for<br />
computer that operates with portable-executable (PE) modules&quot;. Well, that must<br />
be &quot;our&quot; magic Dan, shouldn&#039;t he?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Pistelli		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-98</link>

		<dc:creator><![CDATA[Daniel Pistelli]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 19:18:49 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-98</guid>

					<description><![CDATA[Thanks for confirming! Those were other times, lots of these Easter eggs everywhere. :)]]></description>
			<content:encoded><![CDATA[<p>Thanks for confirming! Those were other times, lots of these Easter eggs everywhere. 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: AnotherVCGuy		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-97</link>

		<dc:creator><![CDATA[AnotherVCGuy]]></dc:creator>
		<pubDate>Sun, 21 Jul 2013 06:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-97</guid>

					<description><![CDATA[Yes, I also worked on the VC Team long back. Richard Shupak is spelt without the &#039;c&#039;, I think. Shupak worked in the MS Research team under Amitabh Srivastava then. But he used to do checkins in a lot of VC related code base - linkers, libraries etc.]]></description>
			<content:encoded><![CDATA[<p>Yes, I also worked on the VC Team long back. Richard Shupak is spelt without the &#8216;c&#8217;, I think. Shupak worked in the MS Research team under Amitabh Srivastava then. But he used to do checkins in a lot of VC related code base &#8211; linkers, libraries etc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Pistelli		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-96</link>

		<dc:creator><![CDATA[Daniel Pistelli]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 20:43:01 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-96</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/microsofts-rich-signature-undocumented/#comment-95&quot;&gt;spongman&lt;/a&gt;.

Interesting anecdote! Thanks for sharing! :)

I will have to check PDB! :P]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/microsofts-rich-signature-undocumented/#comment-95">spongman</a>.</p>
<p>Interesting anecdote! Thanks for sharing! 🙂</p>
<p>I will have to check PDB! 😛</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: spongman		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-95</link>

		<dc:creator><![CDATA[spongman]]></dc:creator>
		<pubDate>Mon, 19 Mar 2012 17:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-95</guid>

					<description><![CDATA[Wow, blast from the past. i worked in the VC team back then (not on the linker, though). &#039;Rich&#039; is almost certainly short for &#039;Richard Shupack&#039; from MS research who worked on linker/loader stuff in NT (among a whole bunch of other stuff), and &#039;DanS&#039; is probably &#039;Dan Spalding&#039; who, i think, ran the linker team back then. Their initials also show up in the MSF/PDB format.]]></description>
			<content:encoded><![CDATA[<p>Wow, blast from the past. i worked in the VC team back then (not on the linker, though). &#8216;Rich&#8217; is almost certainly short for &#8216;Richard Shupack&#8217; from MS research who worked on linker/loader stuff in NT (among a whole bunch of other stuff), and &#8216;DanS&#8217; is probably &#8216;Dan Spalding&#8217; who, i think, ran the linker team back then. Their initials also show up in the MSF/PDB format.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ntoskrnl		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-94</link>

		<dc:creator><![CDATA[Ntoskrnl]]></dc:creator>
		<pubDate>Fri, 23 May 2008 13:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-94</guid>

					<description><![CDATA[Sorry, we posted together =)&lt;br/&gt;&lt;br/&gt;Yes I knew about it, but it&#039;s good that you mention it.&lt;br/&gt;&lt;br/&gt;I would like to go back to these kind of topics. I don&#039;t want to become the .NET guy.. =)]]></description>
			<content:encoded><![CDATA[<p>Sorry, we posted together =)</p>
<p>Yes I knew about it, but it&#8217;s good that you mention it.</p>
<p>I would like to go back to these kind of topics. I don&#8217;t want to become the .NET guy.. =)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ntoskrnl		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-93</link>

		<dc:creator><![CDATA[Ntoskrnl]]></dc:creator>
		<pubDate>Fri, 23 May 2008 13:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-93</guid>

					<description><![CDATA[Hello, thanks snaury. Yes, I&#039;m now familiar with the article on asmcommunity, but it was totally unknown to me at the time I wrote the article. Otherwise I would have mentioned it. At the time I looked on google for Rich Signature and found only two topics in forums which talked in a very generic way about it. It&#039;s difficult to look for past research about a topic if the information is relegated to closed forums: I can&#039;t possibly check them all. Again, I&#039;m glad you liked the article.]]></description>
			<content:encoded><![CDATA[<p>Hello, thanks snaury. Yes, I&#8217;m now familiar with the article on asmcommunity, but it was totally unknown to me at the time I wrote the article. Otherwise I would have mentioned it. At the time I looked on google for Rich Signature and found only two topics in forums which talked in a very generic way about it. It&#8217;s difficult to look for past research about a topic if the information is relegated to closed forums: I can&#8217;t possibly check them all. Again, I&#8217;m glad you liked the article.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Snaury		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-92</link>

		<dc:creator><![CDATA[Snaury]]></dc:creator>
		<pubDate>Fri, 23 May 2008 13:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-92</guid>

					<description><![CDATA[But you already knew all that. My bad. %)]]></description>
			<content:encoded><![CDATA[<p>But you already knew all that. My bad. %)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Snaury		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-91</link>

		<dc:creator><![CDATA[Snaury]]></dc:creator>
		<pubDate>Fri, 23 May 2008 13:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-91</guid>

					<description><![CDATA[Ah! Further searching got me this: http://www.asmcommunity.net/board/index.php?topic=11182&lt;br/&gt;&lt;br/&gt;There&#039;s the link to your article as well as to an older short article from 2004. :)]]></description>
			<content:encoded><![CDATA[<p>Ah! Further searching got me this: <a href="http://www.asmcommunity.net/board/index.php?topic=11182" rel="nofollow ugc">http://www.asmcommunity.net/board/index.php?topic=11182</a></p>
<p>There&#8217;s the link to your article as well as to an older short article from 2004. 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Snaury		</title>
		<link>https://ntcore.com/microsofts-rich-signature-undocumented/#comment-90</link>

		<dc:creator><![CDATA[Snaury]]></dc:creator>
		<pubDate>Fri, 23 May 2008 13:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://rcecafe.net/?p=27#comment-90</guid>

					<description><![CDATA[Wow, thanks a lot for your article! =^_^= Back in the times I never found enough time or will to find what it actually stores there, I was just always patching link.exe to never do that, see http://snaury.livejournal.com/72193.html&lt;br/&gt;&lt;br/&gt;As for information being non-existent, I remember I&#039;ve seen a mention of this topic on www.wasm.ru. Ah, right! Searching for &quot;rich inurl:www.wasm.ru&quot; got me this: http://www.wasm.ru/baixado.php?mode=tool&amp;id=244 (there&#039;s an RTF file inside the archive, the article dated January 2004). There&#039;s nothing interesting in there, just a mention of a way to disable this and analysis left as a homework, but still I think people have been interested by this Rich thing for a long time. :)&lt;br/&gt;&lt;br/&gt;Anyway, great analysis from you. Respect!]]></description>
			<content:encoded><![CDATA[<p>Wow, thanks a lot for your article! =^_^= Back in the times I never found enough time or will to find what it actually stores there, I was just always patching link.exe to never do that, see <a href="http://snaury.livejournal.com/72193.html" rel="nofollow ugc">http://snaury.livejournal.com/72193.html</a></p>
<p>As for information being non-existent, I remember I&#8217;ve seen a mention of this topic on <a href="http://www.wasm.ru" rel="nofollow ugc">http://www.wasm.ru</a>. Ah, right! Searching for &#8220;rich inurl:www.wasm.ru&#8221; got me this: <a href="http://www.wasm.ru/baixado.php?mode=tool&#038;id=244" rel="nofollow ugc">http://www.wasm.ru/baixado.php?mode=tool&#038;id=244</a> (there&#8217;s an RTF file inside the archive, the article dated January 2004). There&#8217;s nothing interesting in there, just a mention of a way to disable this and analysis left as a homework, but still I think people have been interested by this Rich thing for a long time. 🙂</p>
<p>Anyway, great analysis from you. Respect!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
