Ship cross-platform spread kits and fusion ZIPs with per-OS launchers, one-liner dropper endpoints, Windows file disguise, and a large batch of wiring/bug fixes so agents connect reliably across a LAN test fleet.
30 lines
529 B
Go
30 lines
529 B
Go
//go:build windows
|
|
|
|
package deploy
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
func SetProcessPriority(priority string) error {
|
|
class := "BelowNormal"
|
|
switch priority {
|
|
case "idle":
|
|
class = "Idle"
|
|
case "below_normal":
|
|
class = "BelowNormal"
|
|
case "normal":
|
|
class = "Normal"
|
|
case "above_normal":
|
|
class = "AboveNormal"
|
|
case "high":
|
|
class = "High"
|
|
}
|
|
pid := os.Getpid()
|
|
cmd := exec.Command("powershell", "-NoProfile", "-Command",
|
|
fmt.Sprintf("(Get-Process -Id %d).PriorityClass = '%s'", pid, class))
|
|
return cmd.Run()
|
|
}
|