修复Linux下无法工作 修复Forge支持关闭错误

This commit is contained in:
SerendipityR 2022-10-04 18:36:32 +08:00 committed by GitHub
parent 2fcb4affc4
commit fe60332448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 50 additions and 17 deletions

View File

@ -8,8 +8,9 @@ import cn.serendipityr.EndMinecraftPlusV2.VersionControl.AttackManager;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.ProtocolLibs; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.ProtocolLibs;
public class EndMinecraftPlusV2 { public class EndMinecraftPlusV2 {
public static String ver = "1.4.0"; public static String ver = "1.4.1";
public static Integer CfgVer = 4; public static Integer CfgVer = 4;
public static Boolean isLinux = false;
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("========================-Forked by SerendipityR-========================"); System.out.println("========================-Forked by SerendipityR-========================");
@ -17,7 +18,11 @@ public class EndMinecraftPlusV2 {
System.out.println(" Github发布页: https://github.com/SerendipityR-2022/EndMinecraftPlusV2"); System.out.println(" Github发布页: https://github.com/SerendipityR-2022/EndMinecraftPlusV2");
System.out.println(" EndMinecraftPlusV2 (Ver: " + ver + ")" + " is loading......"); System.out.println(" EndMinecraftPlusV2 (Ver: " + ver + ")" + " is loading......");
System.out.println("========================================================================"); System.out.println("========================================================================");
try {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - Forked by SerendipityR"); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - Forked by SerendipityR");
} catch (Throwable e) {
isLinux = true;
}
LogUtil.emptyLog(); LogUtil.emptyLog();
prepareConfig(); prepareConfig();
prepareProxy(); prepareProxy();

View File

@ -135,8 +135,13 @@ public class ConfigUtil {
CatAntiCheat = false; CatAntiCheat = false;
} }
if (!ForgeSupport) {
LogUtil.doLog(1, "ForgeSupport未开启CatAntiCheat相关功能已关闭。", null);
CatAntiCheat = false;
} else {
ForgeModList.put("catanticheat", "1.2.6"); ForgeModList.put("catanticheat", "1.2.6");
} }
}
RandomMAC = config.getBoolean("AdvancedSettings.MACChecker.RandomMAC"); RandomMAC = config.getBoolean("AdvancedSettings.MACChecker.RandomMAC");

View File

@ -37,7 +37,7 @@ public class AttackManager {
botAttack.start(); botAttack.start();
} }
} else { } else {
if (!MCForge.isAfterVersion1_13()) { if (!MCForge.isAfterVersion1_13() && ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "正在获取服务器上的Forge Mods...", "BotAttack"); LogUtil.doLog(0, "正在获取服务器上的Forge Mods...", "BotAttack");
modList = new MCForgeMOTD().pingGetModsList(ConfigUtil.AttackAddress, ConfigUtil.AttackPort, MCForge.getProtocolVersion()); modList = new MCForgeMOTD().pingGetModsList(ConfigUtil.AttackAddress, ConfigUtil.AttackPort, MCForge.getProtocolVersion());
LogUtil.doLog(0, "Mods: " + Arrays.toString(modList.keySet().toArray()), "BotAttack"); LogUtil.doLog(0, "Mods: " + Arrays.toString(modList.keySet().toArray()), "BotAttack");
@ -79,7 +79,7 @@ public class AttackManager {
attack.start(); attack.start();
} }
} else { } else {
if (!MCForge.isAfterVersion1_13()) { if (!MCForge.isAfterVersion1_13() && ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "正在获取服务器上的Forge Mods...", "DoubleAttack"); LogUtil.doLog(0, "正在获取服务器上的Forge Mods...", "DoubleAttack");
doubleModList = new MCForgeMOTD().pingGetModsList(ConfigUtil.AttackAddress, ConfigUtil.AttackPort, MCForge.getProtocolVersion()); doubleModList = new MCForgeMOTD().pingGetModsList(ConfigUtil.AttackAddress, ConfigUtil.AttackPort, MCForge.getProtocolVersion());
LogUtil.doLog(0, "Mods: " + Arrays.toString(doubleModList.keySet().toArray()), "DoubleAttack"); LogUtil.doLog(0, "Mods: " + Arrays.toString(doubleModList.keySet().toArray()), "DoubleAttack");

View File

@ -1,5 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.*; import cn.serendipityr.EndMinecraftPlusV2.Tools.*;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.AttackManager; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.AttackManager;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.ACProtocol.AnotherStarAntiCheat; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.ACProtocol.AnotherStarAntiCheat;
@ -205,7 +206,9 @@ public class BotAttack extends IAttack {
while (run) { while (run) {
for (String p: ProxyUtil.proxies) { for (String p: ProxyUtil.proxies) {
try { try {
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - BotAttack | 当前连接数: " + clients.size() + "个 | 失败次数: " + failed + "次 | 成功加入: " + joined + "次 | 当前存活: " + alivePlayers.size() + "个 | 点击验证: " + clickVerifies + "次 | 重进尝试: " + rejoin); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - BotAttack | 当前连接数: " + clients.size() + "个 | 失败次数: " + failed + "次 | 成功加入: " + joined + "次 | 当前存活: " + alivePlayers.size() + "个 | 点击验证: " + clickVerifies + "次 | 重进尝试: " + rejoin);
}
String[] _p = p.split(":"); String[] _p = p.split(":");
Proxy proxy = new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1]))); Proxy proxy = new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1])));

View File

@ -1,6 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.Tools.LogUtil; import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle; import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle;
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerJoinGamePacket; import com.github.steveice10.mc.protocol.packet.ingame.server.ServerJoinGamePacket;
import com.github.steveice10.packetlib.Client; import com.github.steveice10.packetlib.Client;
@ -32,7 +32,9 @@ public class DoubleAttack extends BotAttack {
if (recvPacket instanceof ServerJoinGamePacket) { if (recvPacket instanceof ServerJoinGamePacket) {
session.disconnect("Double Exploit - Connection Reset!"); session.disconnect("Double Exploit - Connection Reset!");
runTimes++; runTimes++;
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + ""); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + "");
} }
} }
} }
}

View File

@ -1,5 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.*; import cn.serendipityr.EndMinecraftPlusV2.Tools.*;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.*; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.*;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.ACProtocol.AnotherStarAntiCheat; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.ACProtocol.AnotherStarAntiCheat;
@ -248,7 +249,9 @@ public class NewBotAttack extends IAttack {
while (run) { while (run) {
for (String p: ProxyUtil.proxies) { for (String p: ProxyUtil.proxies) {
try { try {
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - BotAttack | 当前连接数: " + clients.size() + "个 | 失败次数: " + failed + "次 | 成功加入: " + joined + "次 | 当前存活: " + alivePlayers.size() + "个 | 点击验证: " + clickVerifies + "次 | 重进尝试: " + rejoin); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - BotAttack | 当前连接数: " + clients.size() + "个 | 失败次数: " + failed + "次 | 成功加入: " + joined + "次 | 当前存活: " + alivePlayers.size() + "个 | 点击验证: " + clickVerifies + "次 | 重进尝试: " + rejoin);
}
String[] _p = p.split(":"); String[] _p = p.split(":");
Proxy proxy = new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1]))); Proxy proxy = new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1])));

View File

@ -1,5 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.LogUtil; import cn.serendipityr.EndMinecraftPlusV2.Tools.LogUtil;
import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle; import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.ProtocolLibs; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.ProtocolLibs;
@ -37,9 +38,11 @@ public class NewDoubleAttack extends NewBotAttack {
} }
runTimes++; runTimes++;
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + ""); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + "");
} }
} }
}
protected void newHandlePacket(Session session, Packet recvPacket, String username) { protected void newHandlePacket(Session session, Packet recvPacket, String username) {
super.newHandlePacket(session, recvPacket, username); super.newHandlePacket(session, recvPacket, username);
@ -47,7 +50,9 @@ public class NewDoubleAttack extends NewBotAttack {
session.disconnect("Double Exploit - Connection Reset!"); session.disconnect("Double Exploit - Connection Reset!");
LogUtil.doLog(0, "Double Exploit - Connection Reset!", "DoubleAttack"); LogUtil.doLog(0, "Double Exploit - Connection Reset!", "DoubleAttack");
runTimes++; runTimes++;
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + ""); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + "");
} }
} }
} }
}

View File

@ -1,5 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.*; import cn.serendipityr.EndMinecraftPlusV2.Tools.*;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.AttackManager; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.AttackManager;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.ACProtocol.AnotherStarAntiCheat; import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.ACProtocol.AnotherStarAntiCheat;
@ -210,7 +211,9 @@ public class BotAttack extends IAttack {
while (run) { while (run) {
for (String p: ProxyUtil.proxies) { for (String p: ProxyUtil.proxies) {
try { try {
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - BotAttack | 当前连接数: " + clients.size() + "个 | 失败次数: " + failed + "次 | 成功加入: " + joined + "次 | 当前存活: " + alivePlayers.size() + "个 | 点击验证: " + clickVerifies + "次 | 重进尝试: " + rejoin); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - BotAttack | 当前连接数: " + clients.size() + "个 | 失败次数: " + failed + "次 | 成功加入: " + joined + "次 | 当前存活: " + alivePlayers.size() + "个 | 点击验证: " + clickVerifies + "次 | 重进尝试: " + rejoin);
}
String[] _p = p.split(":"); String[] _p = p.split(":");
Proxy proxy = new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1]))); Proxy proxy = new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1])));

View File

@ -1,5 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle; import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle;
import org.spacehq.mc.protocol.packet.ingame.server.ServerJoinGamePacket; import org.spacehq.mc.protocol.packet.ingame.server.ServerJoinGamePacket;
import org.spacehq.packetlib.Client; import org.spacehq.packetlib.Client;
@ -32,7 +33,9 @@ public class DoubleAttack extends BotAttack {
if (recvPacket instanceof ServerJoinGamePacket) { if (recvPacket instanceof ServerJoinGamePacket) {
session.disconnect("Double Exploit - Connection Reset!"); session.disconnect("Double Exploit - Connection Reset!");
runTimes++; runTimes++;
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + ""); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - DoubleAttack | 总连接数: " + totalTimes + "次 | 尝试分身: " + runTimes + "");
} }
} }
} }
}

View File

@ -1,12 +1,11 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.ConfigUtil; import cn.serendipityr.EndMinecraftPlusV2.Tools.ConfigUtil;
import cn.serendipityr.EndMinecraftPlusV2.Tools.LogUtil; import cn.serendipityr.EndMinecraftPlusV2.Tools.LogUtil;
import cn.serendipityr.EndMinecraftPlusV2.Tools.OtherUtils; import cn.serendipityr.EndMinecraftPlusV2.Tools.OtherUtils;
import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle; import cn.serendipityr.EndMinecraftPlusV2.Tools.SetTitle;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
@ -32,7 +31,9 @@ public class MotdAttack extends IAttack {
} }
while (true) { while (true) {
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - MotdAttack | 当前连接数: " + threads.size() + "个 | 发包次数: " + runTimes + "次 | 有效包数: " + successTimes + "次 | 错误次数: " + errorTimes); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - MotdAttack | 当前连接数: " + threads.size() + "个 | 发包次数: " + runTimes + "次 | 有效包数: " + successTimes + "次 | 错误次数: " + errorTimes);
}
if (this.attack_time > 0 && (System.currentTimeMillis() - this.starttime) / 1000 > this.attack_time) { if (this.attack_time > 0 && (System.currentTimeMillis() - this.starttime) / 1000 > this.attack_time) {
stop(); stop();

View File

@ -1,5 +1,6 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils; package cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.Tools.*; import cn.serendipityr.EndMinecraftPlusV2.Tools.*;
import org.spacehq.packetlib.Client; import org.spacehq.packetlib.Client;
@ -77,7 +78,9 @@ public class MotdAttackP extends IAttack {
} }
public Thread createThread(Proxy proxy, String ip, int port) { public Thread createThread(Proxy proxy, String ip, int port) {
if (!EndMinecraftPlusV2.isLinux) {
SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - MotdAttack | 当前连接数: " + threads.size() + "个 | 发包次数: " + runTimes + "次 | 有效包数: " + successTimes + "次 | 错误次数: " + errorTimes); SetTitle.INSTANCE.SetConsoleTitleA("EndMinecraftPlusV2 - MotdAttack | 当前连接数: " + threads.size() + "个 | 发包次数: " + runTimes + "次 | 有效包数: " + successTimes + "次 | 错误次数: " + errorTimes);
}
runTimes++; runTimes++;
Runnable task = () -> { Runnable task = () -> {
try { try {