-
-
Save tiborvass/d3d4758893f3f5761cd8 to your computer and use it in GitHub Desktop.
Detect on Windows if virtualization is enabled in the BIOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"syscall" | |
) | |
func main() { | |
var mod = syscall.NewLazyDLL("kernel32.dll") | |
var proc = mod.NewProc("IsProcessorFeaturePresent") | |
var PF_VIRT_FIRMWARE_ENABLED = 21 | |
ret, _, _ := proc.Call( | |
uintptr(PF_VIRT_FIRMWARE_ENABLED), | |
) | |
fmt.Printf("Return: %d\n", ret) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment