Page 1 of 3 123 LastLast
Results 1 to 25 of 65

Thread: [Tutorial] [Part I] Runescape Injection Basics

  1. #1
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default [Tutorial] [Part I] Runescape Injection Basics

    Forenote: This is how I learned, if anything can be simplified/if I did it wrong, leave a post explaining why and how I need to fix the issue. Thanks.


    Table of Contents
    • Introduction
    • Setting up your class
    • Preparing the loader
    • Final Notes


    Introduction
    Awhile ago, I looked into fooling with Java injection on oldschool. I didn't get too far, but I did manage to do some things.
    By the end of this tutorial, you should be able to load the gamepack, and display it as an applet. No actual injection is being done here, we're just setting on up.
    I'll be using Intellij throughout this tutorial, so the pictures may be a little off.
    You also need a basic understanding of Java to complete this tutorial.
    Well, let's get too it.
    Setting up your class

    You'll want to make a new project by clicking File>New Project.
    If you did that, it should look like this:

    Just click okay on the next window.
    You'll be presented a window like so(Large Image):

    Expand your project so it looks like so:

    Now, right click on the src, and make new package.
    Name it something like com.bot
    You're almost set now... but wait,you need ASM!
    Lucky for you, I prepared a download of the all extensive ASM jar, found here.
    After you put that in a safe place, click: CTRL+Shift+Alt+S
    A box like this will appear:

    Click the Modules tab on the left, and inside that, click Dependencies, so it looks like

    You'll then want to click the green plus(+) sign at the right of that window, and select Jar or Directories.
    Navigate to your ASM-All-4.1.jar you downloaded earlier, and select it.
    You will now want to export it by selecting the little tick box.

    Click apply, then okay.
    We are now prepared to code!


    Preparing your loader

    For your benefit, all the code will be screen shotted, so you can not copy and paste. This will force you to write out all code within the tutorials.
    Alright, here we go. Another note, I will explain what the code does after I post it. So don't worry if you don't understand it at first, just type it, and all will be clear.


    This is your first code you need to write down.
    It searches a pattern(Which we will get to later) for a field. It then runs it through a Matcher to check for matches, then assigns group 1 and 2 (Name of parameter, and value) to a map.
    You can read about Maps here

    Next, we add a new method. Copy this out


    What this does is it opens a URL connection, and then adds request properties, stuff that a browser would have. It opens a DataInputStream, and returns the HTML of the webpage.
    Near the top of the code, under the imports, change public class main{ to:

    Then add this code to the bottom:

    This code sets up our class to start the game applet, by setting up the appletstub, all it does.

    Your next code is:
    This code downloads the info from the website, and downloads the gamepack to your PC, allowing for further editing.

    This next part is the nitty gritty.

    Alright, here we go.

    What this does, it makes a new JFrame, (Replace "NKN's Oldschool Loader" with w/e you want.")
    It then adds a new label, which has a picture so the user has something "nice" to look at when it's loading.

    String str gets the HTML source of the runescape page we're going to be loading from. This is how we will parse everything.
    The next line starts a pattern, looking for the location of the gamepack. The code states, if a match is found, do this
    We initialize a new AppletStub with Main stub = new Main(); (Remember, Main implements AppletStub?)
    This sets up the stub. Don't worry about the pattern, it's in Regex if you REALLY want to know.
    We then download the gamepack, and save it.
    We set the stubs' codebase and document base to the jar file location, and load the java parameters (Like max and min memory, ect.)
    We then load the classes, and cast an Applet to it, loading the client class inside the gamepack.jar file.
    We set the stub, and the size, start the applet, and add it to the JFrame, before making the label invisible and making the applet show!


    Viola, loading the game should be done... it's not working when you click play? Did you forget to add it to execute?!
    Run back to the top, and try this code on for size:


    Click run, you should end up with something like:
    for the loader, and
    for the game!


    Final Thoughts

    I know this isn't the best detailed tutorial, but I tried my best. Some things can be made simpler, if you have any ideas, leave a post. Try not to flame me with them though, as this is how I learned it. Well, if you made it this far, congrats! You made a loader!

  2. #2
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,164
    Mentioned
    26 Post(s)
    Quoted
    433 Post(s)

    Default

    Hmm... I am really tempted to actually attempt to make one of these. It would be kinda fun! and looks like it too!

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Well I understood a little bit of this... one day.. one day I may come back and understand this

  4. #4
    Join Date
    Nov 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Quoted
    43 Post(s)

    Default

    This is how BenLand loads the client in SMART, correct? I recognize most of this code.

    Anyways, I will definitely try this from scratch when I get the time. Thanks for the guide.

  5. #5
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by Neodymium View Post
    This is how BenLand loads the client in SMART, correct? I recognize most of this code.

    Anyways, I will definitely try this from scratch when I get the time. Thanks for the guide.
    He does it a bit different. It interacts with Simba, and is a lot more complex.

  6. #6
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

  7. #7
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    I've never seen any tutorials using ASM, only BCEL. I'd love to see what your future guides will be like!

    I've also not seen a huge number of people using IntelliJ, how have you been finding it? I'm far too generic in always using eclipse.

    One final note, about the naming of packages you did. The general convention is that you name these essentially in reverse of your domain: [URL suffix].[domain].[packages...].Class. For example: com.villavu.bot.Loader

  8. #8
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by Richard View Post
    I've never seen any tutorials using ASM, only BCEL. I'd love to see what your future guides will be like!

    I've also not seen a huge number of people using IntelliJ, how have you been finding it? I'm far too generic in always using eclipse.

    One final note, about the naming of packages you did. The general convention is that you name these essentially in reverse of your domain: [URL suffix].[domain].[packages...].Class. For example: com.villavu.bot.Loader
    I found IntelliJ confusing at first, but after awhile I like it better than Eclipse. Not sure why, just grew on me I guess.

    As for the final note, wouldn't that be for people with a website, so they can use an API? Most people don't have websites laying around. D: But anywho, thanks for the insight.

  9. #9
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    I found IntelliJ confusing at first, but after awhile I like it better than Eclipse. Not sure why, just grew on me I guess.

    As for the final note, wouldn't that be for people with a website, so they can use an API? Most people don't have websites laying around. D: But anywho, thanks for the insight.
    I'm not sure if I'm too set in my ways to try out a new IDE yet Then again, it sounds like my degree intends to steer clear of java for the first year, focusing on more practical languages. Which is a shame in some ways.

    About the naming, it's just "one of those things", there's no real reason behind it, and it often makes sense to do it in other ways. I probably shouldn't have said anything, as programmers we must find our own, more practical methods, free of conformity!

  10. #10
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by Richard View Post
    I'm not sure if I'm too set in my ways to try out a new IDE yet Then again, it sounds like my degree intends to steer clear of java for the first year, focusing on more practical languages. Which is a shame in some ways.
    Where are you getting your degree?
    I start my first programming year as a freshmen in highschool next year, we start with Visual Basic, then the year after that, Java.

  11. #11
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    Where are you getting your degree?
    I start my first programming year as a freshmen in highschool next year, we start with Visual Basic, then the year after that, Java.
    If all goes to plan with my A level retakes, should be going to the University of Exeter, but we'll see. If I end up doing better than expected, maybe UCL or Bristol.

    Also, when it comes to VB, don't get put off by this general idea that it's useless. It can actually be pretty useful when applied in the right areas. On top of that, if you use Visual Studio, then it gets you used to the UI for moving on to C/C++ if you plan to stay with that IDE (although I seem to be in a minority here for supporting MS )
    Last edited by Richard; 03-19-2013 at 02:09 AM. Reason: Failing to spell "here" like an educated being. NKN, edit your quote!

  12. #12
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by Richard View Post
    (although I seem to be in a minority hear for supporting MS )
    My highschool makes us use Visual Studio for all Basic/C++ applications, don't fret. <3

  13. #13
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

  14. #14
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Not yet to the injection part but awesome starter kick-starter! nice tutorial

  15. #15
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default

    Looks like this may be a promising tutorial series. I'm eagerly awaiting the next parts as they are the bits I know less about.
    +rep thanks for your time

  16. #16
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Might want to explain more about regular expressions and what it's actually getting. Other than that it's nice to start off with for people

    Script source code available here: Github

  17. #17
    Join Date
    Jan 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tut. Thanks!

  18. #18
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Don't really know much java but Bookmark'd for later

  19. #19
    Join Date
    Jan 2012
    Location
    In A Farm
    Posts
    3,301
    Mentioned
    30 Post(s)
    Quoted
    444 Post(s)

    Default

    Very nice guide, im looking forward into the rest parts..

  20. #20
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    I'll try this. Very nice tut, very easy to follow, and the pictures vs. copy/paste forces people to actually possibly learn.

  21. #21
    Join Date
    Sep 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I followed your tutorial. However, only the loader loads. Then it just sits there and displays the .gif. Any ideas?

  22. #22
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by Adium View Post
    I followed your tutorial. However, only the loader loads. Then it just sits there and displays the .gif. Any ideas?
    You're loading the applet wrong. Make sure all the methods are typed out correctly.

  23. #23
    Join Date
    Sep 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    You're loading the applet wrong. Make sure all the methods are typed out correctly.
    What should <~> be? I put a random number in because <~> gave me an error.

  24. #24
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by Adium View Post
    What should <~> be? I put a random number in because <~> gave me an error.
    What..?

  25. #25
    Join Date
    Sep 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    What..?
    Code:
    public class Main {
      private static Map<String, String> parameters = new HashMap<~>();
      .....
    The HashMap

    I don't think thats the problem though.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •