<?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/"
	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>majii&#039;s blog</title>
	<atom:link href="http://majii.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://majii.wordpress.com</link>
	<description>nothing of interest here..</description>
	<lastBuildDate>Sat, 25 Jul 2009 06:09:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='majii.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>majii&#039;s blog</title>
		<link>http://majii.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://majii.wordpress.com/osd.xml" title="majii&#039;s blog" />
	<atom:link rel='hub' href='http://majii.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Cro: C++ GUI Wrapper</title>
		<link>http://majii.wordpress.com/2009/07/25/cro-c-gui-wrapper/</link>
		<comments>http://majii.wordpress.com/2009/07/25/cro-c-gui-wrapper/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 06:09:33 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=180</guid>
		<description><![CDATA[Download: http://www.sendspace.com/file/90o7w1 This is just a very, very simple C++ wrapper for the Windows API. It supports buttons, labels, checkboxes, and textboxes. Window events are also added, and the main.cpp given file is an example of using all the features of the wrapper. My long term goal is to implement every Windows API object and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=180&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Download: http://www.sendspace.com/file/90o7w1</p>
<p>This is just a very, very simple C++ wrapper for the Windows API. It supports buttons, labels, checkboxes, and textboxes. Window events are also added, and the main.cpp given file is an example of using all the features of the wrapper.</p>
<p>My long term goal is to implement every Windows API object and events matching such objects.</p>
<p>Short term, I&#8217;m going to try to add scroll bars, and some more window events.</p>
<p>Side-note: It&#8217;s codename is &#8220;Cro&#8221;, as a homage to the MMA fighter, Mirko &#8220;Cro Cop&#8221; Filipović.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=180&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/25/cro-c-gui-wrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Anti-Debug: Another trick?</title>
		<link>http://majii.wordpress.com/2009/07/23/anti-debug-another-trick/</link>
		<comments>http://majii.wordpress.com/2009/07/23/anti-debug-another-trick/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 05:41:53 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=178</guid>
		<description><![CDATA[I was browsing the MSDN library recently in the &#8220;Intrinsics&#8221; index, and found a neat little intrinsic for fetching a pointer to the IDT. Rather than checking the IDT itself, for XP/2000, the pointer itself is something that changes in the context of a debugger. DWORD __inline SiberianTiger::CheckIDT( ) { DWORD returnVal; DWORD_PTR *IDTP = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=178&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was browsing the MSDN library recently in the &#8220;Intrinsics&#8221; index, and found a neat little intrinsic for fetching a pointer to the IDT.  Rather than checking the IDT itself, for XP/2000, the pointer itself is something that changes in the context of a debugger.</p>
<div style="background:#EFEFEF;border:1px solid #cccccc;overflow:scroll;height:250px;padding:1px;">
<pre>
DWORD __inline SiberianTiger::CheckIDT( )
{
	DWORD returnVal;
	DWORD_PTR *IDTP = new DWORD_PTR[4];
	DWORD IDT;
	OSVERSIONINFO osvi;

	osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
	if( GetVersionEx( &amp;osvi ) == 0 )
	{
		#ifdef AGGRESSIVE
			return( 0 );
		#else
			return( 1 );
		#endif
	}

	if( osvi.dwMajorVersion &lt; 6 )
	{
		#ifdef __INTRIN_H_
			__sidt( IDTP );
		#else
			__asm SIDT [IDTP]
		#endif
		IDT = ( DWORD ) IDTP;

		returnVal = ( IDT &amp; 0x373FC8 ) == IDT;
	}
	else
	{
		returnVal = 1;
	}

	return( returnVal );
}
</pre>
</div>
<p>Note: I&#8217;ll probably expand onto this function to check the actual IDT for any breakpoints that may have been set.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=178&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/23/anti-debug-another-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ splash</title>
		<link>http://majii.wordpress.com/2009/07/20/c-splash/</link>
		<comments>http://majii.wordpress.com/2009/07/20/c-splash/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 05:07:20 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=175</guid>
		<description><![CDATA[http://www.sendspace.com/file/uimi9i Using nothing but the Windows API, just replace the &#8220;Splash.bmp&#8221; file with the file of your choice, then compile. Enjoy!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=175&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sendspace.com/file/uimi9i">http://www.sendspace.com/file/uimi9i</a></p>
<p>Using nothing but the Windows API, just replace the &#8220;Splash.bmp&#8221; file with the file of your choice, then compile.  Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=175&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/20/c-splash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Anti-Debug Library: Revision 0.433b</title>
		<link>http://majii.wordpress.com/2009/07/19/anti-debug-library-revision-0-413b/</link>
		<comments>http://majii.wordpress.com/2009/07/19/anti-debug-library-revision-0-413b/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 02:45:14 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=164</guid>
		<description><![CDATA[Update again! No bugfixes, only two new features. Changelog: &#8211; Check for a potential hook on IsDebuggerPresent via setting the BeingDebugged bit in the PEB to &#8220;true&#8221;. &#8211; Remove as much header information as possible; in some debugging situations, errors may arise based off other debugger-caused issues. Download: http://www.sendspace.com/file/u0qeu1 ___ Revision 0.412b A friend bugged [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=164&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Update again!  No bugfixes, only two new features.</p>
<p>Changelog:<br />
 &#8211; Check for a potential hook on IsDebuggerPresent via setting the BeingDebugged bit in the PEB to &#8220;true&#8221;.<br />
 &#8211; Remove as much header information as possible; in some debugging situations, errors may arise based off other debugger-caused issues.</p>
<p>Download: <a href="http://www.sendspace.com/file/u0qeu1">http://www.sendspace.com/file/u0qeu1</a></p>
<p>___</p>
<p>Revision 0.412b</p>
<p>A friend bugged me enough to make some changes to the library, as they lacked the intrinsic library, and weren&#8217;t aiming for any of the gains from it (e.g. x64 compatibility, compiler optimizations, etc).</p>
<p>Changelog:<br />
 &#8211; Addition of non-intrinsic support, for backward compatibility.<br />
 &#8211; Compiler customization (Defining of WIN32_LEAN_AND_MEAN, along with inclusion of the SiberianTiger.h header file only once).<br />
 &#8211; Trap flag check wasn&#8217;t working correctly; my correction was actually added incorrectly, but, I got it, thanks to the title, &#8220;Guide to assembly language programming in Linux&#8221;, for a particular page on <a href="http://books.google.com/books?id=wS4EG0GyKXUC&amp;pg=RA1-PA410&amp;lpg=RA1-PA410&amp;ots=5fRJuDpajn">Google Books</a>.<br />
 &#8211; I didn&#8217;t add the fix for the passive stack-segment flag trick in the last build; added.</p>
<p>Download: <a href="http://www.sendspace.com/file/j1rdrc">http://www.sendspace.com/file/j1rdrc</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=164&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/19/anti-debug-library-revision-0-413b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Anti-Debug Library: Revision 0.4b</title>
		<link>http://majii.wordpress.com/2009/07/19/anti-debug-lib-revision-0-4b/</link>
		<comments>http://majii.wordpress.com/2009/07/19/anti-debug-lib-revision-0-4b/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 01:34:43 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=159</guid>
		<description><![CDATA[After work on a few other libraries, I hopped back to AD, and made some much-needed revisions. Download: http://www.sendspace.com/file/j30u3p Changelog: &#8211; Each anti-debug trick added into a &#8220;new&#8221; function, with a return code of 0 if an error occurs &#8211; Class, variable, and function renaming &#8211; Creation of an exit code table; each exit has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=159&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After work on a few other libraries, I hopped back to AD, and made some much-needed revisions.</p>
<p>Download: http://www.sendspace.com/file/j30u3p</p>
<p>Changelog:<br />
 &#8211; Each anti-debug trick added into a &#8220;new&#8221; function, with a return code of 0 if an error occurs<br />
 &#8211; Class, variable, and function renaming<br />
 &#8211; Creation of an exit code table; each exit has an identifiable name identified by a preprocessor macro in the header file.<br />
 &#8211; Repairing functions that were broken (Thanks to Venus/Galco on that note; some casting gone wrong broke NtGlobalFlags check and HeapFlags check).<br />
 &#8211; Addition of &#8220;AGGRESSIVE&#8221; mode; it&#8217;s assumed if an error occurs for any API call, then a debugger was at work.  Also, a call to &#8220;BlockInput&#8221; is made in the shutdown message, intended to anger the potential cracker.<br />
- Separation of &#8220;passive&#8221; and &#8220;aggressive&#8221; checks; passive tricks attempt to silently kill a debugger, aggressive run checks for a debugger, and die dependent on the result.<br />
- Repair of trap-flag trick and stack register trick.<br />
- Addition of changelogs; I think they were needed <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=159&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/19/anti-debug-lib-revision-0-4b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Anti-Debug Library: Revision 0.301b</title>
		<link>http://majii.wordpress.com/2009/07/17/anti-debug-revision-0-301b/</link>
		<comments>http://majii.wordpress.com/2009/07/17/anti-debug-revision-0-301b/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 21:55:02 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=156</guid>
		<description><![CDATA[Download: http://www.sendspace.com/file/5p3leh I&#8217;ve set up a class to handle the anti-debug portion; still works on x86(-x64) Windows Vista (SP0-SP1), Windows XP (SP0-SP3), and Windows 2000 (SP0-SP4). All you have to do is initialize the class (i.e. &#8220;antiDebug antiDebug;&#8221;), and the anti-debug code will be all taken care of<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=156&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Download: <a href="http://www.sendspace.com/file/5p3leh">http://www.sendspace.com/file/5p3leh</a></p>
<p>I&#8217;ve set up a class to handle the anti-debug portion; still works on x86(-x64) Windows Vista (SP0-SP1), Windows XP (SP0-SP3), and Windows 2000 (SP0-SP4).  All you have to do is initialize the class (i.e. &#8220;antiDebug antiDebug;&#8221;), and the anti-debug code will be all taken care of <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=156&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/17/anti-debug-revision-0-301b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Anti-Debug Library: x64-compatible!</title>
		<link>http://majii.wordpress.com/2009/07/17/anti-debug-x64-compatible/</link>
		<comments>http://majii.wordpress.com/2009/07/17/anti-debug-x64-compatible/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 16:08:18 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=151</guid>
		<description><![CDATA[Thanks to Chazwazza over at GameDeception for some much needed aid in bug fixing, and some motivation to make major changes, I&#8217;ve ported major instances of inline ASM to intrinsics, now leaving only two anti-debugger tricks which require inline ASM (And will be filtered out if the option for x64 is enabled). When you attempt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=151&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to Chazwazza over at <a href="www.gamedeception.net">GameDeception</a> for some much needed aid in bug fixing, and some motivation to make major changes, I&#8217;ve ported major instances of inline ASM to intrinsics, now leaving only two anti-debugger tricks which require inline ASM (And will be filtered out if the option for x64 is enabled).</p>
<p>When you attempt to compile in MSVS, be sure to edit the &#8220;Enable C++ Exceptions&#8221; option to have the /EHa flag (&#8220;Yes with SEH exceptions&#8221;), found under the &#8220;Configuration Operations -&gt; C/C++ -&gt; Code Generation&#8221; menu.</p>
<div style="background:#EFEFEF;border:1px solid #cccccc;overflow:scroll;height:250px;padding:1px;">
<pre>
#include &lt;windows.h&gt;
#include &lt;intrin.h&gt;

int DebugBit = 0;
int countExceptions = 0;
int DebugBreakBit = 0;
HANDLE vehPtr;

DWORD_PTR *GetBeingDebugged( )
{
	DWORD_PTR *BeingDebuggedBit;
	#ifdef _M_IX86
		BeingDebuggedBit = ( DWORD_PTR * ) __readfsdword( 0x30 );
	#elif _M_X64
		BeingDebuggedBit = ( DWORD_PTR * ) __readgsqword( 0x60 );
	#endif
	return( ( DWORD_PTR * ) *BeingDebuggedBit );
}

DWORD_PTR *GetNtGlobalFlags( )
{
	DWORD_PTR *NtGlobalFlags;

	#ifdef _M_IX86
		DWORD_PTR *PEB = ( DWORD_PTR * ) __readfsdword( 0x30 ) + 0x68;
		NtGlobalFlags = ( DWORD_PTR * ) *PEB + 0x68;
	#elif _M_X64
		DWORD_PTR *PEB = ( DWORD_PTR * ) __readgsqword( 0x60 ) + 0xD0;
		NtGlobalFlags = ( DWORD_PTR * ) *PEB + 0xD0;
	#endif
	return( ( DWORD_PTR * ) NtGlobalFlags );
}

DWORD_PTR *GetHeapFlags( )
{
	DWORD *HeapFlags;
	#ifdef _M_IX86
		HeapFlags = ( DWORD_PTR * ) __readfsdword( 0x30 );
		HeapFlags = ( DWORD_PTR * ) *( &amp;HeapFlags + 0x18 );
		HeapFlags = ( DWORD_PTR * ) *( &amp;HeapFlags + 0x10 );
	#elif _M_X64
		HeapFlags = ( DWORD_PTR * ) __readgsqword( 0x60 );
		HeapFlags = ( DWORD_PTR * ) *( &amp;HeapFlags + 0x30 );
		HeapFlags = ( DWORD_PTR * ) *( &amp;HeapFlags + 0x20 );
	#endif
	return ( ( DWORD_PTR * ) HeapFlags );
}

LONG WINAPI vehCheck( PEXCEPTION_POINTERS pExecpPointers )
{
	SetUnhandledExceptionFilter( ( LPTOP_LEVEL_EXCEPTION_FILTER ) pExecpPointers-&gt;ContextRecord-&gt;Eax );
	#ifdef _M_IX86
		pExecpPointers-&gt;ContextRecord-&gt;Eip += 2;
	#elif _M_X64
		pExecpPointers-&gt;ContextRecord-&gt;Rip += 4;
	#endif
	countExceptions++;
	if( DebugBreakBit == 1 )
		return( EXCEPTION_CONTINUE_EXECUTION );
	else
		return( EXCEPTION_EXECUTE_HANDLER );
}

void pseudoExit( int exitCode )
{
	BlockInput( TRUE );
	MessageBox( 0, "Please close all active debuggers, and relaunch the application.", "Fatal Error", MB_OK );
	ExitProcess( exitCode );
}

unsigned int GetDebugRegisters( )
{
    unsigned int i = 0;
    CONTEXT ctx;
    ZeroMemory( &amp;ctx, sizeof( CONTEXT ) );
    ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS; 

    if( GetThreadContext( GetCurrentThread( ), &amp;ctx ) == 0 )
		pseudoExit( 0x789DABCF );

    if( ctx.Dr0 != 0 )
		i++;
    if( ctx.Dr1 != 0 )
		i++;
    if( ctx.Dr2 != 0 )
		i++;
    if( ctx.Dr3 != 0 )
		i++;

    return( i );
}

LONG WINAPI suefDebugCheck( struct _EXCEPTION_POINTERS *excInfo ) {
	DebugBit = 1;
	SetUnhandledExceptionFilter( ( LPTOP_LEVEL_EXCEPTION_FILTER ) excInfo-&gt;ContextRecord-&gt;Eax );
	#ifdef _M_IX86
		excInfo-&gt;ContextRecord-&gt;Eip += 2;
	#elif _M_X64
		excInfo-&gt;ContextRecord-&gt;Rip += 4;
	#endif
	return( EXCEPTION_CONTINUE_EXECUTION );
}

void __inline antiDebug( void )
{
	DWORD beginTime = GetTickCount( );
	OSVERSIONINFO osvi;
	osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
	GetVersionEx( &amp;osvi );

	SetUnhandledExceptionFilter( suefDebugCheck );
	DWORD_PTR *forceError = 0x00000000;
	*forceError = 0;
	if( DebugBit == 0 )
		pseudoExit( 0x99673135 );

	vehPtr = AddVectoredExceptionHandler( 1, ( PVECTORED_EXCEPTION_HANDLER ) vehCheck );

	if( osvi.dwMajorVersion &gt;= 6 )
	{
		if( GetHeapFlags( ) &gt; ( void * ) 0x00800000 )
			pseudoExit( 0xFFFF0000 );
	}

	if( GetHeapFlags( ) &gt; ( void * ) 0x10000000 )
		pseudoExit( 0xFFFFFFFE );

	if( GetBeingDebugged( ) == ( void * ) 0x00010000 )
		pseudoExit( 0x04012AD0 );

	if( GetNtGlobalFlags( ) == ( void * ) 0x00000070 )
		pseudoExit( 0x0F6E1A44 );

	if( IsDebuggerPresent( ) != 0 )
		pseudoExit( 0x21473361  );

	CheckRemoteDebuggerPresent( GetCurrentProcess( ), ( PBOOL ) &amp;DebugBit );
	if( DebugBit != 0 )
		pseudoExit( 0xC0000005 );

	#ifdef _M_IX86
		__asm
		{
			PUSH SS
			POP SS
			MOV EAX, 0
			XOR EDX, EDX
		}
	#endif

	// Windows NT 5.X or earlier features
	if( osvi.dwMajorVersion &lt; 6 )
	{
		SetLastError( 0xC0000005 );
		OutputDebugString( "%s%s" );
		if( GetLastError( ) == 0xC0000005 )
			pseudoExit( 0x5148234F );
	}
	else
	{
		try {
			OutputDebugString( "%s%s" );
		}
		catch( ... )
		{
			DebugBit = TRUE;
		}
	}

	// Verifies if SeDebugPrivilege is given
	typedef DWORD_PTR ( NTAPI *CGPID )( );
    CGPID CsrGetProcessId = ( CGPID ) GetProcAddress( GetModuleHandle( "ntdll.dll" ), "CsrGetProcessId" );
	if( OpenProcess( PROCESS_ALL_ACCESS, FALSE, CsrGetProcessId( ) ) &gt; 0 )
		pseudoExit( 0xFF41ECAB );
	// End experimental trick

	#ifdef _M_IX86
		try {
			__asm {
				__emit 0xF3;
				__emit 0x64;
				__emit 0xF1;
			};
		}
		catch ( ... ) {
			DebugBit = FALSE;
		}
		if( DebugBit == TRUE )
			pseudoExit( 0xAAAAAAAC );
	#endif

	if( GetDebugRegisters( ) &gt; 0 )
		pseudoExit( 0x29342180 );

	// Requires admin access
	typedef NTSTATUS ( NTAPI *NSIT )( HANDLE, UINT, PVOID, ULONG );
	NSIT NtSetInformationThread = ( NSIT )GetProcAddress( GetModuleHandle( "ntdll.dll" ), "NtSetInformationThread" );
	NtSetInformationThread( GetCurrentProcess( ), 0x11, 0, 0 );
	// End required admin access

	try {
		CloseHandle( ( HANDLE ) -1 );
	}
	catch( ... ) {
		pseudoExit( 0x00000006 );
	}

	DebugBreakBit = 1;
	__debugbreak();
	DebugBreak( );

	if( GetTickCount( ) == beginTime )
		pseudoExit( 0xD000BE05 );

	typedef NTSTATUS ( WINAPI *NQIP )( HANDLE, LONG, PVOID, ULONG, PULONG );
	NQIP NtQueryInformationProcess = ( NQIP )GetProcAddress( GetModuleHandle( "ntdll.dll" ), "NtQueryInformationProcess" );
	int returnValue = 0;
	NtQueryInformationProcess( GetCurrentProcess( ), 0x7, &amp;returnValue, 4, 0 );
	if( returnValue != 0 )
		pseudoExit( 0xCCCCCCCC );

	NtQueryInformationProcess( GetCurrentProcess( ), 0x1E, &amp;returnValue, 4, 0 );
	if( returnValue != 0 )
		pseudoExit( 0xEFEFEFEF );

}

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
	// Begin anti-debug..
	antiDebug( );

	if( DebugBit == 1 )
		pseudoExit( 0xFFFFFFFF );
	try {
		RemoveVectoredExceptionHandler( vehPtr );
		if( countExceptions != 3 )
			pseudoExit( 0x21522153 );
	}
	catch( ... )
	{
		pseudoExit( 0x55235151 );
	}

	// End anti-debug

	MessageBox( 0, "Debugger not found.", "Success?", MB_OK );

	return( EXIT_SUCCESS );
}
</pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/151/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=151&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/17/anti-debug-x64-compatible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Whitelist Module sample: Quick update</title>
		<link>http://majii.wordpress.com/2009/07/17/whitelist-module-sample-quick-update/</link>
		<comments>http://majii.wordpress.com/2009/07/17/whitelist-module-sample-quick-update/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 07:18:51 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=149</guid>
		<description><![CDATA[In this sample, we check if a module has a base image address as 0&#215;00000000 more than once. The default executable will be set to that number; some modules attempt to hide by erasing their information from the _MODULEINFO structure, thus, GetModuleInformation would return 0&#215;00000000 for the base address of such a module; in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=149&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this sample, we check if a module has a base image address as 0&#215;00000000 more than once.  The default executable will be set to that number; some modules attempt to hide by erasing their information from the _MODULEINFO structure, thus, GetModuleInformation would return 0&#215;00000000 for the base address of such a module; in the end, it works nicely for detecting some hidden modules.  I also included a quick comment with an example for loading other information gathered from the structure into an allocated buffer, for making a more advanced whitelist, not based off the easily-spoofable module-name factor.</p>
<div style="background:#EFEFEF;border:1px solid #cccccc;overflow:scroll;height:250px;padding:1px;">
<pre>
#include &lt;windows.h&gt;
#include &lt;strsafe.h&gt;
#include &lt;Psapi.h&gt;

#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN

#define CODEBEGIN		0x00401000
#define CODEEND			0x004019FE
#define modAllowedSize	11
const char modAllowedArray[][255] = {
	"ADVAPI32.DLL",
	"ntdll.dll",
	"RPCRT4.dll",
	"Secur32.dll",
	"PSAPI.DLL",
	"kernel32.dll",
	"USER32.dll",
	"GDI32.dll",
	"MSVCR90.dll",
	"IMM32.DLL",
	"Killing Bad Threads.exe"
};

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
  HMODULE modArray[1024];
  int modNumber;
  int modAllowedQ = 0;
  int noBaseAddress = 0;
  char modFileName[255];
  char modInfoTemp[255];
  _MODULEINFO modInfo;

  if( EnumProcessModules( GetCurrentProcess( ), modArray, sizeof( modArray ), ( LPDWORD ) &amp;modNumber ) )
  {
    if( modNumber &gt; sizeof( modArray ) )
      return( -1 );

	unsigned int i = 0;
    while( i &lt; ( modNumber / sizeof( HMODULE ) ) )
    {
      int j = 0;
	  while( j &lt; modAllowedSize )
      {
		GetModuleFileName( modArray[i], modFileName, 255 );
		char *ModuleName = strtok( modFileName, "\\" );
		char *ModuleTempName;
		char *ModuleLastName;
		do
		{
			ModuleTempName = strtok( NULL, "\\" );
			if( ModuleTempName == NULL )
				break;
			ModuleName = ModuleTempName;
		} while( ModuleName != NULL );

        if( *modAllowedArray[j] == *ModuleName )
		{
			GetModuleInformation( GetCurrentProcess( ), GetModuleHandle( modAllowedArray[j] ), &amp;modInfo, sizeof( modInfo ) );
			//sprintf( modInfoTemp, "%08x", modInfo.lpBaseOfDll );
			// If you plan to fingerprint modules, based off entrypoint
			// base address, or size of the image base, the above will
			// load that information into a buffer
			if( modInfo.lpBaseOfDll == 0 )
				noBaseAddress++;
			modAllowedQ++;
		}
        j++;
      }
      i++;
    }
	if( noBaseAddress != 1 )
	{
      MessageBox( 0, "Unknown module loaded to memory!", "Fatal error", MB_OK );
	  exit( -1 );
	}
    if( modAllowedQ &lt; modAllowedSize )
	{
      MessageBox( 0, "Unknown module loaded to memory!", "Fatal error", MB_OK );
	  exit( -1 );
	}
  }

  MessageBox( 0, "Nothing evil detected.", "Success?", MB_OK );

  return( EXIT_SUCCESS );
}
</pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=149&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/17/whitelist-module-sample-quick-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Gunz Cheat in GCC</title>
		<link>http://majii.wordpress.com/2009/07/16/gunz-cheat-in-gcc/</link>
		<comments>http://majii.wordpress.com/2009/07/16/gunz-cheat-in-gcc/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:30:33 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Game Cheating]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=145</guid>
		<description><![CDATA[I found this under an old collection files; it&#8217;s a cheat for god mode in IJJI Gunz, using AT&#38;T inline ASM. #include &#60;windows.h&#62; BYTE gdmeCheck = 0; BYTE tglCheck = 1; DWORD WINAPI GetKey ( LPVOID lpParam ); DWORD WINAPI GdMde ( LPVOID lpParam ); DWORD WINAPI GetZChar ( ); BOOL APIENTRY DllMain ( HINSTANCE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=145&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found this under an old collection files; it&#8217;s a cheat for god mode in <a href="http://gunz.ijji.com">IJJI Gunz</a>, using AT&amp;T inline ASM.</p>
<div style="background:#EFEFEF;border:1px solid #cccccc;overflow:scroll;height:250px;padding:1px;">
<pre>
#include &lt;windows.h&gt;

BYTE gdmeCheck = 0;
BYTE tglCheck = 1;

DWORD WINAPI GetKey ( LPVOID lpParam );
DWORD WINAPI GdMde ( LPVOID lpParam );
DWORD WINAPI GetZChar ( );

BOOL APIENTRY DllMain ( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved )
{
  if( fdwReason == DLL_PROCESS_ATTACH )
  {
    CreateThread( NULL, 0, GetKey, 0, 0, NULL );
    CreateThread( NULL, 0, GdMde, 0, 0, NULL );
  }

  return( TRUE );
}

DWORD WINAPI GetKey ( LPVOID lpParam ) {
  while ( 1 ) {
   if( GetAsyncKeyState( 18 ) &lt; 0 &amp;&amp; GetAsyncKeyState( 71 ) &lt; 0 )
   {
      gdmeCheck ^= 1;
      tglCheck ^= 1;
   }

   Sleep( 500 );
  }
  return( 0 );
}

DWORD WINAPI GdMde ( LPVOID lpParam ) {
 while( true ) {
   if( gdmeCheck != 0 ) {
     if( DWORD ZChar = GetZChar( ) != 0 )
       __asm__ (
        "movl %0, %%eax\n\t"
        "movl $0x461C3C00, %%ecx\n\t"
        "movl %%ecx, 0x418(%%eax)\n\t"
        "movl %%ecx, 0x41C(%%eax)\n\t"
        :"=r" (ZChar)
       );
       tglCheck = 1;
   }

   if( tglCheck != 0 )
   {
     if( DWORD ZChar = GetZChar( ) != 0 )
       __asm__ (
        "movl %0, %%eax\n\t"
        "movl $100, %%ecx\n\t"
        "movl %%ecx, 0x418(%%eax)\n\t"
        "movl %%ecx, 0x41C(%%eax)\n\t"
        :"=r" (ZChar)
       );
     tglCheck ^= 1;
   }

   Sleep( 50 );
 }
 return( 0 );
}

DWORD WINAPI GetZChar ( ) {
  DWORD ZChar = 0;
  __asm__ (
    "movl $0x49A380, %%eax\n\t"
    "movl 0x50(%%eax), %%ecx\n\t"
    "movl %%ecx, %0\n\t"
    :"=r" (ZChar)
  );
  return( ZChar );
}
</pre>
</div>
<p>Other than the HP offset, nothing&#8217;s changed, so feel free to update it <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=145&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/16/gunz-cheat-in-gcc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
		<item>
		<title>Check for loaded modules that aren&#8217;t whitelisted</title>
		<link>http://majii.wordpress.com/2009/07/16/check-for-loaded-modules-that-arent-whitelisted/</link>
		<comments>http://majii.wordpress.com/2009/07/16/check-for-loaded-modules-that-arent-whitelisted/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 05:45:25 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://majii.wordpress.com/?p=141</guid>
		<description><![CDATA[I know it&#8217;s a terrible idea, but, somebody had to do it! #include &#60;tlhelp32.h&#62; #include &#60;windows.h&#62; #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN #define CODEBEGIN 0x00401000 #define CODEEND 0x004019FE #define modAllowedSize 11 const char modAllowedArray[][255] = { "ADVAPI32.DLL", "ntdll.dll", "RPCRT4.dll", "Secur32.dll", "PSAPI.DLL", "kernel32.dll", "USER32.dll", "GDI32.dll", "MSVCR90.dll", "IMM32.DLL", "Killing Bad Threads.exe" }; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=141&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I know it&#8217;s a terrible idea, but, somebody had to do it!</p>
<div style="background:#EFEFEF;border:1px solid #cccccc;overflow:scroll;height:250px;padding:1px;">
<pre>
#include &lt;tlhelp32.h&gt;
#include &lt;windows.h&gt;

#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN

#define CODEBEGIN		0x00401000
#define CODEEND			0x004019FE
#define modAllowedSize	11
const char modAllowedArray[][255] = {
	"ADVAPI32.DLL",
	"ntdll.dll",
	"RPCRT4.dll",
	"Secur32.dll",
	"PSAPI.DLL",
	"kernel32.dll",
	"USER32.dll",
	"GDI32.dll",
	"MSVCR90.dll",
	"IMM32.DLL",
	"Killing Bad Threads.exe"
};

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
  HMODULE modArray[1024];
  int modNumber;
  int modAllowedQ = 0;
  char modFileName[255];

  if( EnumProcessModules( GetCurrentProcess( ), modArray, sizeof( modArray ), ( LPDWORD ) &amp;modNumber ) )
  {
    if( modNumber &gt; sizeof( modArray ) )
      return( -1 );

	unsigned int i = 0;
    while( i &lt; ( modNumber / sizeof( HMODULE ) ) )
    {
      int j = 0;
	  while( j &lt; modAllowedSize )
      {
		GetModuleFileName( modArray[i], modFileName, 255 );
		char *ModuleName = strtok( modFileName, &quot;\\&quot; );
		char *ModuleTempName;
		char *ModuleLastName;
		do
		{
			ModuleTempName = strtok( NULL, &quot;\\&quot; );
			if( ModuleTempName == NULL )
				break;
			ModuleName = ModuleTempName;
		} while( ModuleName != NULL );

        if( *modAllowedArray[j] == *ModuleName )
			modAllowedQ++;
        j++;
      }
      i++;
    }
    if( modAllowedQ &lt; modAllowedSize )
	{
      MessageBox( 0, &quot;Unknown module loaded to memory!&quot;, &quot;Fatal error&quot;, MB_OK );
	  exit( -1 );
	}
  }

  MessageBox( 0, &quot;Nothing evil detected.&quot;, &quot;Success?&quot;, MB_OK );

  return( EXIT_SUCCESS );
}
</pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majii.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majii.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majii.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majii.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majii.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majii.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majii.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majii.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majii.wordpress.com&amp;blog=8260661&amp;post=141&amp;subd=majii&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majii.wordpress.com/2009/07/16/check-for-loaded-modules-that-arent-whitelisted/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3288c8c8bd62c130b84c77b49a9c4654?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
