<?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: You Won&#8217;t Learn This in School: Disabling Kernel Functions in Your Process</title>
	<atom:link href="http://chadaustin.me/2009/03/disabling-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://chadaustin.me/2009/03/disabling-functions/</link>
	<description></description>
	<lastBuildDate>Sun, 22 Jan 2012 21:02:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chad Austin</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-10561</link>
		<dc:creator>Chad Austin</dc:creator>
		<pubDate>Wed, 02 Sep 2009 20:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-10561</guid>
		<description>Hm, I&#039;m referring to hooking IATs before libraries are loaded.  We use a library called &quot;APIHook&quot; to patch up IATs at application start, but we load Flash and Direct3D dynamically.  After loading d3d.dll or flash10b.ocx, we&#039;d have to remember to modify their IATs too.

Or maybe my terminology is screwed up and we&#039;re talking about different things?</description>
		<content:encoded><![CDATA[<p>Hm, I&#8217;m referring to hooking IATs before libraries are loaded.  We use a library called &#8220;APIHook&#8221; to patch up IATs at application start, but we load Flash and Direct3D dynamically.  After loading d3d.dll or flash10b.ocx, we&#8217;d have to remember to modify their IATs too.</p>
<p>Or maybe my terminology is screwed up and we&#8217;re talking about different things?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Betts</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-10560</link>
		<dc:creator>Paul Betts</dc:creator>
		<pubDate>Wed, 02 Sep 2009 20:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-10560</guid>
		<description>@Chad No you don&#039;t - LL will not overwrite your change once the library is loaded, it&#039;ll just increment the refcount on the DLL. Once you rig the IAT, it&#039;ll stay rigged. This is the main mechanism as to how AppCompat shims work</description>
		<content:encoded><![CDATA[<p>@Chad No you don&#8217;t &#8211; LL will not overwrite your change once the library is loaded, it&#8217;ll just increment the refcount on the DLL. Once you rig the IAT, it&#8217;ll stay rigged. This is the main mechanism as to how AppCompat shims work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Austin</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-10545</link>
		<dc:creator>Chad Austin</dc:creator>
		<pubDate>Wed, 02 Sep 2009 18:10:04 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-10545</guid>
		<description>Hi Paul,

I agree, and we patch the IAT for a ton of other functions (including HeapAlloc and some of the mm APIs for our Flash integration) but you have to remember to patch the IAT after you LoadLibrary every dynamic component.

If you modify the function directly, the change will persist for all dynamically-loaded libraries.

Cheers,
Chad</description>
		<content:encoded><![CDATA[<p>Hi Paul,</p>
<p>I agree, and we patch the IAT for a ton of other functions (including HeapAlloc and some of the mm APIs for our Flash integration) but you have to remember to patch the IAT after you LoadLibrary every dynamic component.</p>
<p>If you modify the function directly, the change will persist for all dynamically-loaded libraries.</p>
<p>Cheers,<br />
Chad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Betts</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-10539</link>
		<dc:creator>Paul Betts</dc:creator>
		<pubDate>Wed, 02 Sep 2009 16:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-10539</guid>
		<description>This trick works, but it&#039;s actually better to patch the IAT (http://sandsprite.com/CodeStuff/Understanding_imports.html) instead of actually editing the code to SetUnhandledExceptionFilter.</description>
		<content:encoded><![CDATA[<p>This trick works, but it&#8217;s actually better to patch the IAT (<a href="http://sandsprite.com/CodeStuff/Understanding_imports.html" rel="nofollow">http://sandsprite.com/CodeStuff/Understanding_imports.html</a>) instead of actually editing the code to SetUnhandledExceptionFilter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duong</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-4633</link>
		<dc:creator>Duong</dc:creator>
		<pubDate>Mon, 20 Apr 2009 10:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-4633</guid>
		<description>It works with 3rd party dlls, but doesn&#039;t work with MS CRT dlls (I tested with msvcr71d.dll). When a function in msvcr71d.dll generates an exception, Windows error report still displays. 
This code snippet will generate an exception in msvcr71d.dll: 
	char * str1=&quot;&quot;;
	char str2[20];
	strncpy(str2, str1,strlen(str1)-10);</description>
		<content:encoded><![CDATA[<p>It works with 3rd party dlls, but doesn&#8217;t work with MS CRT dlls (I tested with msvcr71d.dll). When a function in msvcr71d.dll generates an exception, Windows error report still displays.<br />
This code snippet will generate an exception in msvcr71d.dll:<br />
	char * str1=&#8221;";<br />
	char str2[20];<br />
	strncpy(str2, str1,strlen(str1)-10);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Austin</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-4616</link>
		<dc:creator>Chad Austin</dc:creator>
		<pubDate>Fri, 10 Apr 2009 19:53:44 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-4616</guid>
		<description>Yeah, it works on Vista too.  There are lots of programs that depend on techniques like that, so I can&#039;t imagine it would go away anytime soon.

This is not a security violation or anything.  It just affects the user-mode portion of system API calls in your process.</description>
		<content:encoded><![CDATA[<p>Yeah, it works on Vista too.  There are lots of programs that depend on techniques like that, so I can&#8217;t imagine it would go away anytime soon.</p>
<p>This is not a security violation or anything.  It just affects the user-mode portion of system API calls in your process.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tb</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-4615</link>
		<dc:creator>tb</dc:creator>
		<pubDate>Fri, 10 Apr 2009 19:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-4615</guid>
		<description>But does that technique work on the latest versions of Windows (Vista, Server 2008, Win7)??
I thought for sure they had updated that functionality to prevent that sort of thing (unless you&#039;re in the .NET runtime or something). I&#039;m not sure that code-signing would be very effective against it, but isn&#039;t there a way for a DLL to force read-only loading? or for the OS to monitor for that sort of behavior on DLLs that it knows are critical for the OS? I thought that was the whole reason why Vista was dog-slow.

The next edition of Windows Internals won&#039;t be available until May, so I don&#039;t have a text reference to look, and my searches online are turning up bupkis.
...I guess I&#039;ll just have to try it myself when I get home.</description>
		<content:encoded><![CDATA[<p>But does that technique work on the latest versions of Windows (Vista, Server 2008, Win7)??<br />
I thought for sure they had updated that functionality to prevent that sort of thing (unless you&#8217;re in the .NET runtime or something). I&#8217;m not sure that code-signing would be very effective against it, but isn&#8217;t there a way for a DLL to force read-only loading? or for the OS to monitor for that sort of behavior on DLLs that it knows are critical for the OS? I thought that was the whole reason why Vista was dog-slow.</p>
<p>The next edition of Windows Internals won&#8217;t be available until May, so I don&#8217;t have a text reference to look, and my searches online are turning up bupkis.<br />
&#8230;I guess I&#8217;ll just have to try it myself when I get home.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Austin</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-4612</link>
		<dc:creator>Chad Austin</dc:creator>
		<pubDate>Fri, 10 Apr 2009 16:51:12 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-4612</guid>
		<description>On Win9x, kernel DLLs (and maybe all DLLs?) are mapped into the process read-only, so this technique wouldn&#039;t work.  On NT, DLLs are mapped copy-on-write, so this modification makes a private copy of that page in your process.  Thus, whenever your process calls SetUnhandledExceptionFilter, it will run the modified code, not the original.</description>
		<content:encoded><![CDATA[<p>On Win9x, kernel DLLs (and maybe all DLLs?) are mapped into the process read-only, so this technique wouldn&#8217;t work.  On NT, DLLs are mapped copy-on-write, so this modification makes a private copy of that page in your process.  Thus, whenever your process calls SetUnhandledExceptionFilter, it will run the modified code, not the original.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tb</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-4611</link>
		<dc:creator>tb</dc:creator>
		<pubDate>Fri, 10 Apr 2009 14:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-4611</guid>
		<description>How does the OS let you get away with this? I would think that this kind of behavior would have been prohibited by the same class of security measures implemented with DEP (though, DEP clearly doesn&#039;t apply in this case). I could have sworn I read something about how later versions of Windows don&#039;t allow a process to write into the executable space of a loaded module, but I can&#039;t find the references...</description>
		<content:encoded><![CDATA[<p>How does the OS let you get away with this? I would think that this kind of behavior would have been prohibited by the same class of security measures implemented with DEP (though, DEP clearly doesn&#8217;t apply in this case). I could have sworn I read something about how later versions of Windows don&#8217;t allow a process to write into the executable space of a loaded module, but I can&#8217;t find the references&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://chadaustin.me/2009/03/disabling-functions/comment-page-1/#comment-4579</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 01 Apr 2009 20:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://aegisknight.org/?p=1277#comment-4579</guid>
		<description>Actually, yeah, that&#039;s really obvious. But I&#039;ll pass on working at IMVU ;)</description>
		<content:encoded><![CDATA[<p>Actually, yeah, that&#8217;s really obvious. But I&#8217;ll pass on working at IMVU ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

