Engine Specific API

Unreal Engine Helpers (unreal_engine)

The unreal_engine table contains helpers for working with Unreal Engine games (UE4 / UE5).


unreal_engine.read_tarray

unreal_engine.read_tarray(proc, tarray_address[, max_count]) -> table

Reads an Unreal-style dynamic array (TArray) and returns its contents as a Lua array of pointers.

Parameters

  • proc Process object used for reading game memory.

  • tarray_address Integer address of the array in game memory.

  • max_count (optional, default: 4096) Maximum number of elements to read. Used as a safety limit.

Returns

  • A Lua array table indexed from 1 upward, containing integer addresses (pointers).

  • If anything is invalid (bad address, null pointer, weird count), an empty table is returned.

Example

local actors = unreal_engine.read_tarray(proc, actors_array_addr, 1024)

for i, actor_ptr in ipairs(actors) do
    -- actor_ptr is an integer address inside the game
end

unreal_engine.read_minimal_view_info

unreal_engine.read_minimal_view_info(proc, view_info_address) -> table

Reads a camera/view structure and converts it into a normalized Lua table.

Parameters

  • proc Process object.

  • view_info_address Address of the camera/view information in memory.

Returns

A table with this structure:

{
  location = { x = number, y = number, z = number },
  rotation = { pitch = number, yaw = number, roll = number },
  fov      = number
}

If the address or process is invalid, an empty table is returned.

Example

local view = unreal_engine.read_minimal_view_info(proc, camera_addr)

if view.fov then
    local s = unreal_engine.world_to_screen({ x = 0, y = 0, z = 200 }, view)
    -- ...
end

unreal_engine.read_minimal_view_info_f64

unreal_engine.read_minimal_view_info_f64(proc, view_info_address) -> table

Same purpose as read_minimal_view_info, but for layouts that use double-precision values (common in some UE5 setups).

Parameters

  • proc Process object.

  • view_info_address Address of the camera/view information in memory.

Returns

Same shape as the float version:

{
  location = { x = number, y = number, z = number },
  rotation = { pitch = number, yaw = number, roll = number },
  fov      = number
}

If inputs are invalid, returns an empty table.

Example

-- Example when you know the game uses a double-precision view structure:
local view = unreal_engine.read_minimal_view_info_f64(proc, view_addr)
local screen = unreal_engine.world_to_screen({ x = 1000, y = 500, z = 150 }, view)

unreal_engine.world_to_screen

unreal_engine.world_to_screen(world_position, view_info) -> table | nil

Projects a point from world space to screen space using camera data.

Parameters

  • world_position Can be either:

    • A table: { x = number, y = number, z = number }, or

    • Three numbers: x, y, z

  • view_info The camera table returned from:

    • unreal_engine.read_minimal_view_info, or

    • unreal_engine.read_minimal_view_info_f64

    Must contain:

    view_info = {
      location = { x, y, z },
      rotation = { pitch, yaw, roll },
      fov      = number
    }

Returns

  • On success (point is in front of the camera):

    {
      x       = number,  -- screen X (pixels)
      y       = number,  -- screen Y (pixels)
      visible = true
    }
  • If the point is behind the camera: nil.

  • If input is invalid: a Lua error is raised.

Example

local view = unreal_engine.read_minimal_view_info(proc, camera_addr)

local pos = { x = enemy.x, y = enemy.y, z = enemy.z + 80 }
local screen = unreal_engine.world_to_screen(pos, view)

if screen and screen.visible then
    -- draw box, text, etc. at screen.x, screen.y
end

Source 2 Helpers (source2)

The source2 table contains helpers for working with Source 2 games.


source2.world_to_screen

source2.world_to_screen(world_position, view_matrix16) -> table | nil

Projects a world-space point using a 4×4 row-major view-projection matrix.

Parameters

  • world_position Either:

    • Table { x = number, y = number, z = number }, or

    • Three numbers: x, y, z

  • view_matrix16 A Lua array with 16 numeric values:

    local m = {
        m00, m01, m02, m03,
        m10, m11, m12, m13,
        m20, m21, m22, m23,
        m30, m31, m32, m33
    }

    The matrix should be the combined view-projection matrix for the current camera.

Returns

  • On success:

    {
      x       = number,
      y       = number,
      visible = true
    }
  • If the point is behind the camera: nil.

  • If view_matrix16 does not contain at least 16 numbers: a Lua error is raised.

Example

local world_pos = { x = 100.0, y = 200.0, z = 50.0 }
local screen = source2.world_to_screen(world_pos, view_matrix)

if screen and screen.visible then
    -- draw overlay at screen.x, screen.y
end

Fortnite Helper

A small helper for reading player names in Fortnite.


fortnite_get_player_name

fortnite_get_player_name(proc, address) -> string

Attempts to read and decode a player name from game memory.

Parameters

  • proc Process object.

  • address Address pointing to a name-related structure in Fortnite.

Returns

  • The player name as a string on success.

  • An empty string "" if:

    • The process is invalid,

    • The memory cannot be read safely,

    • The decoded name is empty.

Example

local name = fortnite_get_player_name(proc, name_struct_addr)

if name ~= "" then
    print("Player name:", name)
end

Rust Helper

A helper for getting world-space transform positions in Rust (Unity).


rust_get_transform_position

rust_get_transform_position(proc, address) -> x, y, z

Resolves the world-space position of a Unity transform hierarchy used by Rust.

Parameters

  • proc Process object.

  • address Address of a transform-related structure for a given entity.

Returns

  • On success: three numbers x, y, z (Lua returns them as multiple values).

  • On failure (invalid process, invalid address, or any internal error): 0, 0, 0.

Example

local x, y, z = rust_get_transform_position(proc, transform_addr)

if x ~= 0 or y ~= 0 or z ~= 0 then
    local screen = unreal_engine.world_to_screen({ x = x, y = y, z = z }, view_info)
    if screen and screen.visible then
        -- draw marker on that entity
    end
end

Last updated