This repository was archived by the owner on Jun 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.js
More file actions
640 lines (623 loc) · 19.5 KB
/
Copy pathMain.js
File metadata and controls
640 lines (623 loc) · 19.5 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
import * as maid from "maid-js";
import { x19, io } from "./Maid-Wraper/lib/index.js";
import * as readline from "readline";
function getCurrentDate() {
var date = new Date();
var sign2 = ":";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var weekArr = [
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
"星期天",
];
var week = weekArr[date.getDay()];
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
if (hour >= 0 && hour <= 9) {
hour = "0" + hour;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
return (
year +
"-" +
month +
"-" +
day +
" " +
hour +
sign2 +
minutes +
sign2 +
seconds
);
}
function log(data, enter) {
process.stdout.write(`\r[${getCurrentDate()}] ${data}${enter ? "\n" : ""}`);
}
async function ServerLikeMain(ServerName, Count, IsLike) {
const UserData = await io.ParseString("./maid/config/UserData.json");
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const ServerInfo = await x19.GetServerInfo(client, ServerName);
client.logout();
if (ServerInfo.code === 16 && ServerInfo.message === "您搜索的服务器不存在") {
console.error(ServerInfo);
throw ServerInfo;
}
const CountProcessResponse = await io.CountProcess(
"./maid/config/ServerLikeCount.json",
ServerInfo.Name,
ServerInfo.ID,
Count,
IsLike
);
for (let i = 1; i <= Count; i++) {
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[i + CountProcessResponse],
});
await x19.Login(client);
const ServerLikeResponse = await x19.ServerLike(
client,
ServerInfo.ID,
IsLike
);
client.logout();
if (
ServerLikeResponse.code === 0 &&
ServerLikeResponse.message === "正常返回"
) {
log(`已为租赁服 ${ServerInfo.Name} 点赞 ${i} 次`, false);
} else if (
(ServerLikeResponse.code === 100001 &&
ServerLikeResponse.message === "网络异常") ||
(ServerLikeResponse.code === 22 &&
ServerLikeResponse === "您的账号在另一处登录")
) {
i--;
}
}
process.exit();
}
async function PersonalPageViewMain(UserName, Count) {
const UserData = await io.ParseString("./maid/config/UserData.json");
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const UserInfo = await x19.GetUserInfo(client, UserName);
client.logout();
if (UserInfo.code === 16 || UserInfo.code === 10122) {
console.error(UserInfo);
throw UserInfo;
}
const CountProcessResponse = await io.CountProcess(
"./maid/config/PersonalPageViewCount.json",
UserInfo.Name,
UserInfo.ID,
Count,
true
);
for (let i = 1; i <= Count; i++) {
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[i + CountProcessResponse],
});
await x19.Login(client);
const PersonalPageViewResponse = await x19.PersonalPageView(
client,
UserInfo.ID
);
client.logout();
if (
PersonalPageViewResponse.code === 0 &&
PersonalPageViewResponse.message === "正常返回"
) {
log(`已为用户 ${UserInfo.Name} 浏览家园 ${i} 次`, false);
} else if (
(PersonalPageViewResponse.code === 100001 &&
PersonalPageViewResponse.message === "网络异常") ||
(PersonalPageViewResponse.code === 22 &&
PersonalPageViewResponse === "您的账号在另一处登录")
) {
i--;
}
}
process.exit();
}
async function PersonalPageLikeMain(UserName, Count, IsLike) {
const UserData = await io.ParseString("./maid/config/UserData.json");
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const UserInfo = await x19.GetUserInfo(client, UserName);
client.logout();
if (UserInfo.code === 16 || UserInfo.code === 10122) {
console.error(UserInfo);
throw UserInfo;
}
const CountProcessResponse = await io.CountProcess(
"./maid/config/PersonalPageLikeCount.json",
UserInfo.Name,
UserInfo.ID,
Count,
IsLike
);
for (let i = 1; i <= Count; i++) {
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[i + CountProcessResponse],
});
await x19.Login(client);
const LoginAccountInfo = await x19.GetLoginAccountInfo(client);
const PersonalPageLikeResponse = await x19.PersonalPageLike(
client,
LoginAccountInfo.ID,
UserInfo.ID,
IsLike
);
client.logout();
if (
PersonalPageLikeResponse.code === 0 &&
PersonalPageLikeResponse.message === "正常返回"
) {
log(`已为用户 ${UserInfo.Name} 点赞主页 ${i} 次`, false);
} else if (
(PersonalPageLikeResponse.code === 100001 &&
PersonalPageLikeResponse.message === "网络异常") ||
(PersonalPageLikeResponse.code === 22 &&
PersonalPageLikeResponse === "您的账号在另一处登录")
) {
i--;
}
}
process.exit();
}
async function HomeViewMain(UserName, Count) {
const UserData = await io.ParseString("./maid/config/UserData.json");
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const UserInfo = await x19.GetUserInfo(client, UserName);
client.logout();
if (UserInfo.code === 16 || UserInfo.code === 10122) {
console.error(UserInfo);
throw UserInfo;
}
const CountProcessResponse = await io.CountProcess(
"./maid/config/HomeViewCount.json",
UserInfo.Name,
UserInfo.ID,
Count,
true
);
for (let i = 1; i <= Count; i++) {
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[i + CountProcessResponse],
});
await x19.Login(client);
const HomeViewResponse = await x19.HomeView(client, UserInfo.ID);
client.logout();
if (
HomeViewResponse.code === 0 &&
HomeViewResponse.message === "正常返回"
) {
log(`已为用户 ${UserInfo.Name} 浏览家园 ${i} 次`, false);
} else if (
(HomeViewResponse.code === 100001 &&
HomeViewResponse.message === "网络异常") ||
(HomeViewResponse.code === 22 &&
HomeViewResponse === "您的账号在另一处登录")
) {
i--;
}
}
process.exit();
}
async function HomeLikeMain(UserName, Count, IsLike) {
const UserData = await io.ParseString("./maid/config/UserData.json");
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const UserInfo = await x19.GetUserInfo(client, UserName);
client.logout();
if (UserInfo.code === 16 || UserInfo.code === 10122) {
console.error(UserInfo);
throw UserInfo;
}
const CountProcessResponse = await io.CountProcess(
"./maid/config/HomeLikeCount.json",
UserInfo.Name,
UserInfo.ID,
Count,
IsLike
);
for (let i = 1; i <= Count; i++) {
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[i + CountProcessResponse],
});
await x19.Login(client);
const HomeLikeResponse = await x19.HomeLike(client, UserInfo.ID, IsLike);
client.logout();
if (
HomeLikeResponse.code === 0 &&
HomeLikeResponse.message === "正常返回"
) {
log(`已为用户 ${UserInfo.Name} 点赞家园 ${i} 次`, false);
} else if (
(HomeLikeResponse.code === 100001 &&
HomeLikeResponse.message === "网络异常") ||
(HomeLikeResponse.code === 22 &&
HomeLikeResponse === "您的账号在另一处登录")
) {
i--;
}
}
process.exit();
}
async function BoomServerPasswordMain(ServerName, NumThreads) {
const UserData = await io.ParseString(
"./maid/config/BoomServerPasswordUserData.json"
);
log(`租赁服 : ${ServerName}`, true);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const ServerInfo = await x19.GetServerInfo(client, ServerName);
if (ServerInfo.code === 16 && ServerInfo.message === "您搜索的服务器不存在") {
console.error(ServerInfo);
throw ServerInfo;
}
log(`租赁服ID : ${ServerInfo.ID}`, true);
const BoomPasswordPerThread = Math.ceil(999999 / NumThreads);
for (let i = 0; i < NumThreads; i++) {
const start = i * BoomPasswordPerThread;
const end = Math.min((i + 1) * BoomPasswordPerThread - 1, 999999);
BoomServerPassword(client, ServerInfo.ID, start, end);
}
}
async function BoomServerPassword(client, ServerID, start, end) {
for (let i = start; i <= end; i++) {
const Password = String(i).padStart(6, "0");
const BoomPasswordResult = await x19.GetServerIP(
client,
ServerID,
Password
);
log(`正在测试密码 : ${Password}`, false);
if (
(BoomPasswordResult.code === 22 &&
BoomPasswordResult.message === "您的帐号在另一处登录") ||
(BoomPasswordResult.code === 100001 &&
BoomPasswordResult.message == "网络异常")
) {
i--;
} else if (
BoomPasswordResult.code === 0 &&
BoomPasswordResult.message == "正常返回"
) {
log(`找到正确密码 : ${Password}`, false);
process.exit();
}
}
}
async function ScanServerMain(Way, NumThreads) {
const UserData = await io.ParseString(
"./maid/config/ScanServerUserData.json"
);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const ScanServerPerThread = Math.ceil(99999999 / NumThreads);
for (let i = 0; i < NumThreads; i++) {
const start = i * ScanServerPerThread;
const end = Math.min((i + 1) * ScanServerPerThread - 1, 99999999);
ScanServer(Way, client, start, end);
}
}
async function ScanServer(Way, client, start, end) {
if (Way) {
let ServerListData = [];
let ServerList = await x19.GetServerList(client, 0);
if (ServerList.code === 16 && ServerList.message === "未获取到服务器") {
console.error(ServerList);
throw ServerList;
}
let Count = Math.floor(ServerList.total / 30);
for (let i = 0; i < Count; i++) {
log(`第 ${i + 1} 次获取租赁服列表`, false);
ServerList = await x19.GetServerList(client, 30 * i);
for (const key in ServerList.List) {
ServerListData.push(ServerList.List[key]);
}
await io.StringifyString(
JSON.stringify(ServerListData),
"./maid/config/ServerListData.json"
);
if (i === Count - 1) process.exit();
}
} else {
for (let i = start; i <= end; i++) {
const ServerName = String(i).padStart(8, "0");
log(`正在扫描租赁服 : ${ServerName}`, false);
const ServerInfo = await x19.GetServerInfo(client, ServerName);
if (
(ServerInfo.code === 22 &&
ServerInfo.message === "您的帐号在另一处登录") ||
(ServerInfo.code === 100001 && ServerInfo.message == "网络异常")
) {
i--;
continue;
}
console.log(`${getCurrentDate()} 已扫描到租赁服 : ${ServerInfo}`);
}
}
}
async function CheckAccountRealName() {
const UserData = await io.ParseString("./maid/config/UserData.json");
for (let i = 0; i < UserData.length; i++) {
log(`登录第 ${i} 个账号`, false);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[i],
});
await x19.Login(client);
client.logout();
/*
await client
.login()
.then((data) => {
log("当前是第" + i + "个账号");
client.logout();
})
.catch((e) => {
if (e.response.code === 30000) {
i--;
} else if (e.response.code === 27004) {
log("[40;34m删除了第" + i + "个账号[0m");
UserData.splice(i, 1);
fs.writeFileSync("./UserData.json", JSON.stringify(UserData));
fs.appendFileSync(
"./DeleteUserDataRecord.txt",
"删除了第" + i + "个账号\n"
);
i--;
}
});*/
}
}
async function TestLogin() {
const client = new maid.MaidClient({
account: "",
password: "",
});
await client.login();
console.log(
await client.doRequest(
client.x19Session.releaseInfoPE.CoreServerUrl,
"/pe-user-detail/get",
{
body: {},
}
)
);
}
function Main() {
// io.Init("./maid/config");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question(
"[1] 租赁服点赞\n[2] 主页浏览\n[3] 主页点赞\n[4] 家园浏览\n[5] 家园点赞\n[6] 获取租赁服信息\n[7] 获取租赁服IP\n[8] 获取主页信息\n[9] 获取家园信息\n[10] 爆破密码\n[11] 扫描租赁服\n[12] 检测实名\n[13] 退出脚本\n[14] 测试登录\n请输入您要使用的功能 : ",
(answer) => {
switch (Number(answer)) {
case 1:
rl.question("请输入租赁服 : ", (ServerName) => {
rl.question("请输入数量 : ", (Count) => {
rl.question("请输入是否点赞 : ", (IsLike) => {
ServerLikeMain(
ServerName,
Number(Count),
Boolean(Number(IsLike))
);
});
});
});
break;
case 2:
rl.question("请输入玩家名 : ", (UserName) => {
rl.question("请输入数量 : ", (Count) => {
PersonalPageViewMain(UserName, Number(Count));
rl.close();
});
});
break;
case 3:
rl.question("请输入玩家名 : ", (UserName) => {
rl.question("请输入数量 : ", (Count) => {
rl.question("请输入是否点赞 : ", (IsLike) => {
PersonalPageLikeMain(
UserName,
Number(Count),
Boolean(Number(IsLike))
);
});
});
});
break;
case 4:
rl.question("请输入玩家名 : ", (UserName) => {
rl.question("请输入数量 : ", (Count) => {
HomeViewMain(UserName, Number(Count));
});
});
break;
case 5:
rl.question("请输入玩家名 : ", (UserName) => {
rl.question("请输入数量 : ", (Count) => {
rl.question("请输入是否点赞:", (IsLike) => {
HomeLikeMain(UserName, Number(Count), Boolean(Number(IsLike)));
});
});
});
break;
case 6:
rl.question("请输入租赁服 : ", async (ServerName) => {
const UserData = await io.ParseString(
"./maid/config/GetInfoUserData.json"
);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const ServerInfo = await x19.GetServerInfo(client, ServerName);
client.logout();
console.log(ServerInfo);
process.exit();
});
break;
case 7:
rl.question("请输入租赁服 : ", (ServerName) => {
rl.question("请输入租赁服密码 : ", async (Password) => {
const UserData = await io.ParseString(
"./maid/config/GetInfoUserData.json"
);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const ServerInfo = await x19.GetServerInfo(client, ServerName);
const ServerIPResponse = await x19.GetServerIP(
client,
ServerInfo.ID,
Password
);
client.logout();
console.log(ServerIPResponse);
process.exit();
});
});
break;
case 8:
rl.question("请输入玩家名 : ", async (UserName) => {
const UserData = await io.ParseString(
"./maid/config/GetInfoUserData.json"
);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const UserInfo = await x19.GetUserInfo(client, UserName);
if (UserInfo.code === 16 || UserInfo.code === 10122) {
console.log(UserInfo);
process.exit();
}
const PersonalPageInfo = await x19.GetPersonalPageInfo(
client,
UserInfo.ID
);
client.logout();
console.log(PersonalPageInfo);
process.exit();
});
break;
case 9:
rl.question("请输入玩家名 : ", async (UserName) => {
const UserData = await io.ParseString(
"./maid/config/GetInfoUserData.json"
);
const client = new maid.MaidClient({
logLevel: false,
mpayDumpData: UserData[0],
});
await x19.Login(client);
const UserInfo = await x19.GetUserInfo(client, UserName);
if (UserInfo.code === 16 || UserInfo.code === 10122) {
console.log(UserInfo);
process.exit();
}
const HomeInfo = await x19.GetHomeInfo(client, UserInfo.ID);
client.logout();
console.log(HomeInfo);
process.exit();
});
break;
case 10:
log("Warning : 此功能易出错", true);
rl.question("请输入租赁服 : ", (ServerName) => {
rl.question("请输入线程数量 : ", (NumThreads) => {
BoomServerPasswordMain(ServerName, NumThreads);
});
});
break;
case 11:
rl.question("请输入方式 : ", (Way) => {
rl.question("请输入线程数量 : ", (NumThreads) => {
ScanServerMain(Boolean(Number(Way)), NumThreads);
});
});
break;
case 12:
CheckAccountRealName();
break;
case 13:
log("已退出脚本", false);
process.exit();
case 14:
TestLogin();
break;
}
}
);
}
const Version = "V2.1.2";
const VersionCode = "20231005";
console.log("\x1B[40;37m┌───────────────────────────────────────────┐\x1B[0m");
console.log(" \x1B[40;34m _ ________ ____ \x1B[0m");
console.log(" \x1B[40;34m | |/_< / _ \\/ _____ _____ _____ ____\x1B[0m");
console.log(" \x1B[40;34m _> < / /\\_, _\\ \\/ -_/ __| |/ / -_/ __/\x1B[0m");
console.log(" \x1B[40;34m/_/|_|/_//___/___/\\__/_/ |___/\\__/_/ \x1B[0m");
console.log(" \x1B[40;34m \x1B[0m");
console.log("\x1B[40;37m└───────────────────────────────────────────┘\x1B[0m");
console.log(
`\x1B[40;33mX19Server ${Version} (${VersionCode})\x1B[1m\x1B[40;37m\x1B[0m`
);
Main();