請問要怎麼監控註冊表?

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