dwRes);for (int i = 0; i (dwRes / sizeof(HMODULE)); i++ ){WC

时间:2021-10-30 05:36:40

标签:

HMODULE hModule[1024]; DWORD dwRes; HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,FALSE,GetCurrentProcessId()); //获取的是当前进程ID EnumProcessModules(hProcess,hModule,sizeof(hModule),&dwRes); for (int i = 0; i < (dwRes / sizeof(HMODULE)); i++ ) { WCHAR wzName[MAX_PATH] = {0}; if(GetModuleFileNameEx(hProcess, hModule[i], wzName,sizeof(wzName)/sizeof(TCHAR))) { wprintf(_T("%d %x %s \r\n"),i,hModule[i],wzName); } } CloseHandle(hProcess);

dwRes);for (int i = 0; i (dwRes / sizeof(HMODULE)); i++ ){WC

【API】获取进程的所有模块名