EMO Style ForumPro - Hos Geldiniz
Basic Keyboard Hooks Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
Basic Keyboard Hooks Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

loot  pointer  kutu  

Kimler hatta?
Toplam 3 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 3 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Basic Keyboard Hooks I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Basic Keyboard Hooks I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Basic Keyboard Hooks I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Basic Keyboard Hooks I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
Basic Keyboard Hooks I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Basic Keyboard Hooks I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Basic Keyboard Hooks I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Basic Keyboard Hooks I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Basic Keyboard Hooks I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

Basic Keyboard Hooks

Aşağa gitmek

Basic Keyboard Hooks Empty Basic Keyboard Hooks

Mesaj tarafından EMO Salı Mayıs 31, 2011 2:48 am

First off this is obviously my first post on MPGH.net and i wanna post something actually contributory.

To create a Basic Keyboard hook you are going to need to understand basic C# and .NET basics.

To start make a new Windows Form project and name it whatever you want.
Then go into the Forms Code and add the following namespaces
Code:
using System.IO;
using System****ntime.InteropServices;
using Microsoft.Win32;
using System.Diagnostics;
Now that you have those you want to add a new struct above your main form class.

Code:
[StructLayout(LayoutKind.Sequential)]
public struct KeyHook
{
public Keys key;
public int Code;
public int flags;
public int time;
public IntPtr extra;
}
Now that you have a new struct you want to go into your forms class and add the following Fields.
Code:
private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr SetWindowsHookEx(int id, LowLevelKeyboardProc callback, IntPtr hMod, uint dwThreadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool UnhookWindowsHookEx(IntPtr hook);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr CallNextHookEx(IntPtr hook, int nCode, IntPtr wp, IntPtr lp);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr GetModuleHandle(string name);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern short GetAsyncKeyState(Keys key);
private IntPtr ptrHook;
private LowLevelKeyboardProc objKeyboardProcess;
Now in your forms class add the following void

Code:
private IntPtr captureKey(int nCode, IntPtr wp, IntPtr lp)
{
if (nCode >= 0)
{
KeyHook objKeyInfo = (KeyHook)Marshal.PtrToStructure(lp, typeof(KeyHook));
}
http://this.TopMost = true;
return CallNextHookEx(ptrHook, nCode, wp, lp);
}
now into your forms main void default (Form1()) or

Code:
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
objKeyboardProcess = new LowLevelKeyboardProc(captureKey);
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);
Now go to your Forms Designer.cs and add the name spaces
Code:
using System;
then in the designers Desposing() bool replace it with
Code:
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{

components.Dispose();
}
if (ptrHook != IntPtr.Zero)
{
UnhookWindowsHookEx(ptrHook);
ptrHook = IntPtr.Zero;
}
base.Dispose(disposing);
}

Now we have added the code to catch the keybaord hooks to use this to do functions or other stuff we go to the CaptureKey void

To Disable a Key's input you add the code

Code:
private IntPtr captureKey(int nCode, IntPtr wp, IntPtr lp)
{
if (nCode >= 0)
{
KeyHook objKeyInfo = (KeyHook)Marshal.PtrToStructure(lp, typeof(KeyHook));
if (objKeyInfo.key == /*Key to disable*/)
return (IntPtr)1;
}
http://this.TopMost = true;
return CallNextHookEx(ptrHook, nCode, wp, lp);
}
To have it do a function do

Code:
private IntPtr captureKey(int nCode, IntPtr wp, IntPtr lp)
{
if (nCode >= 0)
{
KeyHook objKeyInfo = (KeyHook)Marshal.PtrToStructure(lp, typeof(KeyHook));
//if (objKeyInfo.key == /*Key*/)
Application.Exit();
}
http://this.TopMost = true;
return CallNextHookEx(ptrHook, nCode, wp, lp);
}
That is basic Keyboard Hooks, You can do many things with this code.

-Kantanomo leaving it short and sweet
EMO
EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 184
Puan : 237393
Rep Puanı : 5
Doğum tarihi : 28/11/89
Kayıt tarihi : 18/05/11
Yaş : 34
Nerden : EMO world
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz