Question

I have been trying to understand the concept of 'hooking' APIs and am currently facing a problem. I hope that experts here can clear it:

By going through a header file I noticed that the LoadLibrary function is actually mapped to one of the following two: LoadLibraryW or LoadLibraryA based on the flag used during compilation (UNICODE or ASCII, respectively). Now, if I have explicitly hooked the API 'LoadLibraryA' then will my hooked function get the control if it is compiled using the UNICODE flag?

It would be great if someone could explain or point me to a link that explains in detail how hooking works in such cases? How do compilation flags, character sets, locale, internationalization, impact hooking of APIs like LoadLibrary or CreateFile?

I'm currently in South Korea (Originally from UK) and for some reason some of my application is not working and I have a demo tomorrow. I presume the above mentioned doubt is the reason for the problem I'm facing.

Was it helpful?

Solution

I think that you need to read carefully this bible of api hooking Hooking in theory which explains everything about hooking like different approaches of hooking, lot of diagrams.... and also this one example. My suggestion is to use LoadLibraryW because it is superset of Acsii. Bye

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top