开发者

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

开发者 https://www.devze.com 2022-12-23 15:40 出处:网络
I had no problems hijacking function with Detours for a long time... When I tried to hijack class开发者_如何学Python methods (in my case IHTMLDocument2::write from mshtml.dll) I encountered endless pr

I had no problems hijacking function with Detours for a long time... When I tried to hijack class开发者_如何学Python 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!


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.


http://pastebin.com/f6559d448

Yeah!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号