• 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. Ways of Promoting a Website

    The closest relation is actually between Perl and PHP, where PHP is renowned for adding things in to documents; Perl is useful for extracting them. PHP has one distinct advantage to it however, and that is that it is normally already loaded as part of the web server.

  1. Free essay

    Setting up and E-Commerce Site

    Now we have looked at one firm that supplies the services of setting up an e-commerce site, let's have a look at another. This time I shall be using the website http://www.affordablewebdesign.ca/ as my example. This firm opposed to the last one I looked at offer the complete package for

  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. Program Code Program DVD_Program; Uses Menuunit, CRT, dos; ...

    THIS PROCEDURE CANNOT BE UNDONE!') Write ('Erase all data? Y or N '); Readln ( response); If (response = 'y') or (response = 'Y') then Begin Assign (member, 'c:\pas\member.pas'); Rewrite (member); Close (member); Assign (video,'c:\pas\video.pas'); Rewrite (video); Close (video); Clear_Selected; Save_Screen; Draw_Shadow_Box (10, 10 70, 17); Gotoxy (12, 11); TextColor (red+blink); Writeln ('ALL DATA STORED ARE ABOUT TO BE

  2. Smart Card System

    only store and a little hardware that prevent the stores data being used by other unauthorized people unless there are password or pins are input correctly. * Shared-key cards - This card allows communication with any device that have the same keys.

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

  2. Computer Aided Design Package

    They also need to have the capability to back up their drawings daily so that if something did happen to their hard drive they wouldn't have lost everything. They also want all three computers linked up to their own network separate to any others that the company already have.

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