Advanced Do It Yourself Memory Reading In EVE Online

The guidance here is to help people understand how EVE Online memory reading works in detail.

I don’t expect it to be useful for a beginner. If you want to develop an EVE Online bot the easy way, this is not what you are looking for, instead, start at bots/guide/eve-online/developing-for-eve-online.md at main · Viir/bots · GitHub

So I wrote this example C# app some time ago. It simply shows how to read from the eve online clients UI Tree:

http://xn–domne-iraa.de/sanderling/Optimat.EveOnline.Tut.Memread.zip

Maybe you want to not start from scratch but make small small improvements to the existing memory reading implementation. In this case, see the guide at https://github.com/Arcitectus/Sanderling/blob/master/guide/how-to-adapt-eve-online-memory-reading.md

Update 2019-09-15:
I published an improved version of the example app here:

This new version also covers everthing the older one did, so the Optimat.EveOnline.Tut.Memread.zip is now obsolete.

4 Likes

Great!

Can you give us, please, a small example of finding precise UI element? ChatWindow maybe… I can see a lot of data, but it seems “unsorted” - can’t get any way to order it to make UI structures.

Can you give us, please, a small example of finding precise UI element? ChatWindow maybe

Chat window should be simple because you can identify it by the name of the python type (“tp_name”). Just print out a list of all type names in the UI tree. Therein you will see the type name of the chat window. One method which should work for every UI Element is to look at its location. Just take the corresponding screenshot and measure the location of the UI element you are looking for. Then you simple take the set of UI elements which intersect this point/area.

I can see a lot of data, but it seems “unsorted” - can’t get any way to order it to make UI structures.

The structure for traversing the tree works as shown in the image below:

This shows the memory structure of the UI Tree in the eve online client. The whole image shows a structure within a single node of the UI tree. The list represented at the bottom contains the references to the children of the node.

This shows the memory structure of the UI Tree in the eve online client.
The whole image shows a structure within a single node of the UI tree.
The list represented at the bottom contains the references to the children of the node.

In the sample code it looks way simpler already: the children are in the “children” property of the “UITreeNode” class. That is the tree structure. You can sort them any way you want, no problem.

Woo-hoo! Thanks, precisely what I was looking for.

Do you know how frequently object tree changes in eve client’s memory? For example, if I don’t ever close local chat - will it’s UINode be persistently at the same memory point? If so - we can get a boost in CPU performance.

upd: how do you get the structure of children? I see their type - container. But… which? Have you analysed memory by-hand or there is some arcane knowledge? =)

Do you know how frequently object tree changes in eve client’s memory?

No.

upd: how do you get the structure of children?

I get the structure as described in the sample code.

I see their type - container. But… which?

I don’t know what you mean.

Have you analysed memory by-hand or there is some arcane knowledge? =)

Yes, I analyzed manually.

Thank you!

I’m trying to figure out PyDictEntry’s.

For example there is a PyDictEntry with KeyStr “isAffectedByPushAlignment”.

The value is probably a boolean, but all I can see is a me_value 815825360.

Is me_value a memory address? How to find the actual boolean value of “isAffectedByPushAlignment”?

I’m trying to figure out PyDictEntry’s.

For example there is a PyDictEntry with KeyStr “isAffectedByPushAlignment”.

The value is probably a boolean, but all I can see is a me_value 815825360.

Is me_value a memory address? How to find the actual boolean value of “isAffectedByPushAlignment”?

Yes this is a memory address. At that address you will probably find a python object. So if this member is representing a boolean vale, then the python object at that address will be a boolobject.

To get the actual value just use the structure of the particular python type. In case there is not already a type dedicated for boolobject in the example code, I guess boolobject works just the same as intobject.

I was digging into menu entry and found an object of type “Bunch”. What’s the right way to investigate it’s structure? Without reverse engineering =)

I was digging into menu entry and found an object of type “Bunch”. What’s the right way to investigate it’s structure? Without reverse engineering =)

Just from the top of my head, it should work similar to the “dict” type. It can have multiple entries and they work like dict entries. I suggest you first try to simply apply the code from the “dict” to the Bunch and see what entries you get out of it.

My first idea was just to ingore it’s type an use it like a dict. But it didn’t work. But now I’ve looked into memory and see a little difference. Maybe it will help me. Seems like I’ve messed with dict entry struct. Thanks =)

Can anyone tell me if this is still working?

I have run the solution above, and It seems like I am reading everything accurately through cheat engine, but the values aren’t making any sense to me.

I’ve investigated this a bit further, here are a few tools that will help anyone else who is interested in doing this. I realise the posts above are 2 years old, but anyone just getting into reading the Eve Online UI tree may find these items useful:

Look in the Include folder and search for the data type you are reading, the github below will virtually give you the offsets of the datatype you are looking to read.

If the data type you are looking for is not listed in the Include folder of that github, try using Reclass which is a program that you can search for on Google. It’s a memory viewer that will allow you to visually construct the structures by manually analysing the memory. You can then output the classes in various programming languages.

2 Likes

Another Update,

Using this as a base I have boosted my own project a lot further, However I am struggling with the time it takes to read the UI Tree.

Do you guys have any suggestions on how to boost the time taken to read the UI tree?

Currently the UI Tree takes me 10 seconds to load…
I am currently working to change the system I am using to a Queue and Thread based approach. do any of you have any other Suggestions on how you have read your own UI tree’s quickly?

I use a multithreaded solution too. One thread is constantly retrieving the client data while the other thread is working concurrently using the data from the last retrieval. After initial load, depending on CPU load, tree retrieval takes .25 to 1 second. But that doesn’t inhibit the process manipulating the eve gui.

Would you mind allowing me to see the code you are using?

My method has been falling apart all day x(

Update 2019-09-15:
I published an improved version of the example app here:

This new version also covers everthing the older one did, so the Optimat.EveOnline.Tut.Memread.zip is now obsolete.

Hello,
So I tried to run this project to get the resulting json file from a running eve online process, but I am getting the error ‘Did not find the root of the UI tree’ constantly. So instead I tried to first get the memory dump from the read-memory-64-bit and then feed the resulting zip file back to this app, but I still got the same error.

So then I tried to run the read-memory-64-bit again, but this time with the argument read-memory-eve-online so that it would generate a json file instead of the memory dump. That actually worked correctly, so that makes me believe that either I am unable to run/build the project correctly or something else is wrong. I inspected the json and there actually is a UIRoot element at the start, so there should not be issue I think.

I was able to debug it to the function

static public IEnumerable<UInt32> FindCandidatesTypeObjectTypeAddress(
            IMemoryReader MemoryReader)

Which returned empty result, so I guess it was not able to find any matching Python Type Object? But unfortunately that is where I got stuck.

Any ideas what I am doing wrong?

Hello and Welcome Baly :wave:

This thread is several years old now, and the programs linked here are outdated. The general approach to memory reading is still the same, but CCP, the developer of EVE Online, made some changes to the game client, and we adapted the reading code to the new game client.
I am not surprised if such an old version does not work with the new game client.

So if this thread is not updated, where to see these developments? The reference for updates to memory reading in EVE Online is the main branch on the Sanderling repository at https://github.com/Arcitectus/Sanderling
That repository is where we see all the updates to the memory reading programs.

On the GitHub page for Sanderling, we also see the last release of the memory reading program was in January of this year.
You can download the current version of the memory reading program directly from https://github.com/Arcitectus/Sanderling/releases/download/v2023-01-03/read-memory-64-bit-self-contained-single-file-exe-697d97fafeca8ad47bed81464ee9d97624da5c56-win10-x64.zip

And this is the link to the guide on how to use the command-line interface:
https://github.com/Arcitectus/Sanderling/tree/main/implement/read-memory-64-bit

An alternative to getting the memory reading JSON file would be to export from a bot session or run the alternate UI for EVE Online from https://github.com/Arcitectus/Sanderling/tree/main/implement/alternate-ui

Hello,
thank you for the answer.

The link Sanderling/implement/read-memory-64-bit at main · Arcitectus/Sanderling · GitHub is actually how I found this thread (at the end of the page), so I had hoped that it would be still up to date, but I understand.

I guess using the read-memory-64-bit is my only option here if I want to read the UI tree directly and avoiding the JSON entirely. But it should definitely be usable.

Basically I wanted to create my own Eve bot and I therefore found Sanderling, but I failed to bond with Elm. So I was happy to see that there actually is a C# lib that I could utilize.

Thank you again.