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

2

3

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!

Yolandoyolane answered 25/10, 2009 at 22:29 Comment(0)
V
2

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.

Voluptuous answered 26/10, 2009 at 11:10 Comment(0)
Y
1

http://pastebin.com/f6559d448

Yeah!

Yolandoyolane answered 26/10, 2009 at 2:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.