跟踪注入过程中的 HDC
我面临着一个两难的境地。我已将我的 DLL 注入到其他进程中,并挂钩了一些 具体来说,从那里调用 WinAPI,包括 ExtTextOutW@GDI32、DrawTextExW@GDI32 和 AlphaBlend@Msimg32。现在的问题是,当另一个应用程序使用这两个 GDI32 函数编写某些内容时,我不知道它出现的确切位置。这是因为包含文本的 DC 会使用 AlphaBlend 进行处理,最终也会将其放入窗口的 DC 中。
那么,我如何追踪某些 HDC?在伪代码中,其他应用程序的绘制方式如下 文本到屏幕:
HDC h = DrawTextW("STRING")
Do something with h. The "STRING" gets new HDC, say h2.
Pass h2 to AlphaBlend, which draws it to the screen.
就像我说的,当字符串在 AlphaBlend 之前获得新的 DC 时,我失去了对原始 h 的跟踪。 任何想法,我怎样才能从 h > 建立连接? h2 中有特定的字符串吗?
不知道我是否能够正确地解释这个问题,如果您有任何问题,请询问...
I'm facing quite a dilemma. I've injected my DLL into other process as well as hooked few
WinAPI calls from there, ExtTextOutW@GDI32, DrawTextExW@GDI32 and AlphaBlend@Msimg32 to be specific. Now, the problem is that when the other application writes something with those two GDI32 functions, i don't know the exact location where it comes up. This is because the DC which contains the text gets processed with AlphaBlend, which also eventually puts it to the window's DC.
So, how can I track certain HDC? In pseudo code, here's how the other application draws
text to the screen:
HDC h = DrawTextW("STRING")
Do something with h. The "STRING" gets new HDC, say h2.
Pass h2 to AlphaBlend, which draws it to the screen.
Like I said, I loose track with the original h as the string gets new DC before AlphaBlend.
Any idea, how I can make a connection from h > h2 with certain string in it?
I don't know if I was able to explain the problem properly, please ask if you've got any questions...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那应该可以解决问题。在后一个函数中输入任何代码来修改
HDC
。That should do the trick. Put in any code to modify the
HDC
in the latter function.