Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Interfaces is basically a reference to the actual class, it looks like this:


Code Block
<add>
    <classname>client</classname>
    <interface>Client</interface>
</add>


As you can see, we reference the name Client to the class client.
In that way we can easily say Client.fieldname to retrieve a fieldname, without typing out the whole class each time.
This is especially useful for clients which have strange names (like oAjEaif) for their classes.

...

A getter looks like this:


Code Block
<add>
    <accessor>Client</accessor>
    <field>backDialogID</field>
    <methodname>getBackDialogId</methodname>
    <descfield>I</descfield>
</add>


  • In here we first reference to the accessor (the interface) and then set all required fields.
  • The field is the field name within the current client, this could be something totally random (like aF), but in this case it's a more logic name.
  • Then we let the system know which method relates to which field, which is in this case getBackDialogId (this field is not for the client, but for the system itself, Parabot).
  • At last we also provide the desc of the field, which is in this case an integer, which has a desc of I

...

A setter could be useful to change a field value; it looks like the following:


Code Block
<add>
    <accessor>Client</accessor>
    <field>openInterfaceID</field>
    <methodname>setInterface</methodname>
    <descfield>I</descfield>
</add>


  • Again we start with the accessor, referencing to the actual class file.
  • Then we say which field needs to be changed when calling the method
  • This is again the method from the system, Parabot
  • The descfield is again letting the system know which type of field it is, which is an integer in this case

...

A callback looks like the following:


Code Block
<add>
    <accessor>Client</accessor>
    <methodname>doAction</methodname>
    <desc>(I)V</desc>
    <callclass>org/rev317/min/callback/MenuAction</callclass>
    <callmethod>intercept</callmethod>
    <calldesc>(I)V</calldesc>
    <callargs>0</callargs>
</add>


  • First we assign the accessor again, which is the client, once again
  • Then we say which method has to be intercepted
  • Then we say what kind of desc the method has. This is quite different from a field, as also have to define what parameters there are (within the ()) and what kind of type it returns (it's a void in this case)
  • Then we say which system class has to be called, which is MenuAction in this case
  • After that, we say which method has to be called in the system once the interception happens
  • We also provide the desc of the method (intercept), which is most likely the same as the desc of the client method
  • We also provide the order of the args, using the index of the arguments. In this case the first (and only) parameter is assigned to the first parameter of the system method (intercept())

...

An invoker looks like the following:


Code Block
<add>
    <accessor>Client</accessor>
    <methodname>doAction</methodname>
    <invokemethod>doAction</invokemethod>
    <desc>V</desc>
    <argsdesc>(I)</argsdesc>
</add>


  • As usual, we first say to which reference the system must check, which is Client once again
  • Then we tell what the method is in the client itself
  • After that we tell the system what the method is in its own system, in this case this is the same
  • The desc stands for the description of the method
  • The argsdesc stands for the arguments description of the method

...

In this case we've found the field backDialogID by simply comparing actions in the non-obfuscated client against the actual client.
So for this client the getter field would look like this:


Code Block
<add>
    <accessor>Client</accessor>
    <field>YJ</field>
    <methodname>getBackDialogId</methodname>
    <descfield>I</descfield>
</add>


How to test locally

We've created an smart system to detect local development/hooking of a server, you can do this by creating a new (json) file within your Parabot/Servers directory.
For example create a file called server.json and insert the following:


Code Block
{
        "name": "New server",
        "author": "My name",
        "version": 1.0,
        "client-class": "client",
        "locations":{
            "provider": "http://bdn.parabot.org/api/v2/bot/download/317-api-minified",
            "server": "/path/to/the/server_jar.jar",
            "hooks": "/path/to/the/hook_file.xml"
    }
}


This will load the provider, get the client class (make sure this is correctly set) and insert the server and hooks file.
It's also possible to set web urls, you can for example set the value of server to http://www.site.com/client.jar, it'll then simply download the client!

...