Retrieve the Linked Modules of a process
// dwProcessID is the ID of the desired process HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessID);
MODULEENTRY32 module; module.dwSize = sizeof(module); if (Module32First(hSnapshot, &module)) // Find first module { do { // module.th32ModuleID is the ID of this module (not really useful) // module.szModule is the module's filename // module.szExePath is the full path of the module // module.modBaseAddr is the base address (In memory) of the module // module.GlbcntUsage is the global usage count for this module (How many times it is used across the system) // module.ProccntUsage is the process usage count for this module // module.modBaseSize is the memory occupied by the module in memory } while(Module32Next(hSnapshot, &module)); // Continue... } CloseHandle(hSnapshot); // Clean up |