Update loadup.hpp

master
xerox 5 years ago
parent 5d8a8721d5
commit 584b3b0d44

@ -266,12 +266,15 @@ namespace driver
RtlInitAnsiString(&driver_rep_path_cstr, reg_path.c_str());
RtlAnsiStringToUnicodeString(&driver_reg_path_unicode, &driver_rep_path_cstr, true);
const auto unload_drv = !reinterpret_cast<nt_unload_driver_t>(lp_nt_unload_drv)(&driver_reg_path_unicode);
const auto image_path = util::get_service_image_path(service_name);
const auto delete_image = std::filesystem::remove(image_path);
const auto delete_reg = util::delete_service_entry(service_name);
return unload_drv && delete_reg && delete_reg;
const bool unload_drv = !reinterpret_cast<nt_unload_driver_t>(lp_nt_unload_drv)(&driver_reg_path_unicode);
const auto image_path = std::filesystem::temp_directory_path().string() + service_name;
const bool delete_reg = util::delete_service_entry(service_name);
try
{
const bool delete_drv = std::filesystem::remove(image_path);
}
catch (std::exception& e) {}
return unload_drv && delete_reg;
}
return false;
}

Loading…
Cancel
Save