MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GetKernelModuleByAddress

Method GetKernelModuleByAddress

WinSysCore/Helpers.cpp:207–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207std::string Helpers::GetKernelModuleByAddress(ULONG_PTR address) {
208 WinSys::KernelModuleTracker m_Tracker;
209
210 auto count = m_Tracker.EnumModules();
211 auto modules = m_Tracker.GetModules();
212 for (decltype(count) i = 0; i < count; i++) {
213 auto m = modules[i];
214 ULONG_PTR limit = (ULONG_PTR)((char*)m->ImageBase + m->ImageSize);
215 if (address > (ULONG_PTR)m->ImageBase && address < limit) {
216 return m->FullPath;
217 }
218 }
219
220 return "";
221}
222
223
224std::wstring Helpers::GetUserModuleByAddress(ULONG_PTR address, ULONG pid) {

Callers

nothing calls this directly

Calls 1

EnumModulesMethod · 0.45

Tested by

no test coverage detected