Jump to content

Help me Xboot Canvas.


Reid

Recommended Posts

Would somebody please assist me in xbooting my Canvas. I don't know where to start here is what i have so far.

package org.kushbot;

import java.net.MalformedURLException;

import org.kushbot.loader.RSLoader;
import org.kushbot.ui.BotFrame;

public class Boot {

	public static void main(String[]args) throws InstantiationException, IllegalAccessException, MalformedURLException, ClassNotFoundException{
		new RSLoader();
		new BotFrame();
	}
}


import java.applet.Applet;
import java.applet.AppletContext;
import java.applet.AppletStub;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;

public class RSLoader implements AppletStub {
	
	private static final HashMap<String, String> PARAMETERS = new HashMap<String, String>();
	private static final String LINK = "http://oldschool69.runescape.com/";
	public static Applet applet;
    static RSLoader r;
    
	public RSLoader() throws InstantiationException, IllegalAccessException, MalformedURLException, ClassNotFoundException{
		
		parse(LINK);
		dwnld(LINK + PARAMETERS.get("archive"));
		ClassLoader loader = new URLClassLoader(new URL[] { new File("Runescape.jar").toURI().toURL() });
		Class<?> client = loader.loadClass("client");
		applet = (Applet) client.newInstance();
		applet.setStub(this);
		applet.init();
		applet.start();
	}
	
	public final String getParameter(String name) {
		return PARAMETERS.get(name);
	}

	public final URL getDocumentBase() {
		try {
			return new URL(LINK);
		} catch (MalformedURLException e) {
			return null;
		}
	}

	public final URL getCodeBase() {
		try {
			return new URL(LINK);
		} catch (MalformedURLException e) {
			return null;
		}
	}

	public final AppletContext getAppletContext() {
		return null;
	}

	private void parse(final String url) {
		try {
			BufferedReader in = new BufferedReader(new InputStreamReader(
					new URL(url).openStream()));
			String line;
			while ((line = in.readLine()) != null) {
				if (line.contains("app") && line.contains("write")) {
					PARAMETERS.put("<app", "");
					PARAMETERS.put("let ", "");
				} else if (line.contains("scriptsrc") || line.contains("ie6")) {
				} else if (line.contains("document.write")) {
					line = line.replaceAll("document.write", "")
							.replaceAll("<param name=\"", "")
							.replaceAll("\">'", "\"").replaceAll("'", "")
							.replaceAll("\\(", "").replaceAll("\\)", "")
							.replaceAll("\"", "").replaceAll(" ", "")
							.replaceAll(";", "").replaceAll("value", "");
					String[] splitted = line.split("=");
					if (splitted.length == 1) {
						PARAMETERS.put(splitted[0], "");
					} else if (splitted.length == 2) {
						PARAMETERS.put(splitted[0], splitted[1]);
					} else if (splitted.length == 3) {
						PARAMETERS.put(splitted[0], splitted[1] + splitted[2]);
					}
				}
			}
			in.close();
		} catch (Exception e) {
			System.out.println("Error Parsing!");
		}
	}

	private void dwnld(final String url) {
		try {
			BufferedInputStream in = new BufferedInputStream(
					new URL(url).openStream());
			FileOutputStream fos = new FileOutputStream("Runescape.jar");
			BufferedOutputStream out = new BufferedOutputStream(fos, 1024);
			byte[] data = new byte[1024];
			int x;
			while ((x = in.read(data, 0, 1024)) >= 0) {
				out.write(data, 0, x);
			}
			in.close();
			out.close();
		} catch (Exception e) {
			System.out.println("Error Downloading!");
		}
	}

	@Override
	public void appletResize(int width, int height) {
	}

	@Override
	public boolean isActive() {
		return false;
	}

	 public Applet getClient() {
         return applet;
 }
	public java.awt.Canvas getCanvas() {
		return (java.awt.Canvas) applet.getComponent(0);
	}

}

package org.kushbot.ui;

import java.awt.BorderLayout;

import javax.swing.JFrame;

import org.kushbot.loader.RSLoader;

public class BotFrame extends JFrame {

	public BotFrame() {

		setTitle("RuneDream");
		add(RSLoader.applet, BorderLayout.CENTER);
		setVisible(true);
		setSize(775, 540);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}

Link to comment
Share on other sites

Perhaps this is what you're looking for?

 

I understand the concept. I can't recall what bot xbooting was abused on. It was used to override the main class of some old bot, executing commands that toyed with the settings, resulting in attaining premium/developer status. I think it may have been RSBuddy.

 

As for the implementation of it for the RS client...I ain't played around with making a client myself. I honestly couldn't help you with this. But you should definitely post for help on p****bot's Developer forum sectionthere are a lot of cleverfucks who will know absolutely anything/everything you need to know about client hacking.

Link to comment
Share on other sites

Just as a suggestion you should use regex for finding the parameters. It's a whole lot less code and in general more effective and easier to maintain.

//finds the gamepack jar
Pattern aPattern = Pattern.compile("archive=(.*) ");

//first group represents the parameter name and the next is the value
Pattern pPattern = Pattern.compile("<param name=\"?([^\"]+)\"?\\s+value=\"?([^\"]*)\"?>");

Then use the Matcher class to find matches in the page source.

Edited by Swizzbeat
  • Like 1
Link to comment
Share on other sites

Just as a suggestion you should use regex for finding the parameters. It's a whole lot less code and in general more effective and easier to maintain.

//finds the gamepack jar
Pattern aPattern = Pattern.compile("archive=(.*) ");

//first group represents the parameter name and the next is the value
Pattern pPattern = Pattern.compile("<param name=\"?([^\"]+)\"?\\s+value=\"?([^\"]*)\"?>");

Then use the Matcher class to find matches in the page source.

 

You should never use regex for parsing html. Use http://jsoup.org/ instead.

  • Like 1
Link to comment
Share on other sites

You should never use regex for parsing html. Use http://jsoup.org/ instead.

in this case it's alright but for more complicated stuff you're correct

 

Just as a suggestion you should use regex for finding the parameters. It's a whole lot less code and in general more effective and easier to maintain.

//finds the gamepack jar
Pattern aPattern = Pattern.compile("archive=(.*) ");

//first group represents the parameter name and the next is the value
Pattern pPattern = Pattern.compile("<param name=\"?([^\"]+)\"?\\s+value=\"?([^\"]*)\"?>");

Then use the Matcher class to find matches in the page source.

might as well use the oldschool1.runescape.com/jav_config.ws for easier parsing

 

@OP: Find the java.awt.Canvas source code in your src.zip included with your java installation. Copy this to your IDE (be sure to put it in the package java.awt!). Change whatever you want to change, make a jar of it. Launch java with the -Xbootclasspath/p:changedcanvas.jar and it'll use your own implementation of the class.

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...