예제 #1
0
void DetourNtdllForModule(HMODULE base)
{
  auto const& process = GetThisProcess();
  auto& module = GetNtdllModule();
  auto& helper = GetHelperInterface();
  if (helper.CommonDetourModule(process, L"ntdll", base, module))
  {
    DetourFunc(process,
               base,
               "NtMapViewOfSection",
               GetNtMapViewOfSectionDetour(),
               NtMapViewOfSectionDetour);
    DetourFunc(process,
               base,
               "NtUnmapViewOfSection",
               GetNtUnmapViewOfSectionDetour(),
               NtUnmapViewOfSectionDetour);
    DetourFunc(
      process, base, "LdrLoadDll", GetLdrLoadDllDetour(), LdrLoadDllDetour);
    DetourFunc(process,
               base,
               "LdrUnloadDll",
               GetLdrUnloadDllDetour(),
               LdrUnloadDllDetour);
  }
}
예제 #2
0
void UndetourNtdllForModule(bool remove)
{
  auto& module = GetNtdllModule();
  auto& helper = GetHelperInterface();
  if (helper.CommonUndetourModule(L"ntdll", module))
  {
    UndetourFunc(L"NtMapViewOfSection", GetNtMapViewOfSectionDetour(), remove);
    UndetourFunc(
      L"NtUnmapViewOfSection", GetNtUnmapViewOfSectionDetour(), remove);
    UndetourFunc(L"LdrLoadDll", GetLdrLoadDllDetour(), remove);
    UndetourFunc(L"LdrUnloadDll", GetLdrUnloadDllDetour(), remove);

    module = std::make_pair(nullptr, 0);
  }
}
예제 #3
0
파일: module.cpp 프로젝트: lvous/hadesmem
void UndetourNtUnmapViewOfSection()
{
  UndetourFunc(L"NtUnmapViewOfSection", GetNtUnmapViewOfSectionDetour(), true);
}