Mattiwatti / EfiGuard

Disable PatchGuard and Driver Signature Enforcement at boot time
GNU General Public License v3.0
1.78k stars 337 forks source link

Pre-boot custom code #34

Closed NexSqaud closed 3 years ago

NexSqaud commented 3 years ago

EfiGuard can patch a Windows, but can it run some code before run a Windows, and shutdown PC without "BSOD"? For example, password boot lock. And if yes, can you give a link to some documentation?

Mattiwatti commented 3 years ago

EfiGuard can patch a Windows

Yes...

but can it run some code before run a Windows

That's literally how it works. By executing code before Windows does. I think you need to be more precise about what you want here.

and shutdown PC without "BSOD"?

Do you want to execute code, shut down your PC, or both? And at what moment(s) should these actions take place? I get that you don't want it to BSOD, but I don't think that's really relevant for the question. If you were more specific (a lot more), I would be able to tell you whether EfiGuard can do what you want or not (i.e. 'yes' or 'no'). Whatever the question, I highly doubt that the answer is that EfiGuard can do it, but somehow only with an added BSOD.

For example, password boot lock

What kind lock? The firmware/BIOS password lock, a drive encryption (Bitlocker/Veracrypt/...) lock, or a Windows user password lock? And what is it that you want EfiGuard to do with this lock (or password)? Lock it? Unlock it? Find the password? In all cases the answer is almost certainly no.

And if yes, can you give a link to some documentation?

There is README.md. That is the only EfiGuard documentation there is. But it covers:

In my opinion the README is pretty thorough, and should answer most questions people may have about EfiGuard, and if not, point them to the right resources to find out for themselves.

In this case, I believe, from your vaguely worded questions regarding various entirely unrelated things, that you are

NexSqaud commented 3 years ago

Do you want to execute code, shut down your PC, or both?

Execute code and as result shutdown PC or run Windows.

What kind lock?

Just a lock on EfiGuard that blocks Windows from starting before correct password doesn't written. A BIOS/Firmware variant not suitable at my case.

Mattiwatti commented 3 years ago

Execute code and as result shutdown PC or run Windows.

A lock on EfiGuard that blocks Windows from starting before correct password doesn't written. A BIOS/Firmware variant not suitable at my case.

After several readings, I am now understanding this to mean: 'I want to execute some piece of code that blocks Windows from loading until the user enters a password. If the password is correct, continue booting Windows. If it is not, shut down the PC instead'. Or, in pseudocode:

void CheckAllowedToBootWindows()
{
    string Password = GetUserPasswordInput();
    if (!VerifyPassword(Password))
    {
        Shutdown();
    }
}

If this interpretation of your question is correct, the answer is yes, EfiGuard could do this (but it doesn't, because it clearly has nothing to do with what EfiGuard was written to do).

I have already told you what to do in this case in my previous reply, but here is the specific quote:

Move on to the 'how to compile EfiGuard' section and help yourself.

I'd feel more inclined to help you if your request/proposal wasn't of dubious value at best, and clearly indicative of malicious intent at worst.

A BIOS/Firmware variant not suitable at my case.

Then why are you asking this? What do you think UEFI is?

Reply not necessary, closing this.