• 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

    It also allows introducing GUI programming, networking, threads and other important concepts used in modern-day software. After conduct the thorough research on the Java programming tool, the team examined that the Java programming language is very complex as compared to other programming languages such as Visual Basic.

  1. Ways of Promoting a Website

    To do so I will make a link that when clicked, stored my link in to the users favourites, thus there will never be any trouble of the user finding his or her way back to my site. An example of this can be seen on the following page.

  2. Computer Aided Design Package

    One advantage of the system for the plotters is that there would only need to be one cheap plotter that prints off the drawings in low quality. The reason that they can print them off in low quality is that they are only going to the client for them to

  1. Free essay

    Setting up and E-Commerce Site

    Promoting the business is very important. Setting up the website is going to be costly and we need to have a vast array of things that needs to be done to it, these range from security packages, encryption, to the likes of search engine optimisation.

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

    1+1 Do Write (' '); End; End; {------------------------------------------------------------------} {Validates the date entered by the user.} Function validatedate (date: string): integer; VAR j, l: integer; c: char; valid: integer; Begin l:= length (date); valid:= 0; FOR j:= 1 to 1 DO Begin If not (date[j] in['1','2','3','4','5','6','7','8','9','0','/'])

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