如何破解键盘以检查按下了哪个键 [英] How to hack the keyboard to check which key has pressed

查看:68
本文介绍了如何破解键盘以检查按下了哪个键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我正在开发一个用于破解键盘的应用程序..

在我的Windows应用程序中,我需要有按键的详细信息在计算机键盘上。我需要将所有按键细节存储在word或.txt文件中。我现在想迟到存储我想得到按键被按下的值。我在互联网上看到它可以通过表单按键事件来完成

  private   void  Mainform_KeyPress( object  sender,KeyPressEventArgs e)
{

}







但为此,表格应该出现。我想知道关键按下的细节而不知道用户。即使我使用密码按下事件使用此代码



 [DllImport(  user32.Dll)] 
public static extern int keybd_event( byte ch, byte scan, int 标志, int info);







但此方法用于将关键数据输入计算机。但我需要得到价值

所以任何人都可以告诉我如何做这个是否有任何链接,示例或任何其他DLL。



提前谢谢

Arun

解决方案

您需要注册键盘全局挂钩很简单

< pre lang =c#> SetWindowsHookEx( int idHook,KeyboardHookProc callback, IntPtr hInstance, uint threadId);



并以隐藏模式运行此表单。在回调全局钩子事件时复制键你需要并使用

 CallNextHookEx( IntPtr  idHook, int  nCode, int  wParam, ref 键盘HookStruct lParam)


好的,为什么你知道他们可以解决完全不同的问题?是的,你尝试过的所有方法都与你想要达到的目标无关。这个解决方案很有名,很多次在这个论坛上进行过讨论。



但我真的很想知道,你想要获得什么信息了解用户。这对我来说听起来像是恶意活动。这种担忧比人们想象的更严重。我知道禁止这种开发的公司即使是出于合法目的也是一项特殊法令。



-SA


Hello every one
I m developing an application which is used to hack the key board ..
In my windows application i need to have a details of key pressed in on computer key board .I need to store all the key pressed details in a word or .txt file . I will think late to store now i want to get the value which key has been pressed. I saw in internet It can be done through form key pressed event

private void Mainform_KeyPress(object sender, KeyPressEventArgs e)
        {

        }




But for this the form should appear . I want to know the key pressed details without knowing to user. Even i used the Key pressed event using this code

[DllImport("user32.Dll")]
       public static extern int keybd_event(byte ch, byte scan, int flag, int info);




but this method is used to input the key data to computer . But i need to get the value
So can any one tell me how to do this Is there any link,example or any other DLL .

Advance Thanks
Arun

解决方案

It is simple you have to register for keyboard global hook

SetWindowsHookEx(int idHook, KeyboardHookProc callback, IntPtr hInstance, uint threadId);


in your form and run this form in hidden mode.In callback of you global hook event copy the key you required and forward it to next hook using

CallNextHookEx(IntPtr idHook, int nCode, int wParam, ref KeyboardHookStruct lParam)


OK, and why did you put these wrong ways in your question knowing they can solve completely different problems? Yes, all ways you tried have nothing to do with what you wanted to achieve. And the solution is well-known, was discussed in this forum many times.

But I would really would like to know, what information would you like to obtain "without knowing to user". It sound too much like malicious activity to me. This concern is more serious than one may think. I know companies where such development is prohibited be a special decree even for legitimate purpose.

—SA


这篇关于如何破解键盘以检查按下了哪个键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆