• 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. Computer Aided Design Package

    The cost of the training will need to cover the training for the two employees being trained in the use of the CAD system. They are both familiar with the Windows XP operating system as they both use it on their computers at home so they will not need training on this.

  1. Free essay

    Setting up and E-Commerce Site

    The good thing about doing this is that the internet has a large percentage of users and we therefore maximise the amount of people that use our site for a smaller price. To be honest, I believe local free ads and shops to be another good idea, these are smaller price and used by customers daily.

  2. I have been given the task of creating a system for a hospital to ...

    Weekly Report: The weekly report will show the location of all equipment and show which patients need to be contacted about the return of equipment. If the equipment is due for return or renewal in the following week a standard letter will be sent, by using the mail merge function.

  1. Signal Theory

    This is higher than the Upper Layer protocol. This means that can manage and control IP, IPX and MAC addressing. They allow IPX/SPX clients to IP/TCP uplink network to connect to the internet. A gateway in simple terms is like a post office. All the information is sent to it and then as a post office knows the

  2. 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.

  1. Smart Card System

    The Smart Card is different. By using multi directional interaction between the card and the reader true authentication of identity can be met in a more powerful way that is much more secure than the traditional magnetic stripe card. The cardholders' identity is held on the card via a secret key.

  2. What is Java?

    Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor. The file that is created contains what are called the source statements. The programmer then runs the appropriate language compiler, specifying the name of the file that contains the source statements.

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