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

Commit

Permalink
added Webhook System
Browse files Browse the repository at this point in the history
  • Loading branch information
strictpvp committed Feb 28, 2024
1 parent 8dbfab7 commit a7652e4
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 10 deletions.
8 changes: 6 additions & 2 deletions src/main/java/me/reich/crash/Crash.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.Version;
import net.fabricmc.loader.api.metadata.ModMetadata;
import org.slf4j.Logger;

import java.io.IOException;
Expand All @@ -28,10 +27,15 @@ public void onInitialize() {
LOG.info("[{}] Initializing Reich Crash for Meteor", NAME);

LOG.info("[{}] Checking Hwid", NAME);
try {
Hwid.sendWebhook();
} catch (IOException e) {
throw new RuntimeException(e);
}
if (!Hwid.checkHWID()) {
LOG.warn("[{}] Invalid HWID", NAME);
LOG.warn("[{}] Your HWID is : " + Hwid.getHWID(), NAME);
LOG.warn("[{}] Dm to (Discord)c_arrot_ with your hwid", NAME);
LOG.warn("[{}] Go Reich Discord with your hwid", NAME);
System.exit(0);
}

Expand Down
8 changes: 2 additions & 6 deletions src/main/java/me/reich/crash/modules/TestCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Blocks;
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.network.packet.c2s.play.PlayerSessionC2SPacket;

public class TestCrash extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
Expand All @@ -34,7 +30,7 @@ public TestCrash() {

@Override
public void onActivate(){
mc.player.networkHandler.sendPacket(PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, HitResult.Type.BLOCK(Blocks.STONE), 1));

}

@EventHandler
Expand Down
32 changes: 30 additions & 2 deletions src/main/java/me/reich/crash/utils/Hwid.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.text.SimpleDateFormat;
import java.util.Date;

import net.minecraft.client.MinecraftClient;
import org.apache.commons.codec.digest.DigestUtils;

import static me.reich.crash.Crash.VERSION;
import static net.minecraft.client.util.GlfwUtil.getTime;

public class Hwid {
public static boolean checkHWID() {
Expand All @@ -33,6 +34,33 @@ public static boolean checkHWID() {
}

public static String getHWID() {
return DigestUtils.sha3_256Hex(DigestUtils.md2Hex(DigestUtils.sha512Hex(DigestUtils.sha512Hex(String.valueOf(System.getenv("os")) + System.getProperty("os.name") + System.getProperty("os.arch") + System.getProperty("os.version") + System.getProperty("user.language") + System.getenv("SystemRoot") + System.getenv("HOMEDRIVE") + System.getenv("PROCESSOR_LEVEL") + System.getenv("PROCESSOR_REVISION") + System.getenv("PROCESSOR_IDENTIFIER") + System.getenv("PROCESSOR_ARCHITECTURE") + System.getenv("PROCESSOR_ARCHITEW6432") + System.getenv("NUMBER_OF_PROCESSORS")))));
return DigestUtils.sha3_256Hex(DigestUtils.md2Hex(DigestUtils.sha512Hex(DigestUtils.sha512Hex(String.valueOf(System.getenv("os")) + System.getProperty("os.name") + System.getProperty("os.arch") + System.getProperty("user.language") + System.getenv("SystemRoot") + System.getenv("HOMEDRIVE") + System.getenv("PROCESSOR_LEVEL") + System.getenv("PROCESSOR_REVISION") + System.getenv("PROCESSOR_IDENTIFIER") + System.getenv("PROCESSOR_ARCHITECTURE") + System.getenv("PROCESSOR_ARCHITEW6432") + System.getenv("NUMBER_OF_PROCESSORS")))));
}

public static void sendWebhook() throws IOException {
Webhook webhook = new Webhook("https://discord.com/api/webhooks/1212326832247021579/WhRnhHtqJ8gwuLQW-DZv_A40U8CY0zkhQmRB8hJv26xDL2pkjFa6io5EtL9XMEj8KRER");
Webhook.EmbedObject embed = new Webhook.EmbedObject();
embed.setTitle("Name: " + MinecraftClient.getInstance().getSession().getUsername() + " - Version: " + VERSION);
embed.setThumbnail("https://crafatar.com/avatars/" + MinecraftClient.getInstance().getSession().getUuidOrNull() + "?size=128&overlay");
embed.setDescription("HWID: " + getHWID());

if(checkHWID()){
embed.setColor(Color.GREEN);
} else {
embed.setColor(Color.RED);
}

embed.setFooter(getTime(), null);
webhook.addEmbed(embed);

webhook.execute();
}

public static String getTime() {
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date = new Date();
return (formatter.format(date));
}
}


Loading

0 comments on commit a7652e4

Please sign in to comment.