Skip to content

Instantly share code, notes, and snippets.

@tiborvass
Forked from dave-tucker/win32test.go
Last active January 8, 2018 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiborvass/d3d4758893f3f5761cd8 to your computer and use it in GitHub Desktop.
Save tiborvass/d3d4758893f3f5761cd8 to your computer and use it in GitHub Desktop.
Detect on Windows if virtualization is enabled in the BIOS
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