• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

Creating a Java Bot

Extracts from this document...


Section 1 - The theory Part A: Why we do it this way, and why it works Seeing as jagex finally got off their fat buts and decided to addin some deob and action forcing detection we can't use them methods any more. People have tried to figure out ways of bypassing this detection, but it's pretty much impossible. You see, jagex managed to add an event logger into their client, this allows them to see mouse clicks and such; this means that if you suddenly attack an NPC and you haven't clicked it, they know your autoing. Similarly, for deobed clients, they can detect if method modifiers have changed, i.e. when "final static void kaboom(int i)" is altered to "public static void kaboom(int i)" they know it's been changed and give you a banstick. Bytecode bots, unfortunately just as bigger failure, if the fact that they take ages to update doesn't put you off, how about the fact they can detect if you run from main() and if you use the loader / navigate through the RS website (note: this also effects deobs). So well, where does that leave us? Fugly color clickers? Nah, fortunately for us, we can create a bot that doesn't use deobs, uses the RS website and loader, and injects its bytecode at runtime. "WOWOHWOW" yes . Any bytecode library should do the job, but in this tutorial I will be using "BCEL", seeing as it's fairly efficient, and pretty flexible (with a good API doc). Part B: How the bot works Okay, now you may be thinking how do we do this then, well heres the theory: First off, we navigate through the RS site, using a "Spoof Browser", to look like a real user using a real browser (in this tutorial i'll be spoofing firefox, but it's up to you). The bot will then select the world that you would like (by parsing the html code and finding the URL (atleast this tutorial/my bot does, ARGA finds the url from a world list)). ...read more.


You now have the basic loader structure, Section 3 will cover the rest of the loader hack. Part C: Finalising the GUI and the general Bot.java structure Code: app = (Applet) loader.loadClass(code.replaceAll(".class", "")).newInstance(); frame = new JFrame("My Bot - OwnageSBoT"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); //pack the frame, this is mandatory, just puts it all together hard to explain frame.setSize(771, 533); //sets the frame size frame.setResizable(false); //disallows you to resize app.setStub(BAS); //Ok, so we just tell the applet to use BAS app.setBackground(Color.white); frame.add("Center",app); //Add the applet to the frame (from the center) frame.setVisible(true); //Make the frame visible app.init(); app.start(); Once again, huge appologies for the indenting. Okay, basically what this does now, is cast "app" (which I forgot to mention needs declaring in the class block), to an Applet of a new Instance of the loader.class. For those that don't know variable code, is the name of the loader.class, which coinsidently also has to be found during the HTML parsing. (All we do is replace ".class" with nothing so the class loader can load it) Note: this won't load yet we haven't sorted the loader hack The next is just the GUI, you can copy paste or make some sexy GUI of your own. Section 3: An indepth look and completion of the loader hack Part A: The theory Ok, so the theory is that if we replace the class files that are loaded at runtime (such as client.class ka.class or w/e) by the loader, with our files, then we technically have bypassed their loadercheck, and effectively ran hacked classes. The loader hack works like this: loader -> loads class java.lang.ClassLoader we replace java.land.ClassLoader with our class: loader -> our class -> loads class java.lang.ClassLoader now you see that by adding in our "middle class" we have full control of what is sent to the java.lang.ClassLoader, therefore, if we have some "pre-transformed" classes we can substitute them in. ...read more.


return c; add this: Code: super.loadClass(cName); Hopefully that will never ever be called, but basically if the class wasn't found and our loader hack didn't work properly and defineClass couldn't define it, c won't be returned, and the compiler demands *something* to be returned, so we just let the real classloader deal with it, and return the result of that. Onto section 4 Section 4: Getting to a stage that will compile, and allow us to login etc. Part A: Building up your own frame and adding your applet to it Alright, at this point your bot should compile and run but do nothing (visually) and then end. So it's time to build ourselves a frame and add all the stuff we need to it. Okay so under where you declare your applet declare a JFrame, I called mine frame but it's up to you. Code: public static JFrame frame; Now under where you set the app, create a new frame so something like: Code: frame = new JFrame("FusionBot - OwnageSBoT"); will do just fine. Next you have a choice of what to do when the "X" is pressed, heres mine: Code: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Pack the frame: Code: frame.pack(); I actually think that theres no point doing it now, infact im not sure you need to pack at all but meh to it, doesnt break the bot so why not Set the size: Code: frame.setSize(771, 533); If your spicing up your frame and adding some special GUI features you'll probably need a diff size iunno Stop resizing: Code: frame.setResizable(false); Okay, now we have the visuals working lets finish off the applet and add it to our frame!! Set the applet's stub that we made earlier: Code: app.setStub(BAS); I liek a white bg so: Code: app.setBackground(Color.white); Swoot lets add the applet to the frame now then xD Code: frame.add("Center",app); Make the frame visible: Code: frame.setVisible(true); Initialize and start the applet: Code: app.init(); app.start(); Compile it and run it, you should be able to login now ...read more.

The above preview is unformatted text

This student written piece of work is one of many that can be found in our AS and A Level Computer Science section.

Found what you're looking for?

  • Start learning 29% faster today
  • 150,000+ documents available
  • Just £6.99 a month

Not the one? Search for your essay title...
  • Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

See related essaysSee related essays

Related AS and A Level Computer Science essays

  1. Visual basic

    * Visual Basic provides three types of Selection Structures: o If/Then -- single selection o If/Then/Else -- double selection o If/Then/ElseIf or Select Case -- multiple selection Repetition Structures * Repetition Structures determine how many times a section of code will be executed.

  2. Signal Theory

    It lets you voice calling, text messaging, the some other advanced phones even allow video calling and internet browsing. Cell phone is a full duplex device therefore you can connect it to your computer and use it as a modem even though it would be very slow.

  1. Signalling Theory

    This is all a computerized process and once again has benefits to it. The computer equipment used in the process is distinctly more reliable than that of its analogue counterpart. The biggest negative though is the fact that analog has been around for some years now and with any new system there needs to be a conversion period.

  2. Smart Card System

    1.1 4. Microsoft Office 2000 5. Microsoft Project 2000 6. Visio Professional 5.0 6.3 Overview of Feasibility Study Feasibility study is carried out to identify the functionality of a project and to determine whether the necessary resources are readily available. In this section, the feasibility study is conducted in aspect of economic, operational and technical feasibility.

  1. Ways of Promoting a Website

    A little less worrying than this, however still a problem, is the actual plug in needed for the code to work, without it many features that have been implemented with the JavaScript language would readily be unavailable. JavaScript can also be used for the following things; * Create windows *

  2. Computer Aided Design Package

    The reason for this is that they may not come in a web based formatted document, they could come in a text formatted document which can only be opened by a word processor. Another application which the company will require is a firewall, the reason for this is that their

  1. Free essay

    Setting up and E-Commerce Site

    I shall be using the website http://www.ambrow.com/ecomm_services.htm as my example business as well as another which shall be written about later on in the document. Ambrow aim to provide businesses with the functionality of an e-commerce website. But exactly what do they suggest is important and how does it relate to my list in the previous task?

  2. Program Code Program DVD_Program; Uses Menuunit, CRT, dos; ...

    Add_Menu ('Add a video record', 1, 5); Add_Menu ('-', 1, 6); Add_Menu ('Locate member record', 1, 7); Add_Menu ('Locate video record', 1, 8); Add_Menu ('-', 1, 9); Add_Menu('View all member records', 1, 10); Add_Menu('View all video records', 1, 11); Add_Menu ('Edit', 2, 1); Add_Menu ('Edit a member record', 2, 2);

  • Over 160,000 pieces
    of student written work
  • Annotated by
    experienced teachers
  • Ideas and feedback to
    improve your own work