Reputation: 167
I am trying to install an unsigned driver that I got from an older embedded solution (winxp embedded), that I am currently reversing. I am installing and setting up the driver like the software does, however, with the driver being unsigned, I am unable to install it, at least programmatically.
Installation code:
std::cout << "Installing driver from " << this->driverPath << std::endl;
SC_HANDLE scManager = OpenSCManagerA(0, 0, 0xF003F);
if (!scManager) {
std::cout << "Failed to open SCManager" << std::endl;
return;
}
SC_HANDLE hService = CreateServiceA(scManager, this->serviceName, this->serviceName, 0xF01FF, 1, 3, 1, this->driverPath, 0, 0, 0, 0, 0);
if (!hService) {
hService = OpenServiceA(scManager, this->serviceName, 0xF01FF);
if (!hService) {
std::cout << "error: " << std::to_string(GetLastError()) << std::endl;
CloseServiceHandle(scManager);
return;
}
else {
std::cout << "OK!" << std::endl;
}
}
if (!StartServiceA(hService, 0, 0)) {
std::cout << "StartService failed: " << std::to_string(GetLastError()) << std::endl;
return;
}
The command line output based on this is as follows:
Installing driver from C:\driver.sys
OK!
StartService failed: 1275
The error code is that of ERROR_DRIVER_BLOCKED. I tried to force Windows to allow me to install this after all by going into advanced startup and disabling signature enforcement, but the only effect was that Windows no longer gave me a separate OS window telling me it blocked driver installation.
I have tried the three methods described here, without any luck: https://www.maketecheasier.com/install-unsigned-drivers-windows10/
(However, I assume these are made for users hand-installing the drivers).
How can I tell Windows to allow me to programmatically install this unsigned driver?
Upvotes: 0
Views: 761
Reputation: 167
The driver was 32-bit, the system was 64-bit. Using a 32-bit system solves this.
Upvotes: 0