Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hook a Kernel32 api with a driver?

Featured Replies

Posted

Anyone have an example of hooking a kernel32 api with a driver?

Also can more than one driver hook an api at a time?

Side question: Can you call a drivers functions directly? Or do you have to do the Read/Write file stream?

Why you need a driver to hook in user land ? you should use dll instead .

  • Author

How do you have a dll load in every process without just creating a remote thread in every process?

Also I kinda want to do it with a driver that way another dll cannot override the hook.

Even if another dll overwrites the hook, what it does is overwrite your JMP with another JMP to its own stub.

After that it restores the old instruction and calls the API. So it basically restores your own hook again.

Even if it copies the instructions it overwrites to its stub, it will still execute the old JMP. (given it can relocate relative jmps/calls)

I'm not even sure what a difference a driver would make. It still has to modify userland memory which can still be overwritten by a dll.

Unless you monitor and suppress changes to your hook in memory with your driver, it won't give you any extra protection. Let alone the effort of building a stable driver.

  • Author
Even if another dll overwrites the hook, what it does is overwrite your JMP with another JMP to its own stub.

After that it restores the old instruction and calls the API. So it basically restores your own hook again.

Even if it copies the instructions it overwrites to its stub, it will still execute the old JMP. (given it can relocate relative jmps/calls)

I'm not even sure what a difference a driver would make. It still has to modify userland memory which can still be overwritten by a dll.

Unless you monitor and suppress changes to your hook in memory with your driver, it won't give you any extra protection. Let alone the effort of building a stable driver.

I guess you are right.

But ya, what I want to do is hook an API and block calls to it. That is why I want my dll on top of everything. I guess I could have a thread running in the background that will detect if the hook is tampered with and repair it if it is.

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.