注冊表監控
filemon和regmon可以分別用來監視文件操作和注冊表超作,功能和強大的 搜一下就可以找到下載
❷ C#實現注冊表監控
||這個也許對你有用,看看吧!using System;
using System.ComponentModel;
using System.IO;
using System.Threading;
using System.Runtime.InteropServices;
using Microsoft.Win32;namespace RegistryUtils
{
public class RegistryMonitor : IDisposable
{
#region P/Invoke [DllImport("advapi32.dll", SetLastError = true)]
private static extern int RegOpenKeyEx(IntPtr hKey, string subKey, uint options, int samDesired,
out IntPtr phkResult); [DllImport("advapi32.dll", SetLastError = true)]
private static extern int RegNotifyChangeKeyValue(IntPtr hKey, bool bWatchSubtree,
RegChangeNotifyFilter dwNotifyFilter, IntPtr hEvent,
bool fAsynchronous); [DllImport("advapi32.dll", SetLastError = true)]
private static extern int RegCloseKey(IntPtr hKey); private const int KEY_QUERY_VALUE = 0x0001;
private const int KEY_NOTIFY = 0x0010;
private const int STANDARD_RIGHTS_READ = 0x00020000; private static readonly IntPtr HKEY_CLASSES_ROOT = new IntPtr(unchecked((int) 0x80000000));
private static readonly IntPtr HKEY_CURRENT_USER = new IntPtr(unchecked((int) 0x80000001));
private static readonly IntPtr HKEY_LOCAL_MACHINE = new IntPtr(unchecked((int) 0x80000002));
private static readonly IntPtr HKEY_USERS = new IntPtr(unchecked((int) 0x80000003));
private static readonly IntPtr HKEY_PERFORMANCE_DATA = new IntPtr(unchecked((int) 0x80000004));
private static readonly IntPtr HKEY_CURRENT_CONFIG = new IntPtr(unchecked((int) 0x80000005));
private static readonly IntPtr HKEY_DYN_DATA = new IntPtr(unchecked((int) 0x80000006)); #endregion #region Event handling /// <summary>
/// Occurs when the specified registry key has changed.
/// </summary>
public event EventHandler RegChanged;
protected virtual void OnRegChanged()
{
EventHandler handler = RegChanged;
if (handler != null)
handler(this, null);
} /// <summary>
/// Occurs when the access to the registry fails.
/// </summary>
public event ErrorEventHandler Error;
protected virtual void OnError(Exception e)
{
ErrorEventHandler handler = Error;
if (handler != null)
handler(this, new ErrorEventArgs(e));
} #endregion #region Private member variables private IntPtr _registryHive;
private string _registrySubName;
private object _threadLock = new object();
private Thread _thread;
private bool _disposed = false;
private ManualResetEvent _eventTerminate = new ManualResetEvent(false); private RegChangeNotifyFilter _regFilter = RegChangeNotifyFilter.Key | RegChangeNotifyFilter.Attribute |
RegChangeNotifyFilter.Value | RegChangeNotifyFilter.Security; #endregion /// <summary>
/// Initializes a new instance of the <see cref="RegistryMonitor"/> class.
/// </summary>
/// <param name="registryKey">The registry key to monitor.</param>
public RegistryMonitor(RegistryKey registryKey)
{
InitRegistryKey(registryKey.Name);
} /// <summary>
/// Initializes a new instance of the <see cref="RegistryMonitor"/> class.
/// </summary>
/// <param name="name">The name.</param>
public RegistryMonitor(string name)
{
if (name == null || name.Length == 0)
throw new ArgumentNullException("name"); InitRegistryKey(name);
}
/// <summary>
/// Initializes a new instance of the <see cref="RegistryMonitor"/> class.
/// </summary>
/// <param name="registryHive">The registry hive.</param>
/// <param name="subKey">The sub key.</param>
public RegistryMonitor(RegistryHive registryHive, string subKey)
{
InitRegistryKey(registryHive, subKey);
} /// <summary>
/// Disposes this object.
/// </summary>
public void Dispose()
{
Stop();
_disposed = true;
GC.SuppressFinalize(this);
} /// <summary>
/// Gets or sets the <see cref="RegChangeNotifyFilter">RegChangeNotifyFilter</see>.
/// </summary>
public RegChangeNotifyFilter RegChangeNotifyFilter
{
get { return _regFilter; }
set
{
lock (_threadLock)
{
if (IsMonitoring)
throw new InvalidOperationException("Monitoring thread is already running"); _regFilter = value;
}
}
}
#region Initialization private void InitRegistryKey(RegistryHive hive, string name)
{
switch (hive)
{
case RegistryHive.ClassesRoot:
_registryHive = HKEY_CLASSES_ROOT;
break; case RegistryHive.CurrentConfig:
_registryHive = HKEY_CURRENT_CONFIG;
break; case RegistryHive.CurrentUser:
_registryHive = HKEY_CURRENT_USER;
break; case RegistryHive.DynData:
_registryHive = HKEY_DYN_DATA;
break; case RegistryHive.LocalMachine:
_registryHive = HKEY_LOCAL_MACHINE;
break; case RegistryHive.PerformanceData:
_registryHive = HKEY_PERFORMANCE_DATA;
break; case RegistryHive.Users:
_registryHive = HKEY_USERS;
break; default:
throw new InvalidEnumArgumentException("hive", (int)hive, typeof (RegistryHive));
}
_registrySubName = name;
} private void InitRegistryKey(string name)
{
string[] nameParts = name.Split('\\'); switch (nameParts[0])
{
case "HKEY_CLASSES_ROOT":
case "HKCR":
_registryHive = HKEY_CLASSES_ROOT;
break; case "HKEY_CURRENT_USER":
case "HKCU":
_registryHive = HKEY_CURRENT_USER;
break; case "HKEY_LOCAL_MACHINE":
case "HKLM":
_registryHive = HKEY_LOCAL_MACHINE;
break; case "HKEY_USERS":
_registryHive = HKEY_USERS;
break; case "HKEY_CURRENT_CONFIG":
_registryHive = HKEY_CURRENT_CONFIG;
break; default:
_registryHive = IntPtr.Zero;
throw new ArgumentException("The registry hive '" + nameParts[0] + "' is not supported", "value");
} _registrySubName = String.Join("\\", nameParts, 1, nameParts.Length - 1);
}
#endregion /// <summary>
/// <b>true</b> if this <see cref="RegistryMonitor"/> object is currently monitoring;
/// otherwise, <b>false</b>.
/// </summary>
public bool IsMonitoring
{
get { return _thread != null; }
} /// <summary>
/// Start monitoring.
/// </summary>
public void Start()
{
if (_disposed)
throw new ObjectDisposedException(null, "This instance is already disposed");
lock (_threadLock)
{
if (!IsMonitoring)
{
_eventTerminate.Reset();
_thread = new Thread(new ThreadStart(MonitorThread));
_thread.IsBackground = true;
_thread.Start();
}
}
} /// <summary>
/// Stops the monitoring thread.
/// </summary>
public void Stop()
{
if (_disposed)
throw new ObjectDisposedException(null, "This instance is already disposed");
lock (_threadLock)
{
Thread thread = _thread;
if (thread != null)
{
_eventTerminate.Set();
thread.Join();
}
}
} private void MonitorThread()
{
try
{
ThreadLoop();
}
catch (Exception e)
{
OnError(e);
}
_thread = null;
} private void ThreadLoop()
{
IntPtr registryKey;
int result = RegOpenKeyEx(_registryHive, _registrySubName, 0, STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_NOTIFY,
out registryKey);
if (result != 0)
throw new Win32Exception(result); try
{
AutoResetEvent _eventNotify = new AutoResetEvent(false);
WaitHandle[] waitHandles = new WaitHandle[] {_eventNotify, _eventTerminate};
while (!_eventTerminate.WaitOne(0, true))
{
result = RegNotifyChangeKeyValue(registryKey, true, _regFilter, _eventNotify.Handle, true);
if (result != 0)
throw new Win32Exception(result); if (WaitHandle.WaitAny(waitHandles) == 0)
{
OnRegChanged();
}
}
}
finally
{
if (registryKey != IntPtr.Zero)
{
RegCloseKey(registryKey);
}
}
}
}
/// <summary>
/// Filter for notifications reported by <see cref="RegistryMonitor"/>.
/// </summary>
[Flags]
public enum RegChangeNotifyFilter
{
/// <summary>Notify the caller if a subkey is added or deleted.</summary>
Key = 1,
/// <summary>Notify the caller of changes to the attributes of the key,
/// such as the security descriptor information.</summary>
Attribute = 2,
/// <summary>Notify the caller of changes to a value of the key. This can
/// include adding or deleting a value, or changing an existing value.</summary>
Value = 4,
/// <summary>Notify the caller of changes to the security descriptor
/// of the key.</summary>
Security = 8,
}
}
❸ 有什麼辦法可以監控注冊表的改動
regshot、regmon或regsnap等軟體是可以監視注冊表變化的工具,通過它們可以了解、監視應用程序在注冊表中的動作,利用它們可以監視應用程序在注冊表中的變化。
❹ 如何監控注冊表及文件
卡巴斯基殺毒軟體里的主動防禦共嫩能夠就是注冊表監控和防護用的,還好用,可以試一下.此外,瑞星專殺里有注冊表的修復軟體
❺ 哪一款的注冊表實時監控比較好
Regmon注冊表監視實用工具,可以顯示哪些應用程序正在訪問注冊表、這些應用程序正版在訪問哪權些注冊表項以及這些應用程序正在讀取和寫入的注冊表數據,所有這些都是實時的點此下載Process Monitor Process Monitor 是一個用於 Windows 的高級監視工具,可以顯示實時文件系統、注冊表和進程/線程活動。它結合了兩個傳統 Sysinternals 實用工具(Filemon 和 Regmon) 的功能,並增加了大量增強功能,其中包括豐富且不具破壞性的篩選功能、全面的事件屬性(如會話 ID 和用戶名)、可靠的進程信息、完整的線程堆棧(支持每個操作的集成符號)、同一文件並行日誌記錄等功能。異常強大的功能使 Process Monitor 成為系統故障排除和惡意軟體捕獲工具包的核心實用工具。點此下載
❻ 有什麼辦法能監控或者檢測到注冊表新增的內容嗎
regsnap這個可以的哦
Advanced Registry Tracer這個也可以的噻(Advanced Registry Tracer (ART)是一個用來跟蹤Windows注冊表變內化的工具軟體容。 當安裝軟體的時候,您可以在安裝軟體之前使用 ART 製作一個注冊表的拷貝,在安裝之後再製作另一個拷貝。然後您就可以通過比較來看新增的內容了)
試試看
❼ 請推薦一個好的注冊表監視的軟體
Regmon(Registry Monitor
)是一個出色的注冊表資料庫監視軟體,它將與注冊表資料庫相關的一切操作(如讀取、修改、出錯信息等)全部記錄下來以供用戶參考,並允許用戶對記錄的信息進行保存、過濾、查找等處理,這就為用戶對系統的維護提供了極大的便利。Regmon的使用非常簡單,我們只需運行該程序即可啟動它的系統監視功能,自動將系統對注冊表資料庫的讀取、修改等操作逐筆記錄下來,此後我們就可以憑借它所做的記錄從事有關系統維護操作了。具體來說,Regmon所做的記錄非常全面,我們可利用它完成許多系統設置工作。如,Windows 98在開始菜單上新增了一個名為「收藏夾」的子菜單,它主要針對網路用戶,對未上網的用戶而言沒有多大實用價值,因此這部分用戶就希望能取消開始菜單中的「收藏夾」子菜單。為此,我們可事先啟動Regmon,激活其注冊表資料庫的監視功能,然後啟動TweakUI等軟體,利用它們的設置功能取消Windows 9X的「收藏夾」子菜單。切換回Regmon之後,我們就可以從它所做的記錄中,發現TweakUI是通過將注冊表資料庫「HKEY_CURRENT_USER\Software \Microsoft \Windows \CurrentVersion \Policies \Explorer」主鍵下的「NoFavoritesMenu」的「dword」值由0改為1來達到取消「收藏夾」子菜單的目的。再如,當我們在安裝某些不具備自動卸載功能的應用軟體並手工將其刪除之後,該程序就會在注冊表資料庫中留下一些殘余信息,從而影響系統的安全運行,手工修改也比較困難,而利用Regmon則可輕易解決這一問題。我們只需在安裝有關軟體之前先行啟動Regmon程序,將該軟體在安裝過程中對注冊表資料庫的修改全部記錄下來,然後在卸載該程序時再手工清除注冊表資料庫中的殘余信息即可,從而滿足了用戶的需要,提高了系統的安全性。
需要說明的是,預設情況下Regmon會同時對注冊表資料庫的讀取、修改、錯誤信息等內容進行監視,其中後兩項的監視當然是非常必要的,但對讀取功能的監視卻值得商討。其實我們可採取平常不對讀取操作進行監視,以加快系統運行速度,而在某些特殊情況下再臨時打開讀取監視功能,以充分發揮Regmon監視作用的變通方法。為此,我們只需執行「Events」菜單的「Filter」命令,打開「Regmon Filter」設置框,然後取消「Log reads」選項即可。另外,我們還可以利用「Regmon Filter」設置框對監視過程、路徑范圍、監視的級別層次等選項加以設置,以便更好地滿足日常操作的需要。
從上面的介紹中可以看出,充分利用Regmon的注冊表資料庫監視功能對於簡化我們對系統的維護操作、提高系統運行效率是非常有利的,況且它還是一個免費軟體!怎麼樣?趕快到(在MYDOWN下載)下載一個試試吧!
❽ 什麼軟體可以監控注冊表
Regshot (注冊表監視復比較工具) V2.0.1.66 綠色免制費版 ]
RegShot是個小巧的注冊表靜態比較工具,它能快速地幫助您發現注冊表的變化,甚至通過掃描硬碟來讓您掌握硬碟上某些文件夾[或是整個硬碟]的改變! [因為越來越多的可疑軟體將自己的"腳印"留在您硬碟中最不顯眼的地方]。在最新的版本中它還可以通過動態監控注冊表[Windows9x平台]來輔助分析。所有的比較結果輸出為詳細的純文本格式或HTML格式的文檔。
❾ 想要一個可以監控注冊表的軟體.!!
注冊表監控軟體
在BAIDU 搜一下 多得很,至於哪個好用 就看你選擇了回!
去這個地址看答下
http://www..com/s?wd=%D7%A2%B2%E1%B1%ED%BC%E0%BF%D8%C8%ED%BC%FE&cl=3
❿ Process Monitor監控進程操作注冊表如何實現
如題,假如我要安裝一個軟體,我想知道安裝過程中他都在注冊表裡面加了些什麼東西回?(具體到鍵答)
有能夠監測的軟體嗎?或者有什麼別的方法可以找出來?
最好功能針對某制定程序,因為我經常安裝了一些軟體後卻不知道它對我的電腦做了什麼事