asr::game_engine

Module godot

Source
Available on crate feature godot only.
Expand description

Support for games using the Godot engine.

The support is still very experimental. Currently only games using Godot 4.2 without any debug symbols are supported.

The main entry point is SceneTree::locate, which locates the SceneTree instance in the game’s memory. From there you can find the root node and all its child nodes. Nodes may also have attached scripts, which can also be accessed and queried for their members.

§Example

use asr::game_engine::godot::SceneTree;

// We first locate the SceneTree instance.
let scene_tree = SceneTree::wait_locate(&process, main_module_address).await;

// We access the root node of the SceneTree.
let root = scene_tree.wait_get_root(&process).await;

// We print the tree of nodes starting from the root.
asr::print_limited::<4096>(&root.print_tree::<64>(&process));

§Extensibility

The types and the code are closely matching the Godot source code. If there is anything missing, chances are that it can easily be added. Feel free to open an issue or contribute the missing parts yourself.

Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md).

Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Structs§

CSharpGCHandle
A handle to a C# object. This is not publicly exposed in Godot.
CSharpScript
A script implemented in the C# programming language, saved with the .cs extension (Mono-enabled builds only).
CSharpScriptInstance
An instance of a script implemented in the C# programming language. This is not publicly exposed in Godot.
CanvasItem
Abstract base class for everything in 2D space.
CharacterBody2D
A 2D physics body specialized for characters moved by script.
CharacterBody3D
A 3D physics body specialized for characters moved by script.
CollisionObject2D
Abstract base class for 2D physics objects.
CollisionObject3D
Abstract base class for 3D physics objects.
CowData
A copy-on-write data type. This is not publicly exposed in Godot.
GDScript
A script implemented in the GDScript programming language.
GDScriptInstance
An instance of a script implemented in the GDScript programming language. This is not publicly exposed in Godot.
HashMap
A hash map that maps keys to values. This is not publicly exposed as such in Godot, because it’s a template class. The closest equivalent is the general Dictionary.
HashSet
A hash set that uniquely stores each element. This is not publicly exposed in Godot.
List
A linked list of elements. This is not publicly exposed in Godot.
MainLoop
Abstract base class for the game’s main loop.
MemberInfo
Information about a member of a script implemented in the GDScript programming language. This is not publicly exposed in Godot.
Node
Base class for all scene objects.
Node2D
A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index.
Node3D
Most basic 3D game object, parent of all 3D-related nodes.
Object
Base class for all other classes in the engine.
PhysicsBody2D
Abstract base class for 2D game objects affected by physics.
PhysicsBody3D
Abstract base class for 3D game objects affected by physics.
PrintTree
A recursive tree printer.
PropertyInfo
Information about a property of a script. This is not publicly exposed in Godot.
Ptr
A pointer is an address in the target process that knows the type that it’s targeting.
SceneTree
Manages the game loop via a hierarchy of nodes.
Script
A class stored as a resource.
ScriptInstance
An instance of a Script.
String
A built-in type for strings.
StringName
A built-in type for unique strings.
TypeInfo
The class TypeInfo holds implementation-specific information about a type, including the name of the type and means to compare two types for equality or collating order. This is the class returned by Ptr<VTable>::get_type_info.
VTable
A C++ virtual method table.
Variant
The most important data type in Godot.
VariantType
The type of a Variant.
Vector
A contiguous vector of elements. This is not publicly exposed in Godot.
Viewport
Abstract base class for viewports. Encapsulates drawing and interaction with a game world.
Window
Base class for all windows, dialogs, and popups.

Traits§

Hash
A trait for looking up a key in a hash table. The type of the key to look up does not need to match the type in the target process. However, it needs to hash and compare equally in the same way.
SizeInTargetProcess
The size of a type in the target process.