From 92238ea3bb96eb04875fa0c5204aa25cd55d7aaa Mon Sep 17 00:00:00 2001 From: core Date: Sat, 15 Jul 2023 16:50:46 -0400 Subject: [PATCH] upd, start working on new LO join challenge --- .../dev/coredoes/coreclient/CoreClient.java | 3 ++ .../dev/coredoes/coreclient/exploit/Void.java | 11 +++++ .../coreclient/gui/module/LogoModule.java | 1 - .../coreclient/gui/module/Module.java | 3 +- .../mixin/ClientConnectionMixin.java | 49 +++++++++++++++++++ .../module/exploit/VoidInventory.java | 40 +++++++++++++++ .../coreclient/module/misc/PacketLogger.java | 31 ++++++++++++ src/main/resources/coreclient.mixins.json | 3 +- 8 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 src/main/java/dev/coredoes/coreclient/exploit/Void.java create mode 100644 src/main/java/dev/coredoes/coreclient/mixin/ClientConnectionMixin.java create mode 100644 src/main/java/dev/coredoes/coreclient/module/exploit/VoidInventory.java create mode 100644 src/main/java/dev/coredoes/coreclient/module/misc/PacketLogger.java diff --git a/src/main/java/dev/coredoes/coreclient/CoreClient.java b/src/main/java/dev/coredoes/coreclient/CoreClient.java index dea7390..41bdce3 100644 --- a/src/main/java/dev/coredoes/coreclient/CoreClient.java +++ b/src/main/java/dev/coredoes/coreclient/CoreClient.java @@ -4,6 +4,7 @@ import dev.coredoes.coreclient.gui.Category; import dev.coredoes.coreclient.gui.ClickGUI; import dev.coredoes.coreclient.gui.module.*; import dev.coredoes.coreclient.module.bypass.BotMovement; +import dev.coredoes.coreclient.module.bypass.PacketLogger; import meteordevelopment.orbit.EventBus; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; @@ -46,6 +47,8 @@ public class CoreClient implements ClientModInitializer { Category.BYPASS.modules.add(new BotMovement()); + Category.MISCELLANEOUS.modules.add(new PacketLogger()); + LOGGER.info("[Stage 4/4: GuiEventInit] Registering GUI events"); ClientTickEvents.END_CLIENT_TICK.register(client -> { diff --git a/src/main/java/dev/coredoes/coreclient/exploit/Void.java b/src/main/java/dev/coredoes/coreclient/exploit/Void.java new file mode 100644 index 0000000..f818957 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/exploit/Void.java @@ -0,0 +1,11 @@ +package dev.coredoes.coreclient.exploit; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.screen.slot.SlotActionType; + +public class Void { + public static void voidSlot(int syncId, int slot) { + assert MinecraftClient.getInstance().interactionManager != null; + MinecraftClient.getInstance().interactionManager.clickSlot(syncId, slot, 120, SlotActionType.SWAP, MinecraftClient.getInstance().player); + } +} diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java b/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java index b8380cc..c93b9c2 100644 --- a/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java +++ b/src/main/java/dev/coredoes/coreclient/gui/module/LogoModule.java @@ -35,7 +35,6 @@ public class LogoModule extends Module { public void render (Context context) { position = new Point(MinecraftClient.getInstance().getWindow().getWidth() / 2 - 32, MinecraftClient.getInstance().getWindow().getHeight() / 2 - 29); super.render(context); - CoreClient.LOGGER.info("render pos " + position.toString() + " from " + MinecraftClient.getInstance().getWindow().getWidth()); context.getInterface().drawImage(context.getRect(),rotation.getValue(),parity.getValue(),image,color.getValue()); } diff --git a/src/main/java/dev/coredoes/coreclient/gui/module/Module.java b/src/main/java/dev/coredoes/coreclient/gui/module/Module.java index ad8584e..c1349a4 100644 --- a/src/main/java/dev/coredoes/coreclient/gui/module/Module.java +++ b/src/main/java/dev/coredoes/coreclient/gui/module/Module.java @@ -11,7 +11,8 @@ import com.lukflug.panelstudio.setting.IModule; import com.lukflug.panelstudio.setting.ISetting; public class Module implements IModule { - public final String displayName,description; + public String displayName; + public final String description; public final IBoolean visible; public final List> settings=new ArrayList>(); public final boolean toggleable; diff --git a/src/main/java/dev/coredoes/coreclient/mixin/ClientConnectionMixin.java b/src/main/java/dev/coredoes/coreclient/mixin/ClientConnectionMixin.java new file mode 100644 index 0000000..80d823d --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/mixin/ClientConnectionMixin.java @@ -0,0 +1,49 @@ +package dev.coredoes.coreclient.mixin; + +import dev.coredoes.coreclient.CoreClient; +import dev.coredoes.coreclient.event.ConnectEvent; +import dev.coredoes.coreclient.event.DisconnectEvent; +import dev.coredoes.coreclient.event.PacketEvent; +import net.minecraft.network.ClientConnection; +import net.minecraft.network.listener.PacketListener; +import net.minecraft.network.packet.Packet; +import net.minecraft.text.Text; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.net.InetSocketAddress; + +@Mixin(ClientConnection.class) +public class ClientConnectionMixin { + @Inject(method = "handlePacket", at = @At("HEAD"), cancellable = true) + private static void onHandlePacket(Packet packet, PacketListener listener, CallbackInfo info) { + if (CoreClient.eventBus.post(PacketEvent.Receive.get(packet)).isCancelled()) info.cancel(); + } + + @Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true) + private void onSendPacket(Packet packet, CallbackInfo info) { + if (CoreClient.eventBus.post(PacketEvent.Send.get(packet)).isCancelled()) { + // we should cancel this packet + info.cancel(); + CoreClient.LOGGER.info("Outgoing packet cancelled"); + } + } + + @Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("TAIL")) + private void onSentPacket(Packet packet, CallbackInfo info) { + CoreClient.eventBus.post(PacketEvent.Sent.get(packet)); + } + + @Inject(method = "disconnect", at = @At("HEAD")) + private void disconnect(Text disconnectReason, CallbackInfo ci) { + CoreClient.eventBus.post(DisconnectEvent.get()); + } + + @Inject(method = "connect", at = @At("HEAD")) + private static void onConnect(InetSocketAddress address, boolean useEpoll, CallbackInfoReturnable info) { + CoreClient.eventBus.post(ConnectEvent.get()); + } +} diff --git a/src/main/java/dev/coredoes/coreclient/module/exploit/VoidInventory.java b/src/main/java/dev/coredoes/coreclient/module/exploit/VoidInventory.java new file mode 100644 index 0000000..4ad45b3 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/module/exploit/VoidInventory.java @@ -0,0 +1,40 @@ +package dev.coredoes.coreclient.module.bypass; + +import com.lukflug.panelstudio.base.IBoolean; +import com.lukflug.panelstudio.base.IToggleable; +import dev.coredoes.coreclient.CoreClient; +import dev.coredoes.coreclient.gui.module.Module; +import meteordevelopment.orbit.EventHandler; + +public class VoidInventory extends Module { + private static VoidInventory instance; + + private boolean enabled=false; + + public VoidInventory() { + super("VoidInventory", "Delete every item in your inventory", () -> true, true, false); + + CoreClient.eventBus.subscribe(this); + + instance = this; + } + + public static VoidInventory getInstance() { + return instance; + } + + @Override + public IToggleable isEnabled() { + return new IToggleable() { + @Override + public boolean isOn() { + return enabled; + } + + @Override + public void toggle() { + displayName = "Are you sure? (click again to confirm)"; + } + }; + } +} diff --git a/src/main/java/dev/coredoes/coreclient/module/misc/PacketLogger.java b/src/main/java/dev/coredoes/coreclient/module/misc/PacketLogger.java new file mode 100644 index 0000000..470bb76 --- /dev/null +++ b/src/main/java/dev/coredoes/coreclient/module/misc/PacketLogger.java @@ -0,0 +1,31 @@ +package dev.coredoes.coreclient.module.bypass; + +import com.lukflug.panelstudio.base.IBoolean; +import dev.coredoes.coreclient.CoreClient; +import dev.coredoes.coreclient.event.ConnectEvent; +import dev.coredoes.coreclient.event.PacketEvent; +import dev.coredoes.coreclient.gui.module.Module; +import meteordevelopment.orbit.EventHandler; + +public class PacketLogger extends Module { + private static PacketLogger instance; + + public PacketLogger() { + super("PacketLogger", "Log all recieved packets to console", () -> true, true, false); + + CoreClient.eventBus.subscribe(this); + + instance = this; + } + + @EventHandler + public void onPacketRecieved(PacketEvent.Receive e) { + if (isEnabled().isOn()) { + CoreClient.LOGGER.debug("pkt", e.packet); + } + } + + public static PacketLogger getInstance() { + return instance; + } +} diff --git a/src/main/resources/coreclient.mixins.json b/src/main/resources/coreclient.mixins.json index 99db32d..7005870 100644 --- a/src/main/resources/coreclient.mixins.json +++ b/src/main/resources/coreclient.mixins.json @@ -6,7 +6,8 @@ "client": [ "PlayerMoveC2SPacketFullMixin", "PlayerMoveC2SPacketLookMixin", - "PlayerMoveC2SPacketOnGroundMixin" + "PlayerMoveC2SPacketOnGroundMixin", + "ClientConnectionMixin" ], "injectors": { "defaultRequire": 1