HANDLE iqvw64e_device_handle;
LONG WINAPI SimplestCrashHandler(EXCEPTION_POINTERS* ExceptionInfo)
{
if (ExceptionInfo && ExceptionInfo->ExceptionRecord)
Log(L"[!!] Crash at addr 0x" << ExceptionInfo->ExceptionRecord->ExceptionAddress << L" by 0x" << std::hex << ExceptionInfo->ExceptionRecord->ExceptionCode << std::endl);
else
Log(L"[!!] Crash" << std::endl);
if (iqvw64e_device_handle)
intel_driver::Unload(iqvw64e_device_handle);
return EXCEPTION_EXECUTE_HANDLER;
}
bool callbackExample(ULONG64* param1, ULONG64* param2, ULONG64 allocationPtr, ULONG64 allocationSize, ULONG64 mdlptr) {
UNREFERENCED_PARAMETER(param1);
UNREFERENCED_PARAMETER(param2);
UNREFERENCED_PARAMETER(allocationPtr);
UNREFERENCED_PARAMETER(allocationSize);
UNREFERENCED_PARAMETER(mdlptr);
Log("[+] Callback example called" << std::endl);
return true;
}
void load_driver()
{
iqvw64e_device_handle = intel_driver::Load();
NTSTATUS exitCode = 0;
if (!kdmapper::MapDriver(iqvw64e_device_handle, raw_image.data(), 0, 0, false, true, true, false, callbackExample, &exitCode)) {
Log(L"[-] Failed to map " << "annen" << std::endl);
intel_driver::Unload(iqvw64e_device_handle);
}
if (!intel_driver::Unload(iqvw64e_device_handle)) {
Log(L"[-] Warning failed to fully unload vulnerable driver " << std::endl);
}
Log(L"[+] success" << std::endl);
}