MCPcopy Create free account
hub / github.com/TideSec/GoBypassAV / physicalMemory

Function physicalMemory

SandBox/main.go:76–87  ·  view source on GitHub ↗

3、物理内存大小

()

Source from the content-addressed store, hash-verified

74}
75// 3、物理内存大小
76func physicalMemory() (int, error) {
77 var mod = syscall.NewLazyDLL("kernel32.dll")
78 var proc = mod.NewProc("GetPhysicallyInstalledSystemMemory")
79 var mem uint64
80 proc.Call(uintptr(unsafe.Pointer(&mem)))
81 mem = mem / 1048576
82 //fmt.Printf("物理内存为%dG\n", mem)
83 if mem < 4 {
84 return 0, nil // 小于4GB返回0
85 }
86 return 1, nil // 大于4GB返回1
87}
88
89func numberOfCPU() (int, error) {
90 a := runtime.NumCPU()

Callers 1

check_sandboxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected