ByteCodePatcher (#39)
Adds ErrorTransform -This prevents the client from sending any stack traces to Jagex. (a huge client detection system they use)
This commit is contained in:
@@ -9,6 +9,7 @@ import net.runelite.client.RuneLite;
|
||||
import net.runelite.client.rs.ClientLoader;
|
||||
import net.runelite.client.rs.bytecode.transformers.ActorTransform;
|
||||
import net.runelite.client.rs.bytecode.transformers.ClientTransform;
|
||||
import net.runelite.client.rs.bytecode.transformers.ErrorTransform;
|
||||
import net.runelite.client.rs.bytecode.transformers.PlayerTransform;
|
||||
import net.runelite.client.rs.bytecode.transformers.ProjectileTransform;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
@@ -50,11 +51,13 @@ public class ByteCodePatcher {
|
||||
transformProjectile(projectileClass);
|
||||
Class playerClass = Class.forName(hooks.playerClass, false, child);
|
||||
transformPlayer(playerClass);
|
||||
|
||||
//experimental
|
||||
Class clientClass = Class.forName("client", false, child);
|
||||
transformBlackjack(clientClass);
|
||||
|
||||
//Odds and ends
|
||||
ErrorTransform et = new ErrorTransform();
|
||||
et.modify(null);
|
||||
|
||||
ByteCodeUtils.updateHijackedJar();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.runelite.client.rs.bytecode.transformers;
|
||||
|
||||
import javassist.CtClass;
|
||||
import javassist.CtMethod;
|
||||
import javassist.CtNewMethod;
|
||||
import net.runelite.client.rs.bytecode.ByteCodePatcher;
|
||||
|
||||
//This prevents the client from sending stack traces to Jagex at all, even classes outside of runelite.
|
||||
public class ErrorTransform implements Transform {
|
||||
public CtClass ct = null;
|
||||
|
||||
//Where Runelites error interceptor is located, not auto-scraped.
|
||||
private final String ERROR_INSTANCE_CLASS = "dp";
|
||||
private final String ERROR_INSTANCE_METHOD = "a";
|
||||
|
||||
@Override
|
||||
public void modify(Class clazz) {
|
||||
try {
|
||||
System.out.println("[RuneLit] Transforming error method at class: "+ERROR_INSTANCE_CLASS);
|
||||
ct = ByteCodePatcher.classPool.get(ERROR_INSTANCE_CLASS);
|
||||
CtMethod error = ct.getDeclaredMethod(ERROR_INSTANCE_METHOD);
|
||||
ct.removeMethod(error);
|
||||
error = CtMethod.make("public static void a(String string, Throwable throwable, byte by) {"+
|
||||
" return;"+
|
||||
" }", ct);
|
||||
ct.addMethod(error);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transform() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user