SRL Archive - Senior News and General

Relevant Java Knowledge.


n3ss3s

2009-12-12 15:37:53

Seeing people are interested in updating reflection, which RSBot gives an opportunity for, I'll just post some simple things that allow you to update the hooks from RSBot. You could learn these things and more by Googling, but I think this will score more interested people.

A Java class. If you do not have experience of Java, observe a class as 'something', for example, a RuneScape Character. Very relevant to cheating aswell.

Our Character class can, and does contain information such as the Character's current animation, and it's tile position. Both of these are applicable to both NPCs and Players, for example if our NPC class's name is 'np', and the animation field in the Character class is 'an', is the NPC's animation found at np.an.

We will never get to use it in that direct way though, as we will find the Player array, and pick one from there which are all instances of the np NPC class. In SCAR we would do something like SmartGetFieldInt(theNPC, "an");

A part of an old updater output.

[Character]
*jd implements interface com.tageteg.accessors.Character
->getMessage() into class jd gets FIELD java.lang.String jd.H
->getAnimation() into class jd gets FIELD int jd.Kb
->getMotion() into class jd gets FIELD int jd.pc
->getLocationX() into class jd gets FIELD int[] jd.mc
->getLocationY() into class jd gets FIELD int[] jd.wc
->getY() into class jd gets FIELD int jr.y
->getX() into class jd gets FIELD int jr.w
->getAnimation() into class jd gets FIELD int jd.w


If we have our Character instace charac, charac.w is it's animation.



You will need a decompiler, and I recommend DJ Java Decompiler, as it's Archiver.exe can nicely decompile whole jars.

I also recommend Notepad++ as it offers code highlighting and a very good, informative easy to use Search From Files, which you will need.


Now, let's get us some fields shall we? Locate your RSBot folder, go to the lib folder and inside it make a new folder called rs. In the lib folder as you propably have seen, is the rs.jar aswell. Now, open up Archiver.exe and select open, find the rs.jar. Then go Select -> Select All. Then hit Decompile and locate the rs folder we just created. It's gonna prompt you about creating class files or something, just hit ok…

After it has decompiled the class files, open up Notepad++. (Note that my Notepad++ is Finnish, so I don't know if the English version says Search or Find.)

Hit Search -> Search From Files, or hit CTRL + SHIFT+ F. Then, as filter, write *.jad, and to the search field write "implements RSCharacter". Make sure it searches from the rs folder. When it gives you the result (should only give one result), double click the quote of the code, something along
"Line 8: implements RSCharacter" and it will open up the file.

Scroll down to almost bottom, just above the variable declarations on the bottom. You will find what you were looking for.


public final String getMessage()
{
return eb;
}

public final int isMoving()
{
return rc;
}

public final int getAnimation()
{
return G;
}

public final int[] getLocationY()
{
return sc;
}

public final int[] getLocationX()
{
return pc;
}

public final int getLoopCycleStatus()
{
return ab;
}

public final int getHPRatio()
{
return Z;
}

public final int getHeight()
{
return hb;
}

public final int getInteracting()
{
return Qb;
}




TUTORIAL WILL BE CONTINUED

Naike

2009-12-12 16:37:30

n3ss, when you get on msn next time, msg me.

I'm soon done with something, you'll like it :p and sex me all night long

RAM

2009-12-12 16:37:57

Thank You, much needed :)

Widget

2009-12-12 17:53:19

Piiiiictures!

Notepad++: http://sourceforge.net/projects/notepad-plus/files/
DJ Java Decompiler: http://uppit.com/v/YSFKH3VU


First, check out (from the repos) RSBot if you don't already have it.

Actually nevermind, all you need is this one jar file. Just make sure you have the newest one.

Now open it with the DJ Java Decompiler thing.



Also, while you're at it, make a new folder and call it something (I used decomp).



Now select all the classes.



And decompile them toward the folder you just made.



Now open up Notepad++, and go to Search > Find In Files.



Click Browse… and pick the folder you decompiled everything to.



I'll be using RSCharacter as an example (I guess it's just everyone's favorite example). We search for the class that implements it, so we search for "implements rscharacter".



For this one, there will only be one result. For things like objects there are 5. I think it's only objects that get more than one though. Double-click the result to open up the file.



Scroll down, and there are your hooks! :D

YoHoJo

2009-12-12 17:58:45

Awesome job widget and n3ss3s this will be of great help of lots of people! (Sorry for the generic noob comment)
Edit:
But by question is, after getting the hooks, and putting them into the .scar reflection file with all the hooks (forgot what it was called) what ELSE is needed to get things working again?

Ex: After all this is done: http://www.villavu.com/forum/showpost.php?p=665038&postcount=45
whats the next step?

Bobarkinator

2009-12-12 22:24:19

Parts of reflection need to be rewritten because they don't work the same.