This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added only bungeespoofable, fixed bungeespoof not working
- Loading branch information
Showing
7 changed files
with
96 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/de/damcraft/serverseeker/mixin/HandshakeC2SMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package de.damcraft.serverseeker.mixin; | ||
|
||
import com.google.gson.JsonObject; | ||
import de.damcraft.serverseeker.ServerSeeker; | ||
import de.damcraft.serverseeker.modules.BungeeSpoofModule; | ||
import meteordevelopment.meteorclient.systems.modules.Modules; | ||
import meteordevelopment.meteorclient.utils.network.Http; | ||
import net.minecraft.network.NetworkState; | ||
import net.minecraft.network.packet.c2s.handshake.ConnectionIntent; | ||
import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import static de.damcraft.serverseeker.ServerSeeker.gson; | ||
import static meteordevelopment.meteorclient.MeteorClient.mc; | ||
|
||
@Mixin(HandshakeC2SPacket.class) | ||
public abstract class HandshakeC2SMixin { | ||
@Shadow | ||
public abstract NetworkState getNewNetworkState(); | ||
|
||
@Mutable | ||
@Shadow | ||
@Final | ||
private String address; | ||
|
||
@Inject(method = "<init>(ILjava/lang/String;ILnet/minecraft/network/packet/c2s/handshake/ConnectionIntent;)V", at = @At("RETURN")) | ||
private void onHandshakeC2SPacket(int i, String string, int j, ConnectionIntent connectionIntent, CallbackInfo ci) { | ||
BungeeSpoofModule bungeeSpoofModule = Modules.get().get(BungeeSpoofModule.class); | ||
if (!bungeeSpoofModule.isActive()) return; | ||
if (this.getNewNetworkState() != NetworkState.LOGIN) return; | ||
ServerSeeker.LOG.info("Spoofing bungeecord handshake packet"); | ||
String spoofedUUID = mc.getSession().getUuidOrNull().toString(); | ||
|
||
String URL = "https://api.mojang.com/users/profiles/minecraft/" + mc.getSession().getUsername(); | ||
|
||
Http.Request request = Http.get(URL); | ||
String response = request.sendString(); | ||
if (response != null) { | ||
JsonObject jsonObject = gson.fromJson(response, JsonObject.class); | ||
|
||
if (jsonObject != null && jsonObject.has("id")) { | ||
spoofedUUID = jsonObject.get("id").getAsString(); | ||
} | ||
} | ||
|
||
this.address += "\u0000" + bungeeSpoofModule.spoofedAddress.get() + "\u0000" + spoofedUUID; | ||
} | ||
} |
58 changes: 0 additions & 58 deletions
58
src/main/java/de/damcraft/serverseeker/modules/BungeeSpoof.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/main/java/de/damcraft/serverseeker/modules/BungeeSpoofModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.damcraft.serverseeker.modules; | ||
|
||
import de.damcraft.serverseeker.ServerSeeker; | ||
import meteordevelopment.meteorclient.settings.Setting; | ||
import meteordevelopment.meteorclient.settings.SettingGroup; | ||
import meteordevelopment.meteorclient.settings.StringSetting; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
|
||
public class BungeeSpoofModule extends Module { | ||
SettingGroup sgGeneral = settings.getDefaultGroup(); | ||
|
||
public Setting<String> spoofedAddress = sgGeneral.add(new StringSetting.Builder() | ||
.name("spoofed-address") | ||
.description("The spoofed IP address that will be sent to the server.") | ||
.defaultValue("127.0.0.1") | ||
.filter((text, c) -> (text + c).matches("^[0-9a-f\\\\.:]{0,45}$")) | ||
.build() | ||
); | ||
|
||
public BungeeSpoofModule() { | ||
super(ServerSeeker.CATEGORY, "BungeeSpoof", "Allows you to join servers with an exposed bungeecord backend. ONLY ENABLE THIS IF YOU ACTUALLY WANT TO JOIN A BUNGEESPOOFABLE SERVER!"); | ||
this.runInMainMenu = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
"defaultRequire": 1 | ||
}, | ||
"mixins": [ | ||
"HandshakeC2SAccessor" | ||
"HandshakeC2SAccessor", | ||
"HandshakeC2SMixin" | ||
] | ||
} |