Jump to content

Nullable's Dev Blog #3 - Tribot X: Injection or Reflection?


Recommended Posts

As some may or may not know, in the background of everything else going on, I've been rewriting Tribot from scratch. I know, I know, a lot of you have heard that one before. "Good one, Nullable, now fix script download issues". I get it. I even still use the project codename created in 2017 for the first of many supposed "rewrites".

But this is real and the best part is that I am still prioritizing development for what you use right now. So at the very least, no harm done.

 

That being said, I am making a lot of progress and I figured some would like to get some details.

 

Injection? Reflection? What are these things?

The current version of Tribot is a Reflection bot, for reference.

What is Reflection in terms of botting?

Reflection refers to the programming mechanism of the same name. It's where, during runtime of the program, code can examine the contents of itself. Since the game runs in the same process, we can use this mechanism to "examine" the game memory and read data. This is allows us to know where the objects and npcs are and stuff like that. 

The upside of this is that it doesn't modify game bytecode. The downside is that it can be slow.

Tribot uses a lot of intelligent caching, though, making it one of the most efficient reflection bots created for the game. Nowadays, we're one of the only reflection bots out there.

And Injection?

"Injection" refers to the technique of modifying the game bytecode as it loads it. It "injects" friendly names and interfaces into the game's classes so that it can simply call them directly and receive game data.

The upside is that it's fast and direct. The downside is that it modifies bytecode. The problem with modifying bytecode is that it's legally dubious and has the potential to be reflected itself. While there is no indication of any sort of reflection-based anti-bot, and patching it would be possible for injection clients, it's always a possibility.

 

So what is Tribot X?

image.png.b1a4018e5c543c64357ce6064e07caf5.png

Tribot X won't be using either. It will use Compile-Time Wrappers. Not a very catchy name, admittedly.

While developing the basis of the new bot, I realized we could have the best of both worlds for how we interact with the game. This technique is actually really simple. The game is just a jar like any other, and can be programmed against. So we do that!

public int getSomeValue() {
    return client.obfuscated_name * multiplier;
}

And now when we compile and run this, we get the value. Of course, this has lots of problems. I would need a ton of these to get all the data and I would need to change them every time the game updates. Also, there are various other roadblocks that I won't go into for getting this to actually run.

We solve the main problem by generating code and compiling it against new game updates. These generated classes act as wrappers and give us the same functionality as injection without needing to inject anything. As such, they are just as fast and require no game modification.

We've already written a complete generator for doing this automatically.

 

More details!

Since this is my first post on Tribot X, I'll give some one-liners over some of the other random technical details I may not write full posts about.

  • Tribot X has a lot more flexibility in terms of spoofing, and includes the spoofing of runtime information that could be used in the future for bot detection (even though it isn't currently).
  • Tribot's mouse has been completely swapped out and is astronomically more efficient and less prone to error. The current tribot uses an event queue mechanism while the new one uses a single thread with locking to enforce thread safety. By doing so, we reduce the number of threads and overhead.
  • Every method for manipulating the canvas has been optimized. Faster code, less CPU, less RAM.
  • It supports tabs! But really properly this time with perfect isolation and spoofing.
  • The GUI of Tribot X uses Jetpack Compose. The entire bot is written in Kotlin.
  • For really CPU intensive tasks or to share code with our launcher, we have a way to interop Kotlin and Rust code in the client. 
  • The architecture of the bot has been entirely changed. Plugins separate from scripts are now a possibility. 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...