请问要怎么监控注册表?

Home Home
引用 | 编辑 gamewalk
2006-05-01 10:33
楼主
推文 x0
最近碰到一个问题需要监控特定的注册表(Registery),可是不知道它的原理是怎么办到的,我查过目前现有功能还蛮强的注册表监控软体 RegMon ,它可以把目前所有程式对注册表更动 ..

访客只能看到部份内容,免费 加入会员



献花 x0
引用 | 编辑 cmovies
2006-05-02 00:17
1楼
  
以前 SysInternals 有开放 Source 给人下载. 现在版本都没有了 :(
网路上找的到旧版的 Source, 你可以参考看看
http://www.vscodes.com/soft/24/78/2397.html

献花 x0
引用 | 编辑 CarlFeynman
2006-05-02 00:19
2楼
  
参见这里: http://www.sysinternals.com/Utilities/Regmon.html

On Windows NT, 2000 and XP the Regmon loads a device driver that uses a technique we pioneered for NT called system-call hooking. When a user-mode component makes a privileged system call, control is transfered to a software interrupt handler in NTOSKRNL.EXE (the core of the Windows NT operating system). This handler takes a system call number, which is passed in a machine register, and indexes into a system service table to find the address of the NT function that will handle the request. By replacing entries in this table with pointers to hooking functions, it is possible to intercept and replace, augment, or monitor NT system services. Regmon, which obviously hooks just the Registry-related services, is merely one example of this capability in action.

For more detailed information on how Regmon works on Windows NT, see:

"Windows NT System Call Hooking," by Mark Russinovich and Bryce Cogswell, Dr. Dobb's Journal, January 1997
"Inside NT Utilities", Windows NT Magazine, February 1999.

献花 x0
引用 | 编辑 CarlFeynman
2006-05-02 00:22
3楼
  
补充说明: 如果你对 NT 系统不是很懂, 那你还是放弃吧, 这种东西不是这么容易解释清楚, 也不是一两天就可以学会的. 就算是有了程式码, 也是没啥帮助.

楼上的程式码, 看样子是 9x 版本的程式码, 无法套用到 NT 系统架构.
VxD 为 9x 特有, 有关 VxD 的详细说明, 请参考 Google 搜寻.

献花 x1
引用 | 编辑 gamewalk
2006-05-02 00:46
4楼
  
虽然说还是看不太懂~"~,不过我会慢慢研究....还是谢谢你们的帮忙 表情

献花 x0
引用 | 编辑 cmovies
2006-05-02 01:08
5楼
  
我找到时有确认了一下, 里面有 SYS (For NT/2000) 的 Source 在 DD 的目录下.
这个目录名称蛮奇怪的, 不晓的谁乱改的.
我刚刚有重新编译所有 Source, 在 XP SP2 测试都正常.

我比较想知道的是他怎么能够侦测到哪些程式执行了那些API的function....但是我没有查到有这种可以侦测的功能存在(不过也可能没找清楚,因为很多~"~)...
-> 它本身用 Hook 的方式来拦截所有 Registry 的 function call, 一旦拦截到就可以取得 CurrentProcess. 再用 undocument 的方式去取得 Process Name.
这些都是在 REGSYS.c 里面, 不过要有 NT DDK 的基础才比较看的懂
有兴趣可以看一下 HookRegistry, HookRegOpenKey, ..., GetProcess

献花 x1