Get DLL names from a running process, maybe?
1 answer
Yes it is possible. You can use the class Process
. It has a property Modules
that lists all loaded modules.
For example, to display all processes and all modules on the console:
Process[] processes = Process.GetProcesses();
foreach(Process process in processes) {
Console.WriteLine("PID: " + process.Id);
Console.WriteLine("Name: " + process.Name);
Console.WriteLine("Modules:");
foreach(ProcessModule module in process.Modules) {
Console.WriteLine(module.FileName);
}
}
You can of course check Process.Id
for the PID you would like, etc.
For more information check out the documentation for this class: -
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx
Note. This code can break certain system processes that you will not have access to.
+5
source to share