<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title />
	
	<link>http://www.megapanzer.com</link>
	<description />
	<lastBuildDate>Wed, 23 May 2012 08:15:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/megapanzer" /><feedburner:info uri="megapanzer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>megapanzer</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>C# – Multi threaded TCP Socket Server</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/Mo_GwcHv3nI/</link>
		<comments>http://www.megapanzer.com/2012/05/23/c-multi-threaded-tcp-socket-server/#comments</comments>
		<pubDate>Wed, 23 May 2012 08:15:42 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Coders corner]]></category>
		<category><![CDATA[Tools & sources]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Socket]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[Thread]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=6828</guid>
		<description><![CDATA[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
<br/></p>
<div style="width: 690px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Net</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Net.Sockets</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Threading</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
<span style="color: #008080; font-style: italic;">/*
 * Based on an example from Stackoverflow. 
 */</span>
&nbsp;
&nbsp;
<span style="color: #6666cc; font-weight: bold;">class</span> MainClass
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        TcpListener client <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TcpListener<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">9050</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        client<span style="color: #008000;">.</span><span style="color: #0000FF;">Start</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Waiting for clients...&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>client<span style="color: #008000;">.</span><span style="color: #0000FF;">Pending</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                Thread<span style="color: #008000;">.</span><span style="color: #0000FF;">Sleep</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">1000</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            ConnectionThread newconnection <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ConnectionThread<span style="color: #008000;">&#40;</span>client<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #6666cc; font-weight: bold;">class</span> ConnectionThread
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> TcpListener mThreadListener<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/*
     * Constructor
     * 
     */</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> ConnectionThread<span style="color: #008000;">&#40;</span>TcpListener lis<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        mThreadListener <span style="color: #008000;">=</span> lis<span style="color: #008000;">;</span>
        ThreadPool<span style="color: #008000;">.</span><span style="color: #0000FF;">QueueUserWorkItem</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> WaitCallback<span style="color: #008000;">&#40;</span>HandleConnection<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
    <span style="color: #008080; font-style: italic;">/*  
     * Connection handler
     * 
     */</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> HandleConnection<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> pStateObj<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #6666cc; font-weight: bold;">int</span> lDataRead<span style="color: #008000;">;</span>
        <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> lData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1024</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
&nbsp;
        TcpClient lClientSock <span style="color: #008000;">=</span> mThreadListener<span style="color: #008000;">.</span><span style="color: #0000FF;">AcceptTcpClient</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        NetworkStream lNetStream <span style="color: #008000;">=</span> lClientSock<span style="color: #008000;">.</span><span style="color: #0000FF;">GetStream</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> lClientSys <span style="color: #008000;">=</span> lClientSock<span style="color: #008000;">.</span><span style="color: #0000FF;">Client</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RemoteEndPoint</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        lData <span style="color: #008000;">=</span> Encoding<span style="color: #008000;">.</span><span style="color: #0000FF;">ASCII</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetBytes</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hi {0}&quot;</span>, lClientSys<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        lNetStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span>lData, <span style="color: #FF0000;">0</span>, lData<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            lData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1024</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
            lDataRead <span style="color: #008000;">=</span> lNetStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Read</span><span style="color: #008000;">&#40;</span>lData, <span style="color: #FF0000;">0</span>, lData<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            lNetStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span>lData, <span style="color: #FF0000;">0</span>, lDataRead<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;{0} says : {1}<span style="color: #008080; font-weight: bold;">\n</span><span style="color: #008080; font-weight: bold;">\n</span>&quot;</span>, lClientSys, 
                              Encoding<span style="color: #008000;">.</span><span style="color: #0000FF;">ASCII</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetString</span><span style="color: #008000;">&#40;</span>lData<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        lNetStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Close</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        lClientSock<span style="color: #008000;">.</span><span style="color: #0000FF;">Close</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

</div>
<p><br/></p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/Mo_GwcHv3nI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/23/c-multi-threaded-tcp-socket-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/23/c-multi-threaded-tcp-socket-server/</feedburner:origLink></item>
		<item>
		<title>Downloading A Movie From Streaming Site</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/KPlv9xejI_w/</link>
		<comments>http://www.megapanzer.com/2012/05/21/downloading-a-movie-from-streaming-site/#comments</comments>
		<pubDate>Mon, 21 May 2012 08:53:05 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[Off topic]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Movie]]></category>
		<category><![CDATA[Stream]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=6787</guid>
		<description><![CDATA[Probably no big news for the most of you but I decided to share it anyway as the time of the big streaming platforms seem to be over soon. More and more the big file hoster close or restrict their services to avoid getting in trouble with the movie industrie. If you want to save [...]]]></description>
			<content:encoded><![CDATA[<p>Probably no big news for the most of you but I decided to share it anyway as the time of the big streaming platforms seem to be over soon. More and more the big file hoster close or restrict their services to avoid getting in trouble with the movie industrie.</p>
<p>If you want to save a copy of the video stream you normally watch on <strong>Putlocker.com</strong> (and it probably also works with Sockshare.com) <strong>follow these 4 steps to save the SWF file</strong> on your computer to watch it off line. </p>
<h3>1. Open the start page of the movie you want to watch </h3>
<p>Normally you reach this place via a searchable movie index page like kinox.to. The entry page there look something like this :</p>
<p><a href="http://www.megapanzer.com/wp-content/uploads/DownloadMovie1.png"><img src="http://www.megapanzer.com/wp-content/uploads/DownloadMovie1-300x159.png" alt="" title="DownloadMovie1" width="450" height="240" class="alignnone size-medium wp-image-6789" /></a></p>
<h3>2. Copy the movie ID</h3>
<p>On the movie page you switch over to the Page Source view. In Google Chrome and Firefox you can do that by pushing CTRL + U. Inside the page source you search the movie ID. On Putlocker you can easily find it by searching for <strong>get_file</strong>. The browser jumps to the right place. If you have found it copy the area as you can see it in the picture.<br />
<a href="http://www.megapanzer.com/wp-content/uploads/DownloadMovie2.png"><img src="http://www.megapanzer.com/wp-content/uploads/DownloadMovie2.png" alt="" title="DownloadMovie2" width="700" height="346" class="alignnone size-full wp-image-6805" /></a></p>
<h3>3. Get the movie XML file</h3>
<p>In the browser you type www.putlocker.com and append the movie ID you copied in step 4. The URL in the browser and the page content you see afterwards look like this :<br />
<a href="http://www.megapanzer.com/wp-content/uploads/DownloadMovie3.png"><img src="http://www.megapanzer.com/wp-content/uploads/DownloadMovie3.png" alt="" title="DownloadMovie3" width="700" height="252" class="alignnone size-full wp-image-6809" /></a></p>
<p>As the second last step inside the XML page content you select and copy the <strong>media content URL</strong>.</p>
<h3>4. Download the file</h3>
<p>By pasting the media content URL in the URL bar and hitting enter the file download is started.<br />
<a href="http://www.megapanzer.com/wp-content/uploads/DownloadMovie4.png"><img src="http://www.megapanzer.com/wp-content/uploads/DownloadMovie4.png" alt="" title="DownloadMovie4" width="700" height="393" class="alignnone size-full wp-image-6813" /></a></p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/KPlv9xejI_w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/21/downloading-a-movie-from-streaming-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/21/downloading-a-movie-from-streaming-site/</feedburner:origLink></item>
		<item>
		<title>Facebook sued for $15 billion over alleged privacy infractions</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/FJb9qXfkHmg/</link>
		<comments>http://www.megapanzer.com/2012/05/19/facebook-sued-for-15-billion-over-alleged-privacy-infractions/#comments</comments>
		<pubDate>Sat, 19 May 2012 15:40:37 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[News & media]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=7474</guid>
		<description><![CDATA[[URL]http://news.cnet.com/8301-1009_3-57437060-83/facebook-sued-for-$15-billion-over-alleged-privacy-infractions/?tag=txt;title[URL] [SOURCE]CNet[SOURCE]]]></description>
			<content:encoded><![CDATA[<p>[URL]http://news.cnet.com/8301-1009_3-57437060-83/facebook-sued-for-$15-billion-over-alleged-privacy-infractions/?tag=txt;title[URL]<br />
[SOURCE]CNet[SOURCE]</p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/FJb9qXfkHmg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/19/facebook-sued-for-15-billion-over-alleged-privacy-infractions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/19/facebook-sued-for-15-billion-over-alleged-privacy-infractions/</feedburner:origLink></item>
		<item>
		<title>C# – Terminating running processes</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/UAU0ZwW91x4/</link>
		<comments>http://www.megapanzer.com/2012/05/19/terminating-running-processes/#comments</comments>
		<pubDate>Sat, 19 May 2012 13:48:16 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Coders corner]]></category>
		<category><![CDATA[Tools & sources]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Terminate]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=6778</guid>
		<description><![CDATA[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 using System.Diagnostics; &#160; namespace TerminateProcesses &#123; class Program &#123; static void Main&#40;string&#91;&#93; args&#41; &#123; Process&#91;&#93; lACInstances; &#160; if &#40;&#40;lACInstances = Process.GetProcessesByName&#40;&#34;Notepad&#34;&#41;&#41; != null&#41; foreach &#40;Process lProc in lACInstances&#41; lProc.Kill&#40;&#41;; &#160; &#125; &#125; &#125;]]></description>
			<content:encoded><![CDATA[<p><br/><br />
<br/></p>
<div style="width: 690px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Diagnostics</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> TerminateProcesses
<span style="color: #008000;">&#123;</span>
    <span style="color: #6666cc; font-weight: bold;">class</span> Program
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            Process<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> lACInstances<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>lACInstances <span style="color: #008000;">=</span> Process<span style="color: #008000;">.</span><span style="color: #0000FF;">GetProcessesByName</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Notepad&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
                <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>Process lProc <span style="color: #0600FF; font-weight: bold;">in</span> lACInstances<span style="color: #008000;">&#41;</span>
                    lProc<span style="color: #008000;">.</span><span style="color: #0000FF;">Kill</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

</div>
<p><br/></p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/UAU0ZwW91x4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/19/terminating-running-processes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/19/terminating-running-processes/</feedburner:origLink></item>
		<item>
		<title>C – List All Network Interfaces</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/gJXfA4yDpZE/</link>
		<comments>http://www.megapanzer.com/2012/05/16/c-list-all-network-interface/#comments</comments>
		<pubDate>Wed, 16 May 2012 14:15:23 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Coders corner]]></category>
		<category><![CDATA[Tools & sources]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Interface]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Settings]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=6648</guid>
		<description><![CDATA[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
<br/></p>
<div style="width: 690px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;winsock2.h&gt;</span>
<span style="color: #339933;">#include &lt;iphlpapi.h&gt;</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
&nbsp;
&nbsp;
<span style="color: #339933;">#pragma comment(lib, &quot;IPHLPAPI.lib&quot;)</span>
&nbsp;
<span style="color: #339933;">#define MALLOC(x) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x))</span>
<span style="color: #339933;">#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/*
 * According Microsofts example on MSDN
 *
 */</span>
&nbsp;
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  PIP_ADAPTER_INFO lAdapterInfo<span style="color: #339933;">;</span>
  PIP_ADAPTER_INFO lAdapter <span style="color: #339933;">=</span> NULL<span style="color: #339933;">;</span>
  UINT lCounter<span style="color: #339933;">;</span>
  ULONG lOutBufLen <span style="color: #339933;">=</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>IP_ADAPTER_INFO<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>lAdapterInfo <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>IP_ADAPTER_INFO <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> MALLOC<span style="color: #009900;">&#40;</span><span style="color: #993333;">sizeof</span> <span style="color: #009900;">&#40;</span>IP_ADAPTER_INFO<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> NULL<span style="color: #009900;">&#41;</span> 
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>GetAdaptersInfo<span style="color: #009900;">&#40;</span>lAdapterInfo<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lOutBufLen<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> ERROR_BUFFER_OVERFLOW<span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#123;</span>
      FREE<span style="color: #009900;">&#40;</span>lAdapterInfo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>lAdapterInfo <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>IP_ADAPTER_INFO <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> MALLOC<span style="color: #009900;">&#40;</span>lOutBufLen<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> NULL<span style="color: #009900;">&#41;</span> 
      <span style="color: #009900;">&#123;</span>
          <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Error allocating memory needed to call GetAdaptersinfo<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// if ((lAdapt...</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// if (GetAd...</span>
&nbsp;
&nbsp;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>GetAdaptersInfo<span style="color: #009900;">&#40;</span>lAdapterInfo<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lOutBufLen<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> NO_ERROR<span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>lAdapter <span style="color: #339933;">=</span> lAdapterInfo<span style="color: #339933;">;</span> lAdapter<span style="color: #339933;">;</span> lAdapter <span style="color: #339933;">=</span> lAdapter<span style="color: #339933;">-&gt;</span>Next<span style="color: #009900;">&#41;</span> 
	  <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>ComboIndex: <span style="color: #000099; font-weight: bold;">\t</span>%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>ComboIndex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Adapter Name: <span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>AdapterName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Adapter Desc: <span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>Description<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Adapter Addr: <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>lCounter <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> lCounter <span style="color: #339933;">&lt;</span> lAdapter<span style="color: #339933;">-&gt;</span>AddressLength<span style="color: #339933;">;</span> lCounter<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> 
		<span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>lCounter <span style="color: #339933;">==</span> <span style="color: #009900;">&#40;</span>lAdapter<span style="color: #339933;">-&gt;</span>AddressLength <span style="color: #339933;">-</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2X<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span> lAdapter<span style="color: #339933;">-&gt;</span>Address<span style="color: #009900;">&#91;</span>lCounter<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">else</span>
            <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2X-&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span> lAdapter<span style="color: #339933;">-&gt;</span>Address<span style="color: #009900;">&#91;</span>lCounter<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// for (lCou...</span>
&nbsp;
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Index: <span style="color: #000099; font-weight: bold;">\t</span>%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>Index<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Type: <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>lAdapter<span style="color: #339933;">-&gt;</span>Type<span style="color: #009900;">&#41;</span> 
        <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_OTHER<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Other<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_ETHERNET<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Ethernet<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_TOKENRING<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Token Ring<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_FDDI<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;FDDI<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_PPP<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;PPP<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_LOOPBACK<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Lookback<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">case</span> MIB_IF_TYPE_SLIP<span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Slip<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
              <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Unknown type %ld<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>Type<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// switch(...</span>
&nbsp;
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>IP Address: <span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>IpAddressList.<span style="color: #202020;">IpAddress</span>.<span style="color: #202020;">String</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>IP Mask: <span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>IpAddressList.<span style="color: #202020;">IpMask</span>.<span style="color: #202020;">String</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Gateway: <span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lAdapter<span style="color: #339933;">-&gt;</span>GatewayList.<span style="color: #202020;">IpAddress</span>.<span style="color: #202020;">String</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// for (pAdapter...</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// if (GetAdapte...</span>
&nbsp;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>lAdapterInfo<span style="color: #009900;">&#41;</span>
      FREE<span style="color: #009900;">&#40;</span>lAdapterInfo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// if ((lAdapterInfo...</span>
	system<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;pause&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</div>
<p><br/></p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/gJXfA4yDpZE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/16/c-list-all-network-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/16/c-list-all-network-interface/</feedburner:origLink></item>
		<item>
		<title>Bitcoin bank Bitcoinica still titsup after cyberheist</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/dHLDMawU530/</link>
		<comments>http://www.megapanzer.com/2012/05/16/bitcoin-bank-bitcoinica-still-titsup-after-cyberheist/#comments</comments>
		<pubDate>Wed, 16 May 2012 06:50:34 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[News & media]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=7464</guid>
		<description><![CDATA[[URL]http://www.theregister.co.uk/2012/05/15/bitcoinica_hack/[URL] [SOURCE]The Register[SOURCE]]]></description>
			<content:encoded><![CDATA[<p>[URL]http://www.theregister.co.uk/2012/05/15/bitcoinica_hack/[URL]<br />
[SOURCE]The Register[SOURCE]</p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/dHLDMawU530" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/16/bitcoin-bank-bitcoinica-still-titsup-after-cyberheist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/16/bitcoin-bank-bitcoinica-still-titsup-after-cyberheist/</feedburner:origLink></item>
		<item>
		<title>C – Converting IP Address String To Unsigned Long</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/WkqnrHIUp9c/</link>
		<comments>http://www.megapanzer.com/2012/05/14/c-converting-ip-address-string-to-unsigned-long/#comments</comments>
		<pubDate>Mon, 14 May 2012 10:54:09 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Coders corner]]></category>
		<category><![CDATA[Address]]></category>
		<category><![CDATA[Converting]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Long]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=6637</guid>
		<description><![CDATA[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 #include &#60;windows.h&#62; #include &#60;stdio.h&#62; &#160; #pragma comment(lib, &#34;Ws2_32.lib&#34;) &#160; &#160; &#160; &#160; int main&#40;&#41; &#123; int [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
<br/></p>
<div style="width: 690px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
&nbsp;
<span style="color: #339933;">#pragma comment(lib, &quot;Ws2_32.lib&quot;)</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> lRetVal <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>lRemoteIPStr <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;192.168.1.1&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> lIPLongHost <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> lIPLongNet <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #666666; font-style: italic;">// From String to 4 byte char array.</span>
  sscanf<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> lRemoteIPStr<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%d.%d.%d.%d&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#40;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">255</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #666666; font-style: italic;">// Copy the 4 byte char array to a 4 byte unsigned long, host order</span>
  CopyMemory<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>lIPLongHost<span style="color: #339933;">,</span> lIPArr<span style="color: #339933;">,</span> <span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  <span style="color: #666666; font-style: italic;">// Convert the  unsigned long (host order) variable to network order</span>
  lIPLongNet <span style="color: #339933;">=</span> htonl<span style="color: #009900;">&#40;</span>lIPLongHost<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%s -&gt; %d.%.d.%d.%d -&gt; %lu -&gt; %lu <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lRemoteIPStr<span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> 
	      lIPLongHost<span style="color: #339933;">,</span> lIPLongNet<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span>lRetVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</div>
<p><br/></p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/WkqnrHIUp9c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/14/c-converting-ip-address-string-to-unsigned-long/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/14/c-converting-ip-address-string-to-unsigned-long/</feedburner:origLink></item>
		<item>
		<title>Cyber criminals infect Amnesty website to spread Trojan</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/SLr-gAFy7DU/</link>
		<comments>http://www.megapanzer.com/2012/05/14/cyber-criminals-infect-amnesty-website-to-spread-trojan/#comments</comments>
		<pubDate>Mon, 14 May 2012 06:37:26 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[News & media]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=7459</guid>
		<description><![CDATA[[URL]http://www.v3.co.uk/v3-uk/news/2174171/cyber-criminals-infect-amnesty-website-spread-trojan[URL] [SOURCE]V3[SOURCE]]]></description>
			<content:encoded><![CDATA[<p>[URL]http://www.v3.co.uk/v3-uk/news/2174171/cyber-criminals-infect-amnesty-website-spread-trojan[URL]<br />
[SOURCE]V3[SOURCE]</p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/SLr-gAFy7DU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/14/cyber-criminals-infect-amnesty-website-to-spread-trojan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/14/cyber-criminals-infect-amnesty-website-to-spread-trojan/</feedburner:origLink></item>
		<item>
		<title>C – Listing IP range</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/PX_-nzMtjp8/</link>
		<comments>http://www.megapanzer.com/2012/05/10/c-listing-ip-range/#comments</comments>
		<pubDate>Thu, 10 May 2012 08:41:37 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Coders corner]]></category>
		<category><![CDATA[Tools & sources]]></category>
		<category><![CDATA[Address]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Range]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=6643</guid>
		<description><![CDATA[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
<br/></p>
<div style="width: 690px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
&nbsp;
<span style="color: #339933;">#pragma comment(lib, &quot;Ws2_32.lib&quot;)</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> lRetVal <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>lStartIP <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;192.168.1.1&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>lStopIP <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;192.168.1.15&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> lStartIPLong <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> lStopIPLong <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> lCounter <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> lLongTmp <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #808080; font-style: italic;">/*
   * Calculate start IP as Unsigned Long
   */</span>
  sscanf<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> lStartIP<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%d.%d.%d.%d&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#40;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">255</span><span style="color: #339933;">;</span>
  CopyMemory<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>lStartIPLong<span style="color: #339933;">,</span> lIPArr<span style="color: #339933;">,</span> <span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  lStartIPLong <span style="color: #339933;">=</span> htonl<span style="color: #009900;">&#40;</span>lStartIPLong<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #808080; font-style: italic;">/*
   * Calculate stop IP as Unsigned Long
   */</span>
  sscanf<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> lStopIP<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%d.%d.%d.%d&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#40;</span>lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">|</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">255</span><span style="color: #339933;">;</span>
  CopyMemory<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>lStopIPLong<span style="color: #339933;">,</span> lIPArr<span style="color: #339933;">,</span> <span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  lStopIPLong <span style="color: #339933;">=</span> htonl<span style="color: #009900;">&#40;</span>lStopIPLong<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Start IP : %lu<span style="color: #000099; font-weight: bold;">\n</span>Stop IP  : %lu<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lStartIPLong<span style="color: #339933;">,</span> lStopIPLong<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>lStartIPLong <span style="color: #339933;">&lt;=</span> lStopIPLong<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>lCounter <span style="color: #339933;">=</span> lStartIPLong<span style="color: #339933;">;</span> lCounter <span style="color: #339933;">&lt;=</span> lStopIPLong<span style="color: #339933;">;</span> lCounter<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
      lLongTmp <span style="color: #339933;">=</span> ntohl<span style="color: #009900;">&#40;</span>lCounter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      CopyMemory<span style="color: #009900;">&#40;</span>lIPArr<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>lLongTmp<span style="color: #339933;">,</span> <span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%lu -&gt; %d.%d.%d.%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> lCounter<span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> lIPArr<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// for (lCo...</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// if (lStart..</span>
&nbsp;
&nbsp;
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span>lRetVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</div>
<p><br/></p>
<img src="http://feeds.feedburner.com/~r/megapanzer/~4/PX_-nzMtjp8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/10/c-listing-ip-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/10/c-listing-ip-range/</feedburner:origLink></item>
		<item>
		<title>New malware strain locks up computers unless ransom is paid</title>
		<link>http://feedproxy.google.com/~r/megapanzer/~3/lVVsv-mNDNw/</link>
		<comments>http://www.megapanzer.com/2012/05/08/new-malware-strain-locks-up-computers-unless-ransom-is-paid/#comments</comments>
		<pubDate>Tue, 08 May 2012 09:35:23 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[News & media]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=7453</guid>
		<description><![CDATA[[URL]http://news.cnet.com/8301-1009_3-57429139-83/new-malware-strain-locks-up-computers-unless-ransom-is-paid/?tag=txt;title[URL] [SOURCE]CNET[SOURCE]]]></description>
			<content:encoded><![CDATA[<glossarycode><p>[URL]http://news.cnet.com/8301-1009_3-57429139-83/new-<a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a>-strain-locks-up-computers-unless-ransom-is-paid/?tag=txt;title[URL]<br />
[SOURCE]CNET[SOURCE]</p></glossarycode><img src="http://feeds.feedburner.com/~r/megapanzer/~4/lVVsv-mNDNw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2012/05/08/new-malware-strain-locks-up-computers-unless-ransom-is-paid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.megapanzer.com/2012/05/08/new-malware-strain-locks-up-computers-unless-ransom-is-paid/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 2.238 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-25 11:46:37 -->

