Create a bot for an isometric game - travel bot [Part 1]

Create a bot for an isometric game - travel bot [Part 1]

Have you wondered how to write a bot for a game to automate an action. I wondered, when I had to travel a lot from one city to another when I was moving goods around. The concept is quite simple for a such traveling bot, you just need couple of things. The first thing - find where you are on the map, second - decide where you want to go, third - just go there.
Segment information from another process

Segment information from another process

To get information of segments in memory from another process you have three options - read process’ memory, map the process’ memory to the accessible virtual address space or inject dll that can access and read process’ memory. In this post I will use the first approach and read another process’ memory in to a buffer, afterwards I will use content of the buffer to extract header information that contains segment information.
Visualization of process memory

Visualization of process memory

I started a new multi-player game, after a while I wondered about the game’s memory and what is kept in it. I know one strategy is to visually represent process’ memory as pixels. Take a byte from a memory and associate it with a 8bit color or take 4 bytes and create an ARGB color. There are many tools to read or write memory (Cheat Engine), but that felt to easy and I would not learn much.

.NET Core Solution of multiple projects

.NET Core is using file-system to organize projects. Sometimes the working project is getting quite big and it makes sense to organize it in multiple sub-folders. The problem what I encountered was with the local dependencies. In .NET and Visual Studio it is straight forward to reference projects across a solution. There is something similar in .NET Core - it is global.json file, which acts as a solution for organizing multiple projects.

JVMTI - Creating a simple agent

Hooking VMs is pretty cool, it is possible to look inside and see what exactly is happening in a Java application. Java provides an interface for hooking JavaVM, this interface is great if you want to develop a profiler, debugger or monitoring solution. There were two separate interfaces for profilers and debuggers, JVMPI (Java Virtual Machine Profiling Interface) and the JVMDI (Java Virtual Machine Debug Interface). Both of these interfaces are obsolete in the latest JDK and has been replaced with JVMTI (Java Virtual Machine Tool Interface).

Moving from C# to Java

I have been working with C# for a while now, but now a new project came written in Java and it is time to switch languages. Both languages are quite similar and in same time there are many differences. In this post I noted down few high level differences.

Creating a custom serialization class

Sometimes it is not enough to mark a whole class as serializable, quite often a class will have .net internal type that is not serializable, for example XmlDocument. In such case we need a wrapper class that is derived from ISerializable interface.

.NET Object Serialization

Have you ever wanted to send an object across application domains, save the object as a file or send it over the Internet to completely different service - then object serialization is for you. Serialization offers a way to describe object’s state(data) in a way that is understandable by other components. For example, object can be transformed into a XML or a Soap document, will get into output formats latter on.