fixed persistence error and error with clients sometimes not showing up as connected.

This commit is contained in:
KingKDot
2026-03-08 16:08:04 -05:00
parent ef0ca2994f
commit ed32444495
4 changed files with 44 additions and 2 deletions
@@ -0,0 +1,23 @@
//go:build windows
// +build windows
package persistence
import "testing"
func TestFormatRunRegistryCommand_QuotesUnquotedPath(t *testing.T) {
in := `C:\Users\Test User\AppData\Roaming\Overlord\agent.exe`
got := formatRunRegistryCommand(in)
want := `"C:\Users\Test User\AppData\Roaming\Overlord\agent.exe"`
if got != want {
t.Fatalf("expected %q, got %q", want, got)
}
}
func TestFormatRunRegistryCommand_LeavesQuotedPath(t *testing.T) {
in := `"C:\Users\Test User\AppData\Roaming\Overlord\agent.exe"`
got := formatRunRegistryCommand(in)
if got != in {
t.Fatalf("expected %q, got %q", in, got)
}
}