<?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>kichik's blog &#187; Development</title>
	<atom:link href="http://kichik.net/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://kichik.net</link>
	<description>Random incoherent rambling about stuff</description>
	<lastBuildDate>Fri, 29 Jul 2011 19:41:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Old GDB find</title>
		<link>http://kichik.net/2011/07/29/old-gdb-find/</link>
		<comments>http://kichik.net/2011/07/29/old-gdb-find/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 19:40:33 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://kichik.net/?p=158</guid>
		<description><![CDATA[Newer versions of GDB come with the nifty find command. The old version of GDB I have to use, does not. It is also incapable of generating a proper stack trace for the platform it supposedly serves. But that&#8217;s a whole other story&#8230; Anyway, I found a piece of code that almost does the same. [...]]]></description>
			<content:encoded><![CDATA[<div><p>Newer versions of GDB come with the nifty <tt>find</tt> command. The old version of GDB I have to use, does not. It is also incapable of generating a proper stack trace for the platform it supposedly serves. But that&#8217;s a whole other story&#8230;</p>
<p>Anyway, I found a <a href="http://sourceware.org/ml/gdb/2002-04/msg00182.html">piece of code</a> that almost does the same. I tweaked it a bit, fixed the stray bug ($x -> %p) and would like to never do it again. So here it is for my future reference and your indulgent.</p>
<pre class="bash">define find
  <span style="color: #000066;">set</span> <span style="color: #0000ff;">$start</span> = <span style="color: #66cc66;">&#40;</span>uint64 *<span style="color: #66cc66;">&#41;</span> <span style="color: #0000ff;">$arg0</span>
  <span style="color: #000066;">set</span> <span style="color: #0000ff;">$end</span> = <span style="color: #0000ff;">$start</span> + <span style="color: #0000ff;">$arg1</span>
  <span style="color: #000066;">set</span> <span style="color: #0000ff;">$pattern</span> = <span style="color: #66cc66;">&#40;</span>uint64<span style="color: #66cc66;">&#41;</span> <span style="color: #0000ff;">$arg2</span>
  <span style="color: #000066;">set</span> <span style="color: #0000ff;">$p</span> = <span style="color: #0000ff;">$start</span>
  <span style="color: #b1b100;">while</span> <span style="color: #0000ff;">$p</span> &lt; <span style="color: #0000ff;">$end</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>*<span style="color: #66cc66;">&#40;</span>uint64 *<span style="color: #66cc66;">&#41;</span> <span style="color: #0000ff;">$p</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #0000ff;">$pattern</span>
      <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;pattern %p found at %p<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$pattern</span>, <span style="color: #0000ff;">$p</span>
    end
    <span style="color: #000066;">set</span> <span style="color: #0000ff;">$p</span>++
  end
end</pre>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2011/07/29/old-gdb-find/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Android</title>
		<link>http://kichik.net/2010/07/12/hello-android/</link>
		<comments>http://kichik.net/2010/07/12/hello-android/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 14:05:48 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[mw2]]></category>

		<guid isPermaLink="false">http://kichik.net/2010/07/12/hello-android/</guid>
		<description><![CDATA[Humanoid, search engine and one of the most addictive FPS games ever created walk into a bar. A few refreshing cups of coffee later, a joke is born and its name is MW2 Guide. I&#8217;ve created a pretty simple application for Android that helps Call of Duty: Modern Warfare 2 addicts, such as myself, to [...]]]></description>
			<content:encoded><![CDATA[<div><p>Humanoid, search engine and one of the most addictive FPS games ever created walk into a bar. A few refreshing cups of coffee later, a joke is born and its name is MW2 Guide.</p>
<p>I&#8217;ve created a pretty simple application for Android that helps <em>Call of Duty: Modern Warfare 2</em> addicts, such as myself, to make some sense of the bombardment of dialog boxes popping after a match. It&#8217;s basically a list of all available callsign titles and their description. What sets it apart from a few dozen similar apps is the quick search ability and auto completion voodoo, in accordance with Android&#8217;s search centric vision.</p>
<p>Search for <strong>MW2 Guide</strong> on the market, or use the QR code below.</p>
<p><a href="market://details?id=com.mw2guide"><img class="size-full wp-image-145" title="MW2 Guide QR code" src="http://kichik.net/wp-content/uploads/2010/07/wpid-chart.png" alt="MW2 Guide QR code" width="150" height="150" /></a></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2010/07/12/hello-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCSIPORT debugging</title>
		<link>http://kichik.net/2009/11/11/scsiport-debugging/</link>
		<comments>http://kichik.net/2009/11/11/scsiport-debugging/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:29:21 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[scsikd]]></category>
		<category><![CDATA[scsiport]]></category>
		<category><![CDATA[windbg]]></category>

		<guid isPermaLink="false">http://kichik.net/?p=129</guid>
		<description><![CDATA[Microsoft provides useful extensions for debugging SCSIPORT drivers in WinDbg. But with some versions of scsiport.sys, the symbol files don&#8217;t contain type information. This produces fun errors like the following. kd&#62; !scsikd.scsiext 8a392a38 ************************************************************************* *** *** *** *** *** Your debugger is not using the correct symbols *** *** *** *** In order for this [...]]]></description>
			<content:encoded><![CDATA[<div><p>Microsoft provides <a href="http://support.microsoft.com/kb/296225">useful extensions</a> for debugging SCSIPORT drivers in WinDbg. But with some versions of <tt>scsiport.sys</tt>, the symbol files don&#8217;t contain type information. This produces fun errors like the following.</p>
<p><pre class="text">kd&gt; !scsikd.scsiext 8a392a38
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: scsiport!_DEVICE_OBJECT                       ***
***                                                                   ***
*************************************************************************
scsikd error (3): ...\storage\kdext\scsikd\scsikd.c @ line 188</pre>This makes the common task of getting your device extension object very daunting. After some digging, I came up with this code to at least get my device extension object from SCSIPORT&#8217;s device extension object.</p>
<pre class="text">!drvobj mydriver
* get relevant DevObj
!devobj &lt;devobj&gt;
* get DevExt
dt mydriver!MY_DEVICE_EXTENSION poi(&lt;DevExt&gt; + b4)</pre>
<p>I&#8217;ve only tried it on Windows XP SP3. The offset may be different with other configurations. Anyone knows a better way around this? Preferable method would naturally be making <tt>scsikd</tt> work.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2009/11/11/scsiport-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debug Xen Hosted Windows Kernel Over Network</title>
		<link>http://kichik.net/2009/06/11/debug-xen-hosted-windows-kernel-over-network/</link>
		<comments>http://kichik.net/2009/06/11/debug-xen-hosted-windows-kernel-over-network/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 23:05:55 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[neocleus]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://kichik.net/?p=109</guid>
		<description><![CDATA[Read more at my company&#8217;s blog.]]></description>
			<content:encoded><![CDATA[<div><p><a href="http://blog.neocleus.com/2009/06/11/debug-xen-hosted-windows-kernel-over-network/">Read more</a> at my company&#8217;s blog.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2009/06/11/debug-xen-hosted-windows-kernel-over-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SourceForge tracker and SVN integration</title>
		<link>http://kichik.net/2009/02/21/sourceforge-tracker-and-svn-integration/</link>
		<comments>http://kichik.net/2009/02/21/sourceforge-tracker-and-svn-integration/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 19:08:37 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[bugtraq]]></category>
		<category><![CDATA[sourceforge]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://kichik.net/?p=101</guid>
		<description><![CDATA[TortoiseSVN and some other Subversion clients have a cool feature for integration with issue trackers. By setting a few properties for a project, you can have automatically generated links to tracked issues directly from SVN commit messages. TortoiseSVN also supports a special input method for issue numbers in commit boxes for easier integration. The basic [...]]]></description>
			<content:encoded><![CDATA[<div><p>TortoiseSVN and some other Subversion clients have a cool feature for integration with issue trackers. By setting a few properties for a project, you can have automatically generated links to tracked issues directly from SVN commit messages. TortoiseSVN also supports a special input method for issue numbers in commit boxes for easier integration.</p>
<p>The basic property that must be set is <em>bugtraq:url</em> which lets SVN know how to form a URL from an issue number. This is a bit difficult with SourceForge, where there are in fact at least three trackers and each with its own URL scheme including the tracker identifier in the URL. Toying with the URL and removing both group and tracker identifiers results in an error. After playing around some more, I found the following URL that works like a charm for every group and any tracker so there isn&#8217;t even a need to figure out the group identifier.</p>
<blockquote><p><a class="linkification-ext" title="Linkification: http://sourceforge.net/support/tracker.php?aid=%BUGID%" href="http://sourceforge.net/support/tracker.php?aid=%BUGID%">http://sourceforge.net/support/tracker.php?aid=%BUGID%</a></p></blockquote>
<p>It took me a while to figure out and I couldn&#8217;t find any mention of it online, so I thought I&#8217;d post it here to help others.</p>
<p>For more information on all of the related properties see <a href="http://tortoisesvn.net/issuetracker_integration">TortoiseSVN&#8217;s page</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2009/02/21/sourceforge-tracker-and-svn-integration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pragmatic variant</title>
		<link>http://kichik.net/2008/11/29/pragmatic-variant/</link>
		<comments>http://kichik.net/2008/11/29/pragmatic-variant/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 12:17:02 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[NSIS]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://kichik.net/?p=92</guid>
		<description><![CDATA[As mentioned in my previous post, I have been working on incorporating some more features into WinVer.nsh. Every little change in this header file requires testing on all possible versions and configurations of Windows. Being the Poor Open Source DeveloperTM that I am, I do not have sufficient resources to assemble a full-blown testing farm [...]]]></description>
			<content:encoded><![CDATA[<div><p>As mentioned in my <a href="http://kichik.net/2008/11/23/voodoo-fabrication/">previous post</a>, I have been working on incorporating some more features into WinVer.nsh. Every little change in this header file requires testing on all possible versions and configurations of Windows. Being the Poor Open Source Developer<sup><small>TM</small></sup> that I am, I do not have sufficient resources to assemble a full-blown testing farm with every possible version of Windows on every possible hardware configuration. Instead, I have to settle for a bunch of virtual machines I have collected over the years. It is pretty decent, but has no standards and doesn&#8217;t cover every possible version. Still, it does its job well and has proven itself very effective.</p>
<p>Obviously, be it a farm or a mere collection of virtual machines, testing on so many different configurations carries with it a hefty fine. Testing a single line change could waste almost an hour. Imagine the time it would take to test, fix, retest, fix and retest again a complete rewrite of WinVer.nsh. As fascinating as that empirical scientific experiment would have been, I was reluctant to find out. Laziness, in this case, proved to be a very practical solution.</p>
<p>WinVer.nsh tests do not really need the entire operation system and its behavior as it relies on nothing but 4 parameters. All it requires is the return values of GetVersionEx for OSVERSIONINFO and OSVERSIONINFOEX. For nothing more than 312 bytes, I have to wait until Windows Vista decides it wants to execute my test, Windows NT4 gracefuly connects to my network, Windows ME wakes up on the right side of the bed and doesn&#8217;t crash, Windows Server 2008 installs again after its license has expired and Windows 95&#8230;. Actually, that one works pretty well. So why wait?</p>
<p>Instead, I&#8217;ve created a little harvester that collects those 312 bytes, ran it on all of my machines and mustered the results into one <a href="http://nsis.svn.sourceforge.net/viewvc/nsis/NSIS/trunk/Source/Tests/winver.nsi?view=markup">huge script</a> that tests every aspect of WinVer.nsh using every possible configuration of Windows in a few seconds. It required adding a hooking option to WinVer.nsh, but with the new !ifmacrondef, that was easy enough.</p>
<p>Currently, the script tests:</p>
<ul>
<li>Windows 95 OSR B</li>
<li>Windows 98</li>
<li>Windows ME</li>
<li>Windows NT4 (SP1, SP6)</li>
<li>Windows 2000 (SP0, SP4)</li>
<li>Windows XP (SP2, SP3)</li>
<li>Windows XP x64 (SP1)</li>
<li>Windows Vista (SP0)</li>
<li>Windows Server 2008 (SP1)</li>
</ul>
<p>If you have access to a configuration not listed here, please run the <a href="http://nsis.svn.sourceforge.net/viewvc/nsis/NSIS/trunk/Source/Tests/winver.nsi?view=markup">harvester</a> and send me the results. More specifically, I could really use Windows 2003 and Windows Vista SP1. My Windows Vista installation simply refuses the upgrade to SP1. Again.</p>
<p>The test script also includes a hexdump of those 312 bytes for every configuration so anyone performing similar tests for another reason doesn&#8217;t have to parse the NSIS syntax. Feel free to use it for your testing.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2008/11/29/pragmatic-variant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dominical update</title>
		<link>http://kichik.net/2008/03/30/dominical-update/</link>
		<comments>http://kichik.net/2008/03/30/dominical-update/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 22:51:22 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[NSIS]]></category>

		<guid isPermaLink="false">http://kichik.net/2008/03/30/dominical-update/</guid>
		<description><![CDATA[9 out of 10 open-source experts advocate frequent releases. We, the simple people, don&#8217;t know better and should listen to the experts. Sadly, we simpletons still don&#8217;t know how to read and so the fine print eludes us. While we all may be good and obedient developers, the users don&#8217;t care for our frequent releases [...]]]></description>
			<content:encoded><![CDATA[<div><p>9 out of 10 open-source experts advocate frequent releases. We, the simple people, don&#8217;t know better and should listen to the experts. Sadly, we simpletons still don&#8217;t know how to read and so the fine print eludes us. While we all may be good and obedient developers, the users don&#8217;t care for our frequent releases squashing our colossus bugs and featuring our shiny new toys. As frequent our releases are as frequent the reports of bugs long ago fixed and features that shined and sparkled at ancient times but are now filled with rust.</p>
<p>Ghost versions of the past haunt us daily while users refuse to upgrade. Our innovative forefathers, suffering immensely from this plague, had uncovered the great potential of automatic updates. No longer is the user able to flee his ordained destiny. Fate shall pop-up and fulfill itself even with the absence of user interaction.</p>
<p>But even this sparsely applied method carries its own set of fine prints. Boiler plate implementation includes a web server containing the latest version number or even a server-side script that ever so nicely checks for the user whether his version is expectedly old. As with everything else, here too success brings failure. As faithful users gather their masses around our monthly-polished releases, the web server begins to break down. Most web servers, especially those that poor open-source developers can afford, do not offer load balancing and will easily succumb to the sheer amount of bandwidth generated by thousands of users performing even the simplest of GET requests.</p>
<p>Enter DNS. The Domain Name System is a distributed and globally cached system that basically maps domain names such as <em>nsis.latest-version.org</em> into numbers such as  <em>2.36.0.0</em>. And it gets even better &#8212; foreign sources report there are free DNS servers out there, waiting to be used. Services such as <a href="http://dyndns.org/">dyndns.org</a> offer a simple HTTP based API that sets new IP to a free domain name. Creating a new version notification service is as simple as creating a new free domain, updating it every time a new version is released, calling <em>inet_addr</em> when the client-side loads and comparing the result to the current version.</p>
<p>This free and simple solution provides many advantages over conventional HTTP based version check.</p>
<ul>
<li>Automatic load balancing with servers all over the world.</li>
<li>Simple code with no need for complex HTTP libraries.</li>
<li>No need for relatively heavy HTTP operations for both client and server.</li>
<li>HTTP proxies do not get in the way.</li>
<li>Firewalls and the entire security fiasco usually overlook DNS.</li>
</ul>
<p>And as always, there are disadvantages.</p>
<ul>
<li>Updates take time to propagate.</li>
<li>Only 3 bytes of information.</li>
</ul>
<p>Make sure you set the first byte to <em>127 </em>to make sure the IP associated with your update domain is invalid. This way, whoever is at <em>2.36.0.0</em> won&#8217;t get any unwelcome traffic.</p>
<p>I am probably not the first to think of this, but it is a cool idea nonetheless. I&#8217;m so going to implement this for the next version of NSIS! <img src='http://kichik.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2008/03/30/dominical-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Atomic codes</title>
		<link>http://kichik.net/2007/06/16/atomic-codes/</link>
		<comments>http://kichik.net/2007/06/16/atomic-codes/#comments</comments>
		<pubDate>Sat, 16 Jun 2007 19:02:38 +0000</pubDate>
		<dc:creator>kichik</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[NSIS]]></category>

		<guid isPermaLink="false">http://kichik.net/2007/06/16/atomic-codes/</guid>
		<description><![CDATA[I had some fun today trying to figure out why Banner likes to hang around with .NET so much so it wouldn&#8217;t even leave. I found out that while being destroyed, something tries to send messages to the main dialog. But the main dialog is busy with destroying the banner. I added exactly two iterations [...]]]></description>
			<content:encoded><![CDATA[<div><p>I had some fun today trying to figure out why <a href="http://forums.winamp.com/showthread.php?s=&amp;threadid=270838">Banner likes to hang around with .NET</a> so much so it wouldn&#8217;t even leave. I found out that while being destroyed, something tries to send messages to the main dialog. But the main dialog is busy with destroying the banner. I added exactly two iterations of the famous win32 message loop and everything started working. I still don&#8217;t know why those messages are sent or why it&#8217;s so important they&#8217;ll be answered before the banner is destroyed or even why it happens just with the .NET installer. And don&#8217;t even ask about different synchronization methods that make it tick. So far, I&#8217;ve found only smoke signals and the fire extinguisher won&#8217;t last much longer.</p>
<p>Of all the signals, I liked the message loop the most. It actually points to something I&#8217;ve done wrong. I&#8217;ve starved the main dialog&#8217;s thread while creating a modeless dialog as its child. That&#8217;s why I dug in further into those two iterations of the loop and those two messages that it processes. It turns out both of them had the same identifier &#8211; 0xc0c3. Now that&#8217;s no regular WM_ message&#8230; That&#8217;s a message registered with RegisterWindowMessage. But which message is it? That&#8217;s where the fun starts. There&#8217;s no GetRegisteredWindowMessage API available and nothing on the topic comes out on Google.</p>
<p>So with no leads to follow I started digging. Normally, to give a certain string a specific value in Windows, an atom is created. And indeed, 0xc0c3 is in the range of named atoms. To make things even simpler, in WINE, RegisterWindowMessage simply calls GlobalAddAtom, casts ATOM to UINT and returns. Great, then GetAtomName or GlobalGetAtomName should do the trick. Only reality isn&#8217;t as bright as WINE would like us to think. It turns out RegisterWindowMessage uses a different atom table for its messages. But which atom table and how can you even specify a table with GetAtomName?</p>
<p>To specify a table, a low-level access to RtlLookupAtomInAtomTable is required. But that function is deep inside ntoskrnl.exe. So, up one level and you get NtUserGetAtomName which uses the same atom table as NtUserAddAtom which is the function RegisterWindowMessage calls. But that&#8217;s inside win32k.sys&#8230; Luckily, user32.dll already handles that. It has a stub that calls NtUserGetAtomName at 0x7E41FA8E. Some playing around with the second parameter which turns out to be UNICODE_STRING and the atomic table is in hands&#8217; reach.</p>
<p>Engines off, coding fingers down, digging complete and the message name is <strong>MSUIM.Msg.Private</strong>. That too gets little to none results on Google, but who cares&#8230; Debugging is fun <img src='http://kichik.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For any of you who&#8217;d ever want to convert a registered message into a readable name, here&#8217;s the NSIS code. Replace 0xc0c3 with the message identifier and 0x7E41FA8E with user32!NtUserGetAtomName and you&#8217;re good to go.</p>
<pre class="nsis"><span style="color: #666666; font-style: italic;"># the atom</span>
<span style="color: #000099;">StrCpy</span> <span style="color: #660000;">$<span style="">2</span></span> 0xc0c3
<span style="color: #666666; font-style: italic;">;System::Call user32::RegisterWindowMessage(t'test_message')i.r2</span>
<span style="color: #666666; font-style: italic;"># create UNICODE_STRING</span>
<span style="color: #000099;">System</span>::<span style="color: #003399;">Alloc </span><span style="">1008</span>
<span style="color: #000099;">Pop</span> <span style="color: #660000;">$R0</span>
<span style="color: #000099;">StrCpy</span> <span style="color: #660000;">$R1</span> <span style="">0</span>
<span style="color: #000099;">StrCpy</span> <span style="color: #660000;">$R2</span> <span style="">1000</span>
<span style="color: #000099;">IntOp</span> <span style="color: #660000;">$R3</span> <span style="color: #660000;">$R0</span> + <span style="">8</span>
<span style="color: #000099;">System</span>::<span style="color: #003399;">Call </span>*<span style="color: #660000;">$R0</span><span style="">&#40;</span>&amp;i2R1,&amp;i2R2,iR3<span style="">&#41;</span>
<span style="color: #666666; font-style: italic;"># call NtUserGetAtomName</span>
<span style="color: #000099;">System</span>::<span style="color: #003399;">Call </span>::0x7E41FA8E<span style="">&#40;</span>ir2,iR0<span style="">&#41;</span>i.r1?e
<span style="color: #666666; font-style: italic;"># parse UNICODE_STRING</span>
<span style="color: #000099;">System</span>::<span style="color: #003399;">Call </span>*<span style="color: #660000;">$R0</span><span style="">&#40;</span>&amp;i2.r4,&amp;i2.r3,w.r0<span style="">&#41;</span>
<span style="color: #666666; font-style: italic;"># print details</span>
<span style="color: #000099;">DetailPrint</span> <span style="color: #660066;">&quot;user atom's name is $0&quot;</span>
<span style="color: #000099;">DetailPrint</span> <span style="color: #660066;">&quot;length is $4 (???)&quot;</span>
<span style="color: #000099;">DetailPrint</span> <span style="color: #660066;">&quot;NtUserGetAtomName returned $1&quot;</span>
<span style="color: #000099;">Pop</span> <span style="color: #660000;">$<span style="">1</span></span>
<span style="color: #000099;">DetailPrint</span> <span style="color: #660066;">&quot;GetLastError() = $1&quot;</span>
<span style="color: #666666; font-style: italic;"># done</span>
<span style="color: #000099;">System</span>::<span style="color: #003399;">Free </span><span style="color: #660000;">$R0</span></pre>
</div>]]></content:encoded>
			<wfw:commentRss>http://kichik.net/2007/06/16/atomic-codes/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

