> For the complete documentation index, see [llms.txt](https://docs.xeutrino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xeutrino.com/api-reference/memory.md).

# Raw memory access

These functions read and write absolute memory addresses. Addresses are typically obtained from `get_global_addr` or built from `get_app_base() + RVA`.

| :exclamation: Warning — crash risk                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Raw memory writes can crash the game instantly if you target the wrong address. Validate non-zero addresses first and prefer the `*_global_*` helpers whenever possible. |

## `get_app_base()` → integer

Returns the current eboot base address. Use to turn an offset into a live pointer:

```lua
local addr = get_app_base() + 0x1A0AE60
```

## `read_int(address, size?)` → integer

Reads `size` bytes (1, 2, 4, or 8; default 4) from `address` and returns the little-endian value as a signed 64-bit integer. Returns `0` for a null address.

| Param     | Type    | Description                 |
| --------- | ------- | --------------------------- |
| `address` | integer | Absolute address.           |
| `size`    | integer | 1, 2, 4, or 8. Default `4`. |

## `write_int(address, value, size?)`

Writes the low `size` bytes (1, 2, 4, or 8; default 4) of `value` to `address`. Errors on null address or unsupported size.

| Param     | Type    | Description                 |
| --------- | ------- | --------------------------- |
| `address` | integer | Absolute address.           |
| `value`   | integer | Value to write.             |
| `size`    | integer | 1, 2, 4, or 8. Default `4`. |

## `read_float(address)` → number

Reads a 4-byte float from `address`. Returns `0.0` for null address.

## `write_float(address, value)`

Writes a 4-byte float to `address`.

| Param     | Type    | Description       |
| --------- | ------- | ----------------- |
| `address` | integer | Absolute address. |
| `value`   | number  | Float value.      |

## `write_bytes(address, hexstring)`

Writes an arbitrary byte sequence encoded as a hex string. Length is implied by the string length (must be even).

| Param       | Type    | Description                        |
| ----------- | ------- | ---------------------------------- |
| `address`   | integer | Absolute address.                  |
| `hexstring` | string  | e.g. `"9090C3"` for `NOP NOP RET`. |

```lua
-- Patch 6 bytes at an offset from eboot base
local a = get_app_base() + 0x12345
write_bytes(a, "909090909090")
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xeutrino.com/api-reference/memory.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
