SRL Archive - General Botting Help

Wurmonline, injecting/reflecting with simba


Reported

2015-03-31 12:36:20

Hai!:spongebob:

My question is related to injecting/reflecting into the wurmonline client.
It's a java game and my guess is that just as with runescape it should be possible to get all the interface, gameobjects and tile info.
With that info one could start botting in there, walking around and mining a bit. Or doing simple actions in the menu but this could also be done using color.

I have experience in programming java, used to program rsbot scripts for a year and had a rsps for half a year. The rsps used to have 30-60 players online a day and had a decent community. Coded most of the things myself so got some nice experience from there which was backed up by my rsbot scripts.

So how would i go and grab the information out of this game called Wurmonline? It's a java game. I've seen that this question has been asked before. The links to the more detailed info were outdated though.
This might become a future project of mine just as with the rsbot scripts and the rsps. Just need a small kickstart on how programming works on this kind of level.

Thanks in advance!
Reported

Reported

2015-04-02 08:37:20

I have done what Brandon said in this thread from 2013: https:// villavu.co m/forum/showthread.php?t=104661&highlight=wurm
Resulting in a black screen when i try to start wurm and the debug from SRL-6 is also giving errors.

I hope someone will respond to this :)

3Garrett3

2015-04-02 13:52:16

From: Reported
I have done what Brandon said in this thread from 2013: https:// villavu.co m/forum/showthread.php?t=104661&highlight=wurm
Resulting in a black screen when i try to start wurm and the debug from SRL-6 is also giving errors.

I hope someone will respond to this :)


Maybe @Brandon; can reply to help if you give some more detail on your problems.

Reported

2015-04-02 14:10:56

Thanks for linking him, i tried to pm him earlier but don't have 10 posts yet :)

Brandon

2015-04-02 21:42:51

If you want to hook it via java, you're going to have to find the main jar and do your modifications to it via ASM. There's a tutorial on how this works for OSRS and RS3.

If you want to hook it via OpenGL (colour OR via hooking), then you need the OpenGL plugins and C/C++. There's a tutorial on how "Detouring" works on here as well.

The thread that I replied to back then (the one you link to) should still work. Just use the latest plugins and you'll be fine. All I did was make the guy either inject the plugin into the game OR to place the plugin in the Java bin folder. That way, the game loads it without injection. In fact, if you get a hold of him (the OP for the thread you linked to), he wrote an entire library for botting that game (using the plugins). IIRC, he had almost everything working.

The newest plugins have a different way of selecting the client. Drag Simba's crosshairs to the Wurm client window. Then in the code you'd do:


GLXSetup(GetNativeWindow());

or at least I think I pushed that update. I'll have to check. If not, then just supply the Wurm process id instead of GetNativeWindow().

You will have to set Simba's target to point to use GLXImagePointer.

If you plan to use Direct-X instead, then it's a similar API:


DXISetup(GetNativeWindow()); //OR DXISetup(GetNativeWindow(), WindowWidth, WindowHeight);

and set Simba's target to DXIImagePointer. https://github.com/Brandon-T/DXI/blob/master/DXI/main.cpp#L18


With BOTH of these plugins you can draw on the window by using DXIDebugPointer or GLXDebugPointer.

With OpenGL you should be able to grab textures (and possibly models). I don't have time to test everything though (working long hours) so you'll have to test it (the current plugins) and report back and hope I see it.. or get someone to tag/pm me.

Reported

2015-04-03 06:30:15

Thanks for the reply Brandon! :D
I'll be looking into it later today. Need 10 posts though to be able to pm the person from the other thread. Do you have any more info on his wurm project? If not i'll just go post in some topics to be able to pm/mail him.

Brandon

2015-04-03 10:46:00

From: Reported
Thanks for the reply Brandon! :D
I'll be looking into it later today. Need 10 posts though to be able to pm the person from the other thread. Do you have any more info on his wurm project? If not i'll just go post in some topics to be able to pm/mail him.



You can modify the wurm client jar the below code as well:


import acid.JarParser;
import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.internal.org.objectweb.asm.tree.*;

import java.util.ArrayList;
import java.util.Arrays;

/**
* Created by Brandon on 2015-04-03.
*/
public class Main {
/*node.accept(new SimpleMethodVisitor(new IDynamicClassVisitor(node), Opcodes.ASM5, "<clinit>", "()V", false, null));
node.accept(new SimpleMethodVisitor(new IDynamicClassVisitor(node), Opcodes.ASM5, "<clinit>", "()V", true, (MethodVisitor mv) -> {
mv.visitLdcInsn("C:/Simba/Plugins/OpenGL32.dll");
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "load", "(Ljava/lang/String;)V", false);
mv.visitLdcInsn("C:/Simba/Plugins/d3d9.dll");
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "load", "(Ljava/lang/String;)V", false);
}));*/


public static void main(String[] args) {
JarParser jp = new JarParser(args[0]);
ArrayList<ClassNode> nodes = jp.load();

ArrayList<AbstractInsnNode> instructions = new ArrayList<>();
nodes.stream().filter((n) -> n.name.contains("WurmLauncher")).forEach(n -> n.methods.stream().filter((m) -> m.name.equals("<clinit>")).forEach(m -> instructions.addAll(Arrays.asList(m.instructions.toArray()))));

instructions.addAll(0, Arrays.asList(new AbstractInsnNode[]{
new LdcInsnNode(args[1]),
new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/System", "load", "(Ljava/lang/String;)V", false),
new LdcInsnNode(args[2]),
new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/System", "load", "(Ljava/lang/String;)V", false)
}));

nodes.stream().filter((n) -> n.name.contains("WurmLauncher")).forEach(n -> n.methods.stream().filter((m) -> m.name.equals("<clinit>")).forEach(m -> {
m.instructions.clear();
instructions.stream().forEach(insn -> m.instructions.add(insn));
}));

jp.setClasses(nodes);
jp.save();
}
}


You run it with arguments: "C:/Users/Whatever/Desktop/WurmClient.jar" "C:/Simba/Plugins/OpenGL32.dll" "C:/Simba/Plugins/D3D9.dll"

or whatever modules you want to force it to load. It's easier to just place the modules in the java bin folder though..

Reported

2015-04-03 15:19:46

Ok i'm going to check into it now. I'll post progress reports.

Total noob questions:

How did you decompile that jar or edit it? When i decompile it with Java Decompiler it ofcourse is all messed up and there isn't a Main class to find that i can edit lol.
Could you link me the ASM tut from these forums? Search bar doesn't help me out.. :/

Brandon

2015-04-03 17:16:22

From: Reported
Ok i'm going to check into it now. I'll post progress reports.

Total noob questions:

How did you decompile that jar or edit it? When i decompile it with Java Decompiler it ofcourse is all messed up and there isn't a Main class to find that i can edit lol.
Could you link me the ASM tut from these forums? Search bar doesn't help me out.. :/



See: https://villavu.com/forum/showthread.php?t=111556 (created this year) or https://villavu.com/forum/showthread.php?t=89645&p=1097256#post1097256 (code is outdated, but concept is the exact same) depending on what you plan on doing.


I opened the JNLP file in notepad, found the location of the jar and all its resources.. Downloaded the main jar and did:


java -jar fernflower.jar -dgs=true WurmClient.jar WurmDecompiled

That decompiled it.

The main class is "WurmLauncher" which should also be in the JNLP. Otherwise it'd be the only un-obfuscated class in the jar. If you still cannot find it, just write code to load the jar and search for "main":



ArrayList<ClassNode> nodes = loadJar(args[0]);
nodes.forEach(n -> n.methods.forEach(m -> {
if (m.name.equals("main") && m.desc.equals("([Ljava/lang/String;)V")) {
System.out.println("Main: " + n.name);
}
}));

Either way, one of the above WILL work. Otherwise you're doing it wrong. As I said before, if you cannot figure it out, you might be a lot better off placing the plugins into the Java bin folder.

If you plan to use reflection/injection then you'll have to learn the above.


If you plan to do OpenGL hooking, you will need glDebugger OR CodeXL. Both have the same interface (made by the same company).