<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Reverse engineering with a VM</title>
	<atom:link href="http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/feed/" rel="self" type="application/rss+xml" />
	<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/</link>
	<description>Embedded security, crypto, software protection</description>
	<lastBuildDate>Mon, 08 Mar 2010 21:19:29 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: newsham</title>
		<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-1035</link>
		<dc:creator>newsham</dc:creator>
		<pubDate>Sun, 29 Apr 2007 07:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-1035</guid>
		<description>re: &quot;backstep,&quot;  I just came across simics&#039; &quot;hindsight&quot;:
http://www.virtutech.com/products/simics-hindsight.html
&quot;Simics Hindsight is the first complete, general-purpose tool for reverse execution and debugging of arbitrary electronic systems.&quot;</description>
		<content:encoded><![CDATA[<p>re: &#8220;backstep,&#8221;  I just came across simics&#8217; &#8220;hindsight&#8221;:<br />
<a href="http://www.virtutech.com/products/simics-hindsight.html" rel="nofollow">http://www.virtutech.com/products/simics-hindsight.html</a><br />
&#8220;Simics Hindsight is the first complete, general-purpose tool for reverse execution and debugging of arbitrary electronic systems.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Lawson</title>
		<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-852</link>
		<dc:creator>Nate Lawson</dc:creator>
		<pubDate>Tue, 24 Apr 2007 01:37:15 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-852</guid>
		<description>Jordan, that&#039;s great that they added that feature.  I&#039;m a little disappointed it doesn&#039;t include &quot;backstep&quot; capability though since they obviously have the full log of the instruction trace.  It&#039;s really helpful to be able to back up the state one op at a time to do a binary search for a bug.  You could do that with the VMware approach by dividing the recorded trace into smaller and smaller chunks, but it&#039;s not as easy to use for this.  It&#039;s still good that they are going that direction.</description>
		<content:encoded><![CDATA[<p>Jordan, that&#8217;s great that they added that feature.  I&#8217;m a little disappointed it doesn&#8217;t include &#8220;backstep&#8221; capability though since they obviously have the full log of the instruction trace.  It&#8217;s really helpful to be able to back up the state one op at a time to do a binary search for a bug.  You could do that with the VMware approach by dividing the recorded trace into smaller and smaller chunks, but it&#8217;s not as easy to use for this.  It&#8217;s still good that they are going that direction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan Wiens</title>
		<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-842</link>
		<dc:creator>Jordan Wiens</dc:creator>
		<pubDate>Mon, 23 Apr 2007 18:04:26 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-842</guid>
		<description>Also in VMWare 6.0, Record and Replay:

http://blogs.vmware.com/sherrod/2007/04/the_amazing_vm_.html

Sounds pretty similar to what you&#039;re suggesting.  When I first heard about it, I was pretty excited.  VMWare 6.0 is impressive.</description>
		<content:encoded><![CDATA[<p>Also in VMWare 6.0, Record and Replay:</p>
<p><a href="http://blogs.vmware.com/sherrod/2007/04/the_amazing_vm_.html" rel="nofollow">http://blogs.vmware.com/sherrod/2007/04/the_amazing_vm_.html</a></p>
<p>Sounds pretty similar to what you&#8217;re suggesting.  When I first heard about it, I was pretty excited.  VMWare 6.0 is impressive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nolan</title>
		<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-841</link>
		<dc:creator>nolan</dc:creator>
		<pubDate>Mon, 23 Apr 2007 17:42:45 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-841</guid>
		<description>Nate,

What you describe can work.  One (and only one) VM can be linearly mapped with PA 0 being MA 0.

VMware doesn&#039;t do this, nor does Xen or KVM out of the box.  It would be very difficult to make this happen on a hosted VMM, as most OSes do not provide an easy way to allocate large contiguous chunks of memory, much less ones that start at PA 0.

There is a company called &quot;Neocleus&quot; that has patches for Xen for this purpose, but I don&#039;t think they&#039;ve released them publicly yet.  I believe it is their intention to do so eventually, so you might try contacting Guy Zana there if you&#039;re interested.</description>
		<content:encoded><![CDATA[<p>Nate,</p>
<p>What you describe can work.  One (and only one) VM can be linearly mapped with PA 0 being MA 0.</p>
<p>VMware doesn&#8217;t do this, nor does Xen or KVM out of the box.  It would be very difficult to make this happen on a hosted VMM, as most OSes do not provide an easy way to allocate large contiguous chunks of memory, much less ones that start at PA 0.</p>
<p>There is a company called &#8220;Neocleus&#8221; that has patches for Xen for this purpose, but I don&#8217;t think they&#8217;ve released them publicly yet.  I believe it is their intention to do so eventually, so you might try contacting Guy Zana there if you&#8217;re interested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Lawson</title>
		<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-825</link>
		<dc:creator>Nate Lawson</dc:creator>
		<pubDate>Mon, 23 Apr 2007 03:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-825</guid>
		<description>nolan, thanks for the explanation.  It&#039;s been a while since I looked at VMware-type approaches.  Is there any reason why the host OS can&#039;t reserve MAs that equal PAs requested by the guest OS?  That way the DMA will proceed normally without overwriting anything.  The host could even spoof an overly restrictive E820h BIOS map to convince the guest OS not to use anything other than a strict range of PAs.

What do you think?  Remember, the goal is to provide full device passthrough without modifying the guest OS.  It doesn&#039;t matter if the host OS has to reserve 90% of its RAM or open itself up security-wise during the reverse engineering.</description>
		<content:encoded><![CDATA[<p>nolan, thanks for the explanation.  It&#8217;s been a while since I looked at VMware-type approaches.  Is there any reason why the host OS can&#8217;t reserve MAs that equal PAs requested by the guest OS?  That way the DMA will proceed normally without overwriting anything.  The host could even spoof an overly restrictive E820h BIOS map to convince the guest OS not to use anything other than a strict range of PAs.</p>
<p>What do you think?  Remember, the goal is to provide full device passthrough without modifying the guest OS.  It doesn&#8217;t matter if the host OS has to reserve 90% of its RAM or open itself up security-wise during the reverse engineering.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nolan</title>
		<link>http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-819</link>
		<dc:creator>nolan</dc:creator>
		<pubDate>Mon, 23 Apr 2007 01:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://rdist.root.org/2007/04/21/reverse-engineering-with-a-vm/#comment-819</guid>
		<description>Nate,

When you&#039;re running an OS in a VMM, the virtual memory mapping has 3 layers instead of the usual 2.  To use VMware&#039;s terminology, you have your guest kernel mapping from Virtual Addresses (VAs) to Physical Addresses (PAs).  The monitor then maps the guest&#039;s PAs to Machine Addresses (MAs) which are what in the non virtualized case you would call Physical Addresses.  This mapping is usually done using shadow page tables, but Intel and AMD chips coming real soon now will support the extra mapping in hardware (called Extended Page Tables and Nested Page Tables respectively).  If you&#039;re more used to Xen&#039;s terminology, simply s/PA/Guest PA/g and s/MA/Host PA/g.

With that background out of the way, you have a driver in your guest poking PAs into the hardware, telling it to do a DMA to or from them.  Without an IOMMU to do the PA-&gt;MA mapping, the hardware will happily use the PA as an MA, and clobber whatever memory had the bad luck to be at that MA.  You certainly won&#039;t get correct results; more likely you&#039;ll get total flaming death.

Xen can do PCI device passthrough with paravirtualized guests without an IOMMU because it changes the guest kernel&#039;s DMA mapping functions to translate PAs to MAs.  This doesn&#039;t help you with Windows, and while it works correctly, it is obviously completely insecure; any guest with direct access to a DMA capable device can simply program it directly to DMA anywhere in memory, including memory owned by other guests or the hypervisor/VMM.</description>
		<content:encoded><![CDATA[<p>Nate,</p>
<p>When you&#8217;re running an OS in a VMM, the virtual memory mapping has 3 layers instead of the usual 2.  To use VMware&#8217;s terminology, you have your guest kernel mapping from Virtual Addresses (VAs) to Physical Addresses (PAs).  The monitor then maps the guest&#8217;s PAs to Machine Addresses (MAs) which are what in the non virtualized case you would call Physical Addresses.  This mapping is usually done using shadow page tables, but Intel and AMD chips coming real soon now will support the extra mapping in hardware (called Extended Page Tables and Nested Page Tables respectively).  If you&#8217;re more used to Xen&#8217;s terminology, simply s/PA/Guest PA/g and s/MA/Host PA/g.</p>
<p>With that background out of the way, you have a driver in your guest poking PAs into the hardware, telling it to do a DMA to or from them.  Without an IOMMU to do the PA-&gt;MA mapping, the hardware will happily use the PA as an MA, and clobber whatever memory had the bad luck to be at that MA.  You certainly won&#8217;t get correct results; more likely you&#8217;ll get total flaming death.</p>
<p>Xen can do PCI device passthrough with paravirtualized guests without an IOMMU because it changes the guest kernel&#8217;s DMA mapping functions to translate PAs to MAs.  This doesn&#8217;t help you with Windows, and while it works correctly, it is obviously completely insecure; any guest with direct access to a DMA capable device can simply program it directly to DMA anywhere in memory, including memory owned by other guests or the hypervisor/VMM.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
