简体   繁体   English

另一个全局钩子影响我的全局钩子

[英]Another global hook affects to my global hook

I wrote a global keyboard hook program in C# .NET act like a keylog, it writes results to a file. 我在C#.NET中编写了一个全局键盘钩子程序,就像一个键盘记录程序,它将结果写入文件。 But i used another program, which supports for type Vietnamese language in same computer- it also uses global hook to fix set keyboards to Vietnamese characters- it affect to my program! 但是我使用了另一个程序,它在同一台计算机上支持类型越南语 - 它还使用全局钩子来固定设置键盘到越南字符 - 它对我的程序有影响!

Example: when i type following: "xin chao2, to6i la2 mot65 nguoi72 Viet65 Nam" without my program, it will fix again after each character i typed to: xin chào, tôi là một người Việt Nam. 示例:当我键入以下内容:“xin chao2,to6i la2 mot65 nguoi72 Viet65 Nam”没有我的程序,它将在我键入的每个字符后再次修复:xinchào,tôilàmộtngườiViệtNam。

But when i use my global hook, i receive result in file: 但是当我使用我的全局钩子时,我收到文件中的结果:

xin chao2[Back]
[Back]
[Packet]
[Packet]
[Escape]
 toi6[Back]
[Back]
[Packet]
[Packet]
[Escape]
 la2[Back]
[Packet]
[Escape]
 nguoi7[Back]
[Back]
[Back]
[Packet]
[Packet]
[Packet]
[Escape]
2[Back]
[Back]
[Packet]
[Packet]
[Escape]
Viet6[Back]
[Back]
[Packet]
[Packet]
[Escape]
5[Back]
[Back]
[Packet]
[Packet]
[Escape]
 Nam 

So, how do i fix this error, exclude effect of program support type Vietnamese without remove or disable it, or accept effect from it but results in file look like when type without my program? 那么,我如何修复此错误,排除程序支持类型越南语的效果,而不删除或禁用它,或接受它的效果,但结果文件看起来像没有我的程序类型?

Sorry if you have any uncomfortableness about my English! 对不起,如果您对我的英语感到不舒服!

Assuming I understand your question correctly, you are trying to create another hook that will also hook the characters after they have been fixed to use vietnamese characters? 假设我正确地理解了你的问题,你试图创建另一个钩子,它们也会在修复后使用越南字符来挂钩它们? It's a bit of a hacky solution, but you could try opening up the vietnamese program which is creating the hook in a debugger, find the function that is doing the hooking, and hook the return value of that function. 这是一个hacky解决方案,但你可以尝试打开越南程序,它在调试器中创建钩子,找到正在执行挂钩的函数,并挂钩该函数的返回值。

Check out windows detours http://research.microsoft.com/en-us/projects/detours/ 查看窗口绕道http://research.microsoft.com/en-us/projects/detours/

and if you're doing .NET there's easy hook http://easyhook.codeplex.com/ 如果您正在使用.NET,那么很容易就是http://easyhook.codeplex.com/

here's a tutorial on creating hooks in C++ and detours http://gamerztools.net/foros/showthread.php?933-C-Tutorial-Hooking-Functions-using-Detours 这是一个关于在C ++中创建钩子的教程和绕道http://gamerztools.net/foros/showthread.php?933-C-Tutorial-Hooking-Functions-using-Detours

Hopefully that should point you in the right direction! 希望这应该指向正确的方向!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM