百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

LdrDllNotificationHook

> 编程语言
开源

钩取所有已在 LdrRegisterDllNotification 中注册的回调

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

钩取所有已在 LdrRegisterDllNotification 中注册的回调

LdrDllNotificationHook

This project demonstrates a way to hook all DLL load notifications in a process. It hooks all callbacks which are registered with LdrRegisterDllNotification, including callbacks which are registered after the hook is set.

The hook can be used to prevent the original callbacks from being called.

Theory

The callbacks are stored in a doubly-linked list in ntdll, LdrpDllNotificationList.

…

LdrpDllNotificationList isn't exported, but it's easy to retrieve its address. We can simply register a new callback with LdrRegisterDllNotification, which returns a Cookie pointer which is in fact a pointer to the callback's entry in the list. After adding the callback, its Flink pointer will point to the head of the list.

Note: Relying on the Flink pointer is prone to races, since the list can be modified by other threads. It's pretty unlikely to happen in practice, though, since the function isn't called very often. To be 100% sure, you can access the list from one of the callbacks, since ntdll acquires a lock while iterating over the list and calling the registered callbacks. For example, register a callback, load a DLL, and do the list access in that callback that will be called due to the DLL load while the lock is acquired. That's not implemented in this project.

After retrieving the address of the list head, we add a new entry to the beginning of the list with a custom callback. When this callback is invoked, it replaces the rest of the callbacks with a hook function. Since this entry will always remain first, we assure that all callbacks are always hooked, even if they are registered after the entry is added.

References

  • ViewDllNotification x64dbg plugin.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言