| 698 | } |
| 699 | |
| 700 | HMODULE Utils::Win32::Process::LoadModule(const std::filesystem::path& path) const { |
| 701 | auto pathBuf = path.wstring(); |
| 702 | pathBuf.resize(pathBuf.size() + 1, L'\0'); // ensure null terminated |
| 703 | |
| 704 | const auto rpszDllPath = WithVirtualAlloc(nullptr, MEM_COMMIT | MEM_RESERVE, PAGE_READONLY, std::span(pathBuf)); |
| 705 | CallRemoteFunction(LoadLibraryW, rpszDllPath, "LoadLibraryW"); |
| 706 | OutputDebugStringW(L"LoadLibraryW\n"); |
| 707 | return AddressOf(path); |
| 708 | } |
| 709 | |
| 710 | int Utils::Win32::Process::UnloadModule(HMODULE hModule) const { |
| 711 | return CallRemoteFunction(FreeLibrary, hModule, "FreeLibrary"); |
no outgoing calls
no test coverage detected