Sanderling Memory Reading Suite

repository·main·Indexed 43 days ago

https://github.com/arcitectus/sanderling

A specialized memory-reading suite for EVE Online that provides structured access to the game's UI and state without process injection. It includes a .NET Core library and CLI tool (read-memory-64-bit.exe) for extracting UI trees and game objects, a parsing library implemented in Elm to transform raw JSON into developer-friendly formats, and a web-based Alternate UI for remote play and accessibility.

Tokens
2.6K
Snippets
7
Records
15
Agent score
55%

What's inside Sanderling

  1. Overview of the Alternate UI for EVE Online

    main

    The Alternate UI is a web-based interface for the EVE Online client. It provides several key benefits:

    • Accessibility: Uses HTML-based rendering, making it more accessible for screen-readers.
    • Remote Play: The architecture is split into a backend (running on the same machine as the EVE Online client) and a frontend (web browser). This allows playing from devices like Android or iPhone via HTTP.
    • UI Tree Visualization: It displays the game client's UI tree, allowing users to inspect tens of thousands of properties by expanding and collapsing nodes.
    • Interaction: When connected to a live process, the UI allows sending input commands to the EVE Online client. Note that sending an input command will switch focus to and bring the EVE Online window to the foreground.

    To avoid interference between the browser and the game client, it is recommended to place the windows side-by-side on the same desktop.

  2. Overview of Sanderling

    main

    Sanderling is a memory reading library and toolset designed to extract structured information from the EVE Online game client. It allows developers to detect game objects, read game world information, and locate UI elements (like windows, buttons, and overview entries) by reading the client's memory directly. This information can then be used to automate interactions via mouse input.

    Key characteristics:

    • Safe: It does not inject into or write to the EVE Online process, making it non-detectable.
    • Accurate & Robust: Uses memory reading instead of screen scraping, making it immune to background noise or non-default UI settings.
    • Comprehensive: Supports various automation tasks including mining, trading, mission running, and combat anomalies.
  3. Use the Alternate UI for EVE Online

    main

    The Alternate UI is a web-based interface for EVE Online that enables remote play and improved accessibility.

    Features

    • Accessibility: Uses HTML-based rendering, making it compatible with screen-readers.
    • Remote Play: Allows playing EVE Online from devices without the game client (e.g., Android or iPhone) via a web browser.

    Architecture

    • Backend: Runs on the same machine as the EVE Online client and hosts an HTTP server.
    • Frontend: A web-based interface that connects to the backend via HTTP to read game contents and send input commands.
  4. Parse EVE Online memory readings with the Parsing Library

    main

    The memory reading process produces a raw UI tree structure that is often deep, redundant, and difficult to navigate. The Memory reading parsing library (implemented in Elm) transforms this raw JSON string into a structured, developer-friendly format.

    How it works

    • Input: A JSON string representing the raw memory reading.
    • Transformation: It filters out redundant data and maps the UI tree to types that reflect player-centric concepts (e.g., overview window or ship modules) rather than raw UI nodes.
    • Type Safety: It uses the Elm type system to ensure that the data extracted matches the expected shape of the game's user interface, helping to catch errors in automation code early.

    For detailed information on the parsed UI structure, refer to the BotLab guide for parsed user interfaces.

  5. Use the Memory Reading Library and CLI Tool

    main

    The core functionality is provided by the read-memory-64-bit implementation. This includes a C# library and a standalone executable.

    Components

    • Library: A .NET Core assembly read-memory-64-bit.dll used for reading the UI tree from 64-bit EVE Online processes.
    • CLI Tool: The read-memory-64-bit.exe executable allows you to:
      • Save process samples to files for later inspection or testing.
      • Read structures from a live EVE Online process or a previously saved process sample.
      • Export memory reading results into a JSON file.

    Exporting Memory Readings

    You can obtain the JSON memory reading in two ways:

    1. Via CLI: Use read-memory-64-bit.exe to read a process and save the output to JSON.
    2. Via BotLab DevTools: If using the BotLab client, you can select an event in a bot/play session and click the 'Export reading as JSON file' button to get a separate JSON file.

    The JSON format is compatible with the BotLab client's development tools.

    read-memory-64-bit.exe
  6. Collect 64-bit process samples for memory reading development

    main

    Use the read-memory-64-bit.exe tool to capture a snapshot of a 64-bit Windows process's memory and a screenshot of its main window. This is used to correlate visual screen content with memory data during the development of bots or memory reading frameworks.

    Steps to collect a sample:

    1. Download the tool: Obtain the self-contained 64-bit executable from the Sanderling releases.
    2. Identify the PID: Open Windows Task Manager and find your game client. Ensure the name does not contain (32 bit). Note the value in the PID column.
    3. Prepare the window: Ensure the game client window is visible on your screen and not minimized.
    4. Run the command: Open a Windows Command Prompt and execute the tool with the save-process-sample command and the --pid flag.

    Reducing Inconsistency Risks

    Because memory is copied over a period of time, data structures might change during the copy process, leading to inconsistent samples. To mitigate this:

    • Collect multiple samples: Increase the likelihood of obtaining a consistent snapshot.
    • Reduce memory usage: Lower the game client's memory footprint (e.g., by reducing resolution or texture quality) to speed up the copy process and create smaller files.
    read-memory-64-bit.exe  save-process-sample  --pid=12345
  7. Setup the Alternate UI using PineVM

    main

    The Alternate UI runs using the PineVM runtime. Follow these steps to set up the environment:

    1. Download PineVM: Download the zip archive from the Pine releases page and extract it.
    2. Install .NET Runtime: Ensure you have .NET runtime version 9.X.X installed. If you encounter an error stating you must install or update .NET, download it from dotnet.microsoft.com/download/dotnet/9.0.
    3. Locate pine.exe: The extracted files contain the pine.exe tool required to run the Elm program.
  8. Load memory readings from a file

    main

    You can use the Alternate UI to explore the structure of game client information without a live process by loading previously saved JSON memory readings.

    1. Open the Alternate UI in your browser.
    2. In the 'Select a source for the memory reading' section, select the From file radio button.
    3. Load your JSON file.
    4. Use the interactive tree view to expand and collapse nodes to explore the data structure.
    ."C:\replace-this-the-path-on-your-system\pine.exe"  run-server  --public-urls="http://*:80"  --deploy=https://github.com/Arcitectus/Sanderling/tree/f417f147520a89b1c522fe8dcdd63c77a1d338a1/implement/alternate-ui/source"},{
  9. Read memory from a live EVE Online process

    main

    To inspect the live state of the game, connect the Alternate UI directly to a running EVE Online client.

    1. Ensure the EVE Online client is running.
    2. In the Alternate UI, select the From live game client process radio button.
    3. The system will begin searching for the UI tree root. This setup typically completes within 20 seconds.
    4. Once successful, you will see the message: Successfully read from the memory of the live process.
    5. Exporting Data: You can click the button labeled Click here to download this reading to a JSON file to save the current state for later inspection or collaboration.

    Note: If the EVE Online client is not detected, the tool will log: Looks like there is no EVE Online client process started. I continue looking in case one is started... and will retry once per second.

  10. Troubleshoot 'Parameter is not valid' error in read-memory-64-bit

    main

    If you encounter the following error:

    Unhandled exception. System.ArgumentException: Parameter is not valid.
       at System.Drawing.SafeNativeMethods.Gdip.CheckStatus(Int32 status)
       at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
       at read_memory_64_bit.Program.GetScreenshotOfWindowClientAreaAsBitmap(IntPtr windowHandle)

    This is caused by the target process's main window being minimized.

    Solution: Ensure the game client window is visible and not minimized before running the tool.