RahulK-5396 avatar image
0 Votes"
RahulK-5396 asked RichardZhang-MSFT commented

Is there any UWP API/way available to detect/prevent hooking?

  • There are many tools available to do hooking eg: frida 29.html.

  • But i didn't find any API or way to detect hooking . Is there any API or way to detect hooking in Universal Windows Platform(UWP)?

  • If yes, can it detect all kinds of hooking(functional hooking, event hooking etc)? or it can detect only one particular type of hooking?

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, in UWP, hooking is usually done by event triggering, what is the object you hooked, and what specific event do you want to handle?

0 Votes 0 ·
  • Lets take an example of event hooking, if we look in this sample project: Windows-User-Action-Hook

  • if we run this sample project and our UWP app side by side it can hook keyboard event. i.e., whatever we type on keyboard can be captured and misused.

  • There will be many apps that will run in background can steal our keyboard events.

  • *Is there any way to prevent/detect this?

  • Once if we able to detect/prevent this we can next see how to detect/prevent hooking on messages, mouse actions and also class/method level hooking.

  • references: about-hooks , how-to-reverse-engineer-a-windows-10-uwp-app ,

  • example

0 Votes 0 ·

For UWP, there is no document to explain this. The hook you are talking about is more about monitoring keyboard events from the system level. UWP applications do not provide related APIs to prevent other applications from listening for keyboard events.

1 Vote 1 ·

So can't we detect/prevent any class/functional hooking also? Isn't there any other/indirect way to do so apart from APIs?

0 Votes 0 ·

If the classic win32 application has related solutions, you may consider creating a win32 application and converting it to a uwp application through desktop-bridge. Currently, native UWP applications do not have relevant APIs to support this functional.

1 Vote 1 ·

0 Answers