<?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>MetaData &#8211; NTCore</title>
	<atom:link href="https://ntcore.com/tag/metadata/feed/" rel="self" type="application/rss+xml" />
	<link>https://ntcore.com</link>
	<description></description>
	<lastBuildDate>Fri, 29 May 2009 23:54:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://ntcore.com/wp-content/uploads/2018/07/cropped-ntcore_icon-2-32x32.png</url>
	<title>MetaData &#8211; NTCore</title>
	<link>https://ntcore.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">184274875</site>	<item>
		<title>.NET MetaData Tables Reports</title>
		<link>https://ntcore.com/net-metadata-tables-reports/</link>
					<comments>https://ntcore.com/net-metadata-tables-reports/#respond</comments>
		
		<dc:creator><![CDATA[Erik Pistelli]]></dc:creator>
		<pubDate>Fri, 29 May 2009 23:54:38 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[CFF Explorer]]></category>
		<category><![CDATA[MetaData]]></category>
		<guid isPermaLink="false">http://rcecafe.net/?p=89</guid>

					<description><![CDATA[I updated the scripting language of the old CFF Explorer which now provides a function to automatically create reports of .NET metadata tables. The function is called LogPrintStruct and is to be used along with the logging functions the scripting provides. Here&#8217;s a small script you can find in the &#8220;Scripts&#8221; directory of the CFF &#8230; <a href="https://ntcore.com/net-metadata-tables-reports/" class="more-link">Continue reading<span class="screen-reader-text"> ".NET MetaData Tables Reports"</span></a>]]></description>
										<content:encoded><![CDATA[<p>I updated the scripting language of the old CFF Explorer which now provides a function to automatically create reports of .NET metadata tables. The function is called LogPrintStruct and is to be used along with the logging functions the scripting provides. Here&#8217;s a small script you can find in the &#8220;Scripts&#8221; directory of the CFF Explorer which creates a report of all .NET tables contained in an assembly:</p>
<p>[cc lang=&#8221;lua&#8221;]&#8211; this script generates a report of a PE&#8217;s .NET metadata tables.</p>
<p>filename = GetOpenFile(&#8220;Open&#8230;&#8221;,  &#8220;All\n*.*\nexe\n*.exe\ndll\n*.dll\n&#8221;)</p>
<p>if filename == null then<br />
	return<br />
end</p>
<p>hPE = OpenFile(filename)</p>
<p>if hPE == null then<br />
	return<br />
end</p>
<p>if GetOffset(hPE, PE_DotNETDirectory) == null then<br />
	MsgBox(&#8220;The current is not a valid .NET assembly.&#8221;, &#8220;Error&#8221;, MB_ICONEXCLAMATION)<br />
end</p>
<p>repname = GetSaveFile(&#8220;Save Report As..&#8221;,  &#8220;Text File\n*.txt\n&#8221;)</p>
<p>if repname == null then<br />
	return<br />
end</p>
<p>hReport = CreateLog(repname)</p>
<p>if hReport == null then<br />
	return<br />
end</p>
<p>fieldsToLog = {<br />
	PE_MetaDataTable_Module,<br />
	PE_MetaDataTable_TypeRef,<br />
	PE_MetaDataTable_TypeDef,<br />
	PE_MetaDataTable_Field,<br />
	PE_MetaDataTable_Method,<br />
	PE_MetaDataTable_Param,<br />
	PE_MetaDataTable_InterfaceImpl,<br />
	PE_MetaDataTable_MemberRef,<br />
	PE_MetaDataTable_Constant,<br />
	PE_MetaDataTable_CustomAttribute,<br />
	PE_MetaDataTable_FieldMarshal,<br />
	PE_MetaDataTable_DeclSecurity,<br />
	PE_MetaDataTable_ClassLayout,<br />
	PE_MetaDataTable_FieldLayout,<br />
	PE_MetaDataTable_StandAloneSig,<br />
	PE_MetaDataTable_EventMap,<br />
	PE_MetaDataTable_Event,<br />
	PE_MetaDataTable_PropertyMap,<br />
	PE_MetaDataTable_Property,<br />
	PE_MetaDataTable_MethodSemantics,<br />
	PE_MetaDataTable_MethodImpl,<br />
	PE_MetaDataTable_ModuleRef,<br />
	PE_MetaDataTable_TypeSpec,<br />
	PE_MetaDataTable_ImplMap,<br />
	PE_MetaDataTable_FieldRVA,<br />
	PE_MetaDataTable_Assembly,<br />
	PE_MetaDataTable_AssemblyProcessor,<br />
	PE_MetaDataTable_AssemblyOS,<br />
	PE_MetaDataTable_AssemblyRef,<br />
	PE_MetaDataTable_AssemblyRefProcessor,<br />
	PE_MetaDataTable_AssemblyRefOS,<br />
	PE_MetaDataTable_File,<br />
	PE_MetaDataTable_ExportedType,<br />
	PE_MetaDataTable_ManifestResource,<br />
	PE_MetaDataTable_NestedClass,<br />
	PE_MetaDataTable_GenericParam,<br />
	PE_MetaDataTable_MethodSpec,<br />
	PE_MetaDataTable_GenericParamConstraint<br />
	}</p>
<p>fieldNames = {<br />
	&#8220;Module&#8221;,<br />
	&#8220;TypeRef&#8221;,<br />
	&#8220;TypeDef&#8221;,<br />
	&#8220;Field&#8221;,<br />
	&#8220;Method&#8221;,<br />
	&#8220;Param&#8221;,<br />
	&#8220;InterfaceImpl&#8221;,<br />
	&#8220;MemberRef&#8221;,<br />
	&#8220;Constant&#8221;,<br />
	&#8220;CustomAttribute&#8221;,<br />
	&#8220;FieldMarshal&#8221;,<br />
	&#8220;DeclSecurity&#8221;,<br />
	&#8220;ClassLayout&#8221;,<br />
	&#8220;FieldLayout&#8221;,<br />
	&#8220;StandAloneSig&#8221;,<br />
	&#8220;EventMap&#8221;,<br />
	&#8220;Event&#8221;,<br />
	&#8220;PropertyMap&#8221;,<br />
	&#8220;Property&#8221;,<br />
	&#8220;MethodSemantics&#8221;,<br />
	&#8220;MethodImpl&#8221;,<br />
	&#8220;ModuleRef&#8221;,<br />
	&#8220;TypeSpec&#8221;,<br />
	&#8220;ImplMap&#8221;,<br />
	&#8220;FieldRVA&#8221;,<br />
	&#8220;Assembly&#8221;,<br />
	&#8220;AssemblyProcessor&#8221;,<br />
	&#8220;AssemblyOS&#8221;,<br />
	&#8220;AssemblyRef&#8221;,<br />
	&#8220;AssemblyRefProcessor&#8221;,<br />
	&#8220;AssemblyRefOS&#8221;,<br />
	&#8220;File&#8221;,<br />
	&#8220;ExportedType&#8221;,<br />
	&#8220;ManifestResource&#8221;,<br />
	&#8220;NestedClass&#8221;,<br />
	&#8220;GenericParam&#8221;,<br />
	&#8220;MethodSpec&#8221;,<br />
	&#8220;GenericParamConstraint&#8221;<br />
	}</p>
<p>LogPrint(hReport, &#8220;.NET metadata tables report for \&#8221;&#8221; .. filename .. &#8220;\&#8221;\n\n&#8221;)<br />
loggedTables = 0<br />
for i = 0, #fieldsToLog &#8211; 1 do<br />
	if GetOffset(hPE, fieldsToLog[i]) != null then<br />
		if loggedTables > 0 then<br />
			LogPrint(hReport, &#8220;\n\n\n&#8221;)<br />
		end<br />
		LogPrint(hReport, fieldNames[i] .. &#8221; Table\n&#8221;)<br />
		LogPrint(hReport, &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;\n\n&#8221;)<br />
		LogPrintStruct(hPE, hReport, fieldsToLog[i])<br />
		loggedTables = loggedTables + 1<br />
	end<br />
end</p>
<p>&#8212; Open the report?</p>
<p>CloseLog(hReport)</p>
<p>nRet = MsgBox(&#8220;Open report file?&#8221;, &#8220;.NET Tables Report&#8221;, MB_ICONQUESTION | MB_YESNO)</p>
<p>if nRet == IDYES then<br />
	ExecuteAppAndWait(@&#8221;C:\Windows\System32\notepad.exe&#8221;, GetShortPathName(repname))<br />
end[/cc]</p>
<p>A generated report file looks like this:</p>
<p>[cc lang=&#8221;asm&#8221;].NET metadata tables report for &#8220;K:\Explorer Suite\Setup\Signature Explorer.exe&#8221;</p>
<p>Module Table<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>1.<br />
Generation: 0<br />
Name: 1 (Signature Explorer.exe)<br />
Mvid: 1<br />
EncId: 0<br />
EncBaseId: 0</p>
<p>TypeRef Table<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>1.<br />
ResolutionScope: 6<br />
Name: 18 (Control)<br />
Namespace: 20 (System.Windows.Forms)</p>
<p>2.<br />
ResolutionScope: A<br />
Name: 35 (Enum)<br />
Namespace: 3A (System)</p>
<p>3.<br />
ResolutionScope: 6<br />
Name: 41 (Button)<br />
Namespace: 20 (System.Windows.Forms)</p>
<p>4.<br />
ResolutionScope: 6<br />
Name: 48 (Form)<br />
Namespace: 20 (System.Windows.Forms)</p>
<p>5.<br />
ResolutionScope: A<br />
Name: 4D (Object)<br />
Namespace: 3A (System)</p>
<p>6.<br />
ResolutionScope: A<br />
Name: 54 (ValueType)<br />
Namespace: 3A (System)</p>
<p>etc.[/cc]</p>
<p>I included this new feature because many developers asked me to. Reading the generated report files is much easier than manually reading the raw .NET format. The current scripting system won&#8217;t be implemented in the newer CFF Explorer, I only inserted this new feature because it will take me much more time to release the newer CFF Explorer. </p>
<p>Thanks to CodeRipper for signalling a corrupted .NET assembly which caused the CFF Explorer to crash when opening it. I improved the integrity checks.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ntcore.com/net-metadata-tables-reports/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">89</post-id>	</item>
	</channel>
</rss>
