更新若干功能

This commit is contained in:
李琦
2026-08-14 07:52:01 +08:00
parent 153c7ed448
commit 89bc265f68
196 changed files with 17675 additions and 0 deletions

19
machineid_windows.go Normal file
View File

@@ -0,0 +1,19 @@
//go:build windows
package main
import "golang.org/x/sys/windows/registry"
// rawMachineID 读取 Windows 的 MachineGuid系统安装时生成重装才会变
func rawMachineID() string {
k, e := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Cryptography`, registry.QUERY_VALUE|registry.WOW64_64KEY)
if e != nil {
return ""
}
defer k.Close()
v, _, e := k.GetStringValue("MachineGuid")
if e != nil {
return ""
}
return v
}