C++ — Detours (Win32 API Hijacking) — Hijack Class Methods

橙三吉。 提交于 2019-12-10 18:01:48

问题


I had no problems hijacking function with Detours for a long time... When I tried to hijack class methods (in my case IHTMLDocument2::write from mshtml.dll) I encountered endless problems (mainly type mismatching). As I didn't find any relevant example on the net I began doubting this can be done.

My question is: is it possible to hijack class methods with Detours? Can I have an example, please? If not, is it possible to hijack class methods in a simpler way with another hooking library?

Thanks in advance guys!


回答1:


IHTMLDocument2::write is not just a class method; it's a COM method. That implies a whole lot more. For instance, there's also an equivalent C declaration. You can use that C signature when detouring the method; it's still the same function.




回答2:


http://pastebin.com/f6559d448

Yeah!



来源:https://stackoverflow.com/questions/1622304/c-detours-win32-api-hijacking-hijack-class-methods

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!