挂钩 Java 应用程序会导致应用程序崩溃/冻结
我刚刚实现了一个系统范围的钩子;它挂钩到 32 位进程并反转其文本(例如,挂钩到文本板并反转菜单文本等,只是为了进行一些基本的挂钩)。我在这里发布了我的代码:
它工作正常对于文本板、chrome 等,但是当我尝试在我真正需要的一个程序(一个 java 应用程序)上使用它时,该应用程序冻结了。程序本身似乎没有受到影响;没有奇怪的错误代码或任何东西。这是应用程序(这是我的经纪人的交易平台)冻结了。它是一个 .jnlp 文件,通过 java web-starter(随后加载交易平台)启动。它使用 ng jre6 作为 32 位进程启动。
我运行的是 Windows 7 64 位、Visual Studio 10.0、Detours 3.0。这对我来说是相当陌生的领域;不确定如何继续或如何调试此问题。我并没有接受我所使用的方法;如果我可以用不同类型的钩子来规避这个问题,我会很乐意使用它。知道如何解决/调试这个问题吗?任何帮助表示赞赏。
更新:在 Intellij (一个 java IDE)上尝试过这个,它也冻结了。我想知道是否可能只是这些应用程序加载了大量进程的事实,所以也许这把事情搞砸了,但在 Adobe Photoshop Elements 上尝试过(也加载了大量进程),并且效果很好。所以还是卡住了。
I just implemented a system-wide hook; it hooks into 32-bit processes and reverses their text (eg. hooks into textpad and reverses menu text etc., just to get some basic hooking going). I posted my code here:
Having trouble with microsoft detours
It works fine for textpad, chrome etc., but when I try to use it on the one program I really need, a java application, the application freezes. The program itself appears unaffected; no strange error codes or anything. It's the application (which is my broker's trading platform) that freezes. It's a .jnlp file that is launched via the java web-starter (which subsequently loads up the trading platform). It launches as a 32-bit process usng jre6.
I am running Windows 7 64-bit, Visual Studio 10.0, Detours 3.0. This is pretty unfamiliar territory for me; not sure how to proceed or how to debug this issue. I'm not married to the approach I used; if I could circumvent this issue with a different kind of hook I would gladly use that. Any idea how I can solve/debug this issue? Any help is appreciated.
UPDATE: Tried this on Intellij (a java IDE) and it freezes that too. I wondered if maybe it was just the fact that these applications load a ton of processes so maybe that was mucking things up, but tried it on Adobe Photoshop Elements (also loads a ton of processes) and it worked fine on that. So still stuck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当你hook一个进程时,你需要使用32位hook来hook一个32位进程。由于您使用 VS 2010 64 位,您是否已设置解决方案来生成 32 位挂钩?
您的目标是 Java 应用程序。您可能想尝试使用 Java Accessibility 来附加到该进程,然后使用反射来获取文本并反转它。
祝你好运
When you hook a process, you need to use 32 bit hook to hook a 32 bit process. Since you use VS 2010 64 bit, Have you set up your solution to generate a 32 bit hook?
Your target is a Java application. You may want to try the Java Accessibility to attch to the process and then use reflection to get the text and reverse it.
Good luck