• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 5 of 5
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      trDna's Avatar
      Join Date
      Aug 2012
      Posts
      4
      Thanks (-->)
      0
      Thanks (<--)
      0

      Java Tutorial How to create your own bot Runescape Private Server

      Silent VPN
      NOTE: I take NO responsibility over your actions that you may do from knowledge gained from this post. This post was made for educational purposes only!

      This is intended to be a short summary on how people create runescape private server bot(not scripts). It may not be the best tutorial, but I hope to give people an idea of how to make them.

      Thanks to crazywink for the code brackets !

      Requirements

      • Knowledge of basic Java
      • An IDE of your choice.
      • Basic knowledge of BCEL or ASM (will provide links below).
      • Common sense
      • Knowing how to use a search engine
      • Patience
      • The ability to cope with legal issues if you plan to hack Jagex's RS client.


      Tips

      First off, I do not recommend hacking into the official RS client.
      If you plan to create the bot quickly, then I suggest you hack into an RS private server client. They usually have most things de-obfuscated and therefore, it's easier to grab the data you will need.
      Only grab the data that you will need for your scripts for your bot.
      Steps
      Go through all of these links. It will teach you how to start to make a bot from scratch using BCEL (can't find any detailed ASM tutorials).
      Make sure that you download the external JARs for BCEL and ASM and add it as external JARs for your bot project folder.

      Credits: Freddy of RSHacking

      You will need to make an account there to view these links. I'm going to post his tutorial threads in order.

      Alternatively, you can also go to their site, login, and go Reflection/Injection -&gt; Tutorials &amp; FAQ

      I'll be explaining how to continue this in BCEL.
      Here is a sample injector that I've found using a web search engine.
      I could of just posted my own, but I'm trying to prove that a good web search engine
      can be your best friend.

      Credits to Echo_ at villavu:
      Code:
      import org.apache.*;
      import org.apache.bcel.*;
      import org.apache.bcel.classfile.*;
      import org.apache.bcel.generic.*;
      import org.apache.bcel.util.*;
      import org.apache.bcel.verifier.*;
      import org.apache.bcel.verifier.exc.*;
      import org.apache.bcel.verifier.statics.*;
      import org.apache.bcel.verifier.structurals.*;
      import java.io.IOException;
      /**
      *
      * BCEL Injector
      *
      * @Author: Echo_
      *
      */
      public class Injector {
      private ClassGen cGen;
      public Injector() {
      loadClass();
      modify();
      dumpClass();
      }
      private void loadClass() {
      try {
      cGen = new ClassGen(new ClassParser("vs.class").parse());
      } catch (ClassFormatException e) {
      e.printStackTrace();
      } catch (IOException e) {
      e.printStackTrace();
      }
      }
      private void modify() {
      cGen.addInterface("Animable");
      for(Method m : cGen.getMethods()) {
      if(m.getName().equals("p")) {
      System.out.println("Method p found!");
      break;
      }
      }
      InstructionList methodIList = new InstructionList();
      ConstantPoolGen theCPool = cGen.getConstantPool();
      MethodGen pixelXMethod = new MethodGen(Constants.ACC_PUBLIC,Type.INT,Type.NO_AR GS,new String[]{},"pixelX",cGen.getClassName(),methodIList,theCPool);
      InstructionFactory iFactory = new InstructionFactory(cGen,theCPool);
      Instruction pushThis = new ALOAD(0);
      Instruction pixelXField = iFactory.createFieldAccess(cGen.getClassName(),"p",Type.INT,Constants.GETSTATIC);
      Instruction returnPixelX = InstructionFactory.createReturn(Type.INT);
      methodIList.append(pushThis);
      methodIList.append(pixelXField);
      methodIList.append(returnPixelX);
      pixelXMethod.setMaxStack();
      pixelXMethod.setMaxLocals();
      cGen.addMethod(pixelXMethod.getMethod());
      }
      public void dumpClass() {
      try {
      cGen.getJavaClass().dump("vs.class");
      } catch (IOException ex) {
      ex.printStackTrace();
      }
      }
      public static void main(String[] args) {
      new Injector();
      }
      }
      If you look at that, he explains that he uses a decompiler so that way, you can see the code of the .class file that you want to hack. I recommend using the JAD decompiler in order to see a .class file's variables and code (web search it).

      The next part is pretty much the end of my mini-tutorial.

      Most people usually have trouble of getting their information from their accessor methods, (which is the interfaces that you make to get your data).
      Below is an example of how one may get their data, and is just an example using random Java files that I've made.

      Example of getting the data from accessor methods (Done completely by myself)
      Lets say that there is a program that you want to hack to get "theSecretString" 's value. I've commented each file out to help understand what's happening.
      If you look below, notice how it's STATIC.

      Assume that all files (including the files that you use to inject and extract the data, as well as the program's file) are all in the same package/folder (no imports will be needed).
      Code:
      /**
      *
      * @Author A nerdy programmer
      *
      */
      public class TheProgram { //Using a BCEL or an ASM-based injector, you must make the class implement the interface (accessor) in order to retrieve the data.
      
      private static String theSecretString = "Hello. My name is Bob."; //You will need to return this value.
      public static void main(String[]args){ //Pretend its some sort of epic program.
      System.out.println("TheProgram's string value = " + theSecretString);
      }
      }
      As you can see above, you will need to make your injector so that it implements the interface to get what theSecretString is.

      Before doing that, you will need to make the interface that you implement. Since theSecretString is a String, then you must make an accessor interface which retrieves the data of theSecretString.
      Code:
      public interface Accessor {
      /**
      *
      * @ReTurn Retrieves the data of theSecretString.
      */
      public String nameOfString();
      }
      Make the injector using BCEL or ASM and implement the Accessor interface. Remember to also add the method that the interface requires through the injector. TheProgram class would look something like this (excluding the comments):
      Code:
      /**
      *
      * @Author A nerdy programmer
      *
      */
      public class TheProgram implements Accessor { //Using a BCEL or an ASM-based injector, you must make the class implement the interface (accessor) in order to retrieve the data.
      
      private static String theSecretString = "Hello. My name is Bob."; //You will need to return this value.
      public static void main(String[]args){ //Pretend its some sort of epic program.
      System.out.println("TheProgram's string value = " + theSecretString);
      }
      @Override
      public String nameOfString() {
      return theSecretString; //Using a BCEL or an ASM-based injector, you must make the theString as the return type.
      }
      }
      After this, make an abstract class that would "get" the accessor's interface.
      Code:
      public abstract class GetAccessorClass {
      /**
      *
      * @ReTurn The Accessor interface.
      */
      public abstract Accessor getAccessor();
      }
      After this, most people choose to make another interface which is similar to the Accessor method, for use of bot scripts.
      Code:
      public interface MethodInterface {
      /**
      *
      * @ReTurn The string that we want from TheProgram.
      */
      public String getTheHiddenString();
      }
      After that, you would need to make a class that gets theHiddenString. This class would have similar methods for use in scripts.
      For example, "PlayerInfoGetter.java" may contain methods that retrieve data related to player operations.

      In this case, we are hacking the whole program in total, and not just one aspect of it. That's why I've named the class "Getter" because its related to getting methods of the whole program (all in one class).
      I've also left a SoftReference, as I've seen RSBot's old bot code, and it seems like a great way of saving memory on a computer while running your bot.
      Code:
      import java.lang.ref.SoftReference;
      /**
      *
      * @Author trDna
      *
      */
      /*
      * Pretty much a class that contains similar methods that are retrieved from the Accessor accessor.
      * For example, "PlayerInfoGetter.java" may contain methods that retrieve data related to player operations.
      */
      public class Getter extends GetAccessorClass implements MethodInterface{
      private SoftReference&lt;Accessor&gt; sr; //optional, allows for garbage collection, which makes the Accessor accessor perform faster (less memory would be used up).
      
      
      public Getter(final Accessor acx){ //Accepts any class that implements Accessor.
      sr = new SoftReference&lt;Accessor&gt;(acx);
      }
      
      @Override
      public Accessor getAccessor() {
      return sr.get();
      }
      @Override
      public String getTheHiddenString() {
      return getAccessor().nameOfString();
      }
      
      }
      Now you must start up your "bot" (really just a data retriever) through your program. You need to inject your code before hand, and then create an instance of TheProgram. I've invoked the main method of TheProgram in order to mimic what would happen when the RS/RSPS client loads (however, this just displays a string). After this, you would need to set up the Getter class, and use TheProgram's instance as an argument, because it implements the Accessor interface that we made.
      After this, you could simply print out the String that you have retrieved.
      Code:
      /**
      *
      * @Author trDna
      *
      */
      public class Setter {
      public static void main(String[]args){
      //Your injection code must go here, so that you can get theSecretString, for example.
      
      TheProgram tp = new TheProgram(); //A new instance of TheProgram, which is supposed to be modified.
      
      TheProgram.main(null); //Invoking the main method. We're just doing this to replicate how the RS client would load and display something. In this case, "Hello. My name is Bob". This line isn't needed.
      
      Getter get = new Getter(tp); //The Accessor accessor (lol).
      
      
      /*
      * You could make a method context class to get the data from the Getter class so its easier to utilise the methods that you would make.
      * I've simply made it shorter by getting theHiddenString straight from the Getter class to speed things up.
      * This may not be perfect (or technically "correct"), but it shows an approach of how to access the accessor methods that you inject.
      *
      */
      System.out.println("The setter class's reference of the string: " + get.getTheHiddenString());
      
      
      }
      
      }
      Your output should be:
      TheProgram's string value = Hello. My name is Bob.
      The setter class's reference of the string: Hello. My name is Bob.

      If you got this output, congratulations! You have just retrieved the accessor data by injection!

      NOTE: You will need to use the URLClassLoader#loadclass(string).newInstance() in order to load the .CLASS file that you want, then cast that Object to your interface.

      Example (sorry, I don't remember the exact syntax as I'm typing on my phone; I'll re-edit it when I get home):

      Code:
      //Remember to try/catch the URLClassLoader
      URLClassLoader ucl = new URLClassLoader("thejar.jar");

      Accessor acx = (Accessor) ucl.loadClass("theprogram").newInstance();

      Getter g = new Getter(acx);

      ....
      There are better ways of doing that, but this is just a really simple way of doing it, and it may be a lot harder when hacking into the client of your choice.

      Note: Accessor methods only work out when you are returning a value of a STATIC variable. This is because non-static variables' method signatures change here and there, and as a result, you will most likely get an NPE.

      I hope that this tutorial helped some of you out and/or has helped you begin your journey! Feel free to leave suggestions, and I can add/edit this thread.

    2. #2
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      228
      Very in depth! I'll have to read over this. Thanks for the contribution.

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      trDna's Avatar
      Join Date
      Aug 2012
      Posts
      4
      Thanks (-->)
      0
      Thanks (<--)
      0
      Quote Originally Posted by Crazywink
      Very in depth! I'll have to read over this. Thanks for the contribution.
      You're welcome!

      It's actually quite a bit vague, but if you have any questions, leave it here.

    4. #4
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      228
      *Added code brackets.

    5. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      trDna's Avatar
      Join Date
      Aug 2012
      Posts
      4
      Thanks (-->)
      0
      Thanks (<--)
      0
      Silent VPN
      Quote Originally Posted by crazywink
      *Added code brackets.
      Thanks
      This makes it a lot easier to read!
      I may need to make some corrections tommorow, as I'm away from home at the moment.
      I also plan to add another tutorial going more in-depth soon.

    Similar Game Hacker Threads

    1. [Help] [Java] Runescape private server tutorial bot request
      By Cryslacks in forum Hacking Help
      Replies: 3
      Last Post: 04-19-2017, 02:29 PM
    2. [Help] [Java] Get user input and submit it into a website.
      By maxownage01 in forum Misc Coding
      Replies: 6
      Last Post: 06-23-2016, 10:37 AM
    3. [Help] Java Reverse Engineering & Address finding.
      By Stealing in forum Hacking Help
      Replies: 11
      Last Post: 04-26-2015, 06:53 AM
    4. Minecraft Modding with Java
      By skridovaste in forum General Coding Discussion
      Replies: 7
      Last Post: 01-14-2013, 12:59 PM