当键盘日志不可用时如何记录击键?

发布于 2024-07-11 12:36:28 字数 875 浏览 9 评论 0原文

最初使用 MS 特定的键盘日记挂钩 (WH_JOURNALRECORD) 设置 C++ 应用程序后,我们发现它无法在 Vista 上运行,除非以管理员身份运行且启用了 uiAccess。 MSDN 问题 - 日记挂钩在 Vista 上?

我们希望以友好的方式记录用户的按键序列,并在以后的某个时间重复该序列。 用户按下录制按钮,将显示一个对话框,其中包含停止按钮和录制的按键。

使用日志钩子的一个优点是您只需要执行某些操作的击键即可。 按住 Shift 不会报告 100 个 Shift 键,但会在您敲击字母时报告使用情况。 另一个优点是您可以将焦点设置到应用程序外部的区域(例如另一个应用程序窗口),并在用户交互时记录操作。

除了将现有应用程序的键盘捕获部分作为一个单独的可执行文件(通过 uiAccess 以管理员身份运行)之外,我还在寻求有关如何记录在 2K、2K3、2K8、XP、Vista 的 Windows 上运行的击键的其他想法。

编辑:我知道仅记录任何内容都会存在安全问题,显然如果您可以在用户没有注意到您拥有用于黑客目的的典型击键记录器的情况下执行此类操作。 Soooooo.....

有没有一种方法可以让该用户及其应用程序在相同级别(或更低级别)运行并捕获击键,从而使日记功能正常工作? 让它弹出 vista 安全对话框,你确定可以吗,但是该进程不能用 uiAccess 标记(否则它将无法与系统的其余部分正确交互),并且在 98% 的情况下,它将由没有 uiAccess 的用户运行提升为管理员的权限。

Having setup C++ app originally using MS specific keyboard journaling hook (WH_JOURNALRECORD) we find that it does not work on Vista unless run as administrator with uiAccess enabled. MSDN Question - Journaling hooks on Vista?

We want to record a key sequence from the user in a friendly way that will be repeated at some later date. The user presses a record button, a dialog is displayed with a stop button and the recorded keys.

One advantage of using the journaling hook was that you only got keystrokes which did something. Holding down shift didn't report 100 shift keys, but did report usage when you hit a letter.
Another advantage was that you could set the focus to an area outside of the application, say another applications window, and record the action as the user interacted.

Asides from making the keyboard capture part of the existing app a separate executable which runs as administrator with uiAccess, I'm seeking other ideas on how to record keystrokes that work on windows for 2K, 2K3, 2K8, XP, Vista.

Edit: I know there is a security concern with just recording anything, obviously if you could do such a thing without the users notice you have your typical keystroke logger for hacking purposes. Soooooo.....

Is there a way to make journaling work, for this user, and their apps, running at the same level (or lower) and capture keystrokes? having it popup the vista security are you sure dialog would be allright, but the process cannot be marked with uiAccess (otherwise it won't interact properly with the rest of the system) and it will in 98% of cases be run by users without rights to elevate to administrator.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花期渐远 2024-07-18 12:36:28

即使可以,您也可能会发现微软在下一个补丁中修复了该错误。 Vista 中的更改是有意为之的,并且有一个明确的方法 (uiAccess==true) 仍然可以执行您想要的操作。

Even if you could, you'd probably would find Microsoft fixing that bug in the next patch. The change in Vista was intentional, and there's a clear way (uiAccess==true) to still do what you want.

阳光下慵懒的猫 2024-07-18 12:36:28

我们通过使用 SetWindowsHook 解决了主要问题。

const HMODULE hDLL = ::GetModuleHandle(DLL_NAME);
::SetWindowsHookEx(WH_KEYBOARD_LL, myKeyboardProcCallback, hDLL, 0);

回调现在必须管理击键信息并将其转换为可用序列 - 即,当按下 ctrl+key 时,不要记录多次 ctrl 按下。

We have worked around the main issues by using SetWindowsHook instead.

const HMODULE hDLL = ::GetModuleHandle(DLL_NAME);
::SetWindowsHookEx(WH_KEYBOARD_LL, myKeyboardProcCallback, hDLL, 0);

The callback now has to manage the keystroke information and translating it into usable sequences - ie don't record multiple ctrl presses when heeld down to press ctrl+key.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文