> For the complete documentation index, see [llms.txt](https://kaizo-1.gitbook.io/kaizo-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kaizo-1.gitbook.io/kaizo-docs/lua-engine/unsafe-memory/essentials.md).

# Essentials

The important Unsafe memory functions.

Raw memory is easy to misuse. Prefer SDK when you can.

Writes are queued and need Disable memory writes off.

## unsafe\_memory.module\_base

Game module base address.

[unsafe\_memory.module\_base](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory.module_base.md)

```lua
local base = unsafe_memory.module_base()
```

## unsafe\_memory.rva

Base plus offset.

[unsafe\_memory.rva](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory.rva.md)

```lua
local addr = unsafe_memory.rva(0x1234)
```

## unsafe\_memory.is\_mapped

Check if an address looks readable before you touch it.

[unsafe\_memory.is\_mapped](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory.is_mapped.md)

```lua
if unsafe_memory.is_mapped(addr, 8) then
    log.info("ok")
end
```

## read and write u64

Most common raw number helpers.

[unsafe\_memory u64 get/set](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory-u64-get-set.md)

```lua
local v = unsafe_memory.read_u64(addr)
unsafe_memory.write_u64(addr, v)
```

## Also useful

* [unsafe\_memory u32 get/set](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory-u32-get-set.md)
* [unsafe\_memory f32 get/set](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory-f32-get-set.md)
* [unsafe\_memory.read\_string](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory.read_string.md)
* [unsafe\_memory bytes get/set](/kaizo-docs/lua-engine/unsafe-memory/unsafe_memory-bytes-get-set.md)


---

# 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://kaizo-1.gitbook.io/kaizo-docs/lua-engine/unsafe-memory/essentials.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.
