A C++ framework for exploring and reverse engineering Mono / Unity-based games.
Built for direct interaction with the Mono runtime.
Valheim Hacks is a lightweight internal framework designed to interface directly with the Mono runtime used in Unity games.
It provides a clean abstraction layer over Mono APIs, allowing native C++ code to interact with managed C# code seamlessly.
With this framework, you can:
- Access classes, methods, and fields from C#
- Invoke managed methods directly from C++
- Read and manipulate in-game objects (Player, Transform, etc.)
- Explore internal structures of Unity games
- Execute runtime scripts using embedded JavaScript (QuickJS)
These are the reusable building blocks of the framework, independent from any specific game logic.
- ๐ Mono reflection helpers (class, method, field)
- ๐ง Clean wrappers for MonoObject, MonoClass, MonoMethod
- ๐ฏ Direct method invocation (
mono_runtime_invoke) - ๐ฆ Utility conversions (e.g.,
List<T>โstd::vector) - ๐งต Worker loop system (tick/update handler)
- ๐ Hook-ready architecture (easy to extend)
- ๐ฅ๏ธ Optional ImGui debug interface
- ๐ Embedded JavaScript engine (QuickJS)
- โก Live scripting without recompilation
- ๐งฉ Modular and extensible design
These features are built on top of the framework and are specific to game behavior manipulation.
- Flying
- Infinite stamina
- No weight
- No item drop on death
- Always wind for sailing
- Teleport with any item
- Skill / stats modifiers (health, stamina, armor, etc.)
- Override item properties:
- Durability
- Quality
- Stack size
- Variant
- Custom drop amount
- Tame all animals (deer, boar, wolf)
- World interaction utilities
- Player list retrieval via Mono
- Dynamic submenu generation per player
- Extendable for player-specific actions
- Player/entity ESP
- Name, health, box rendering
- Line & skeleton visualization
- Aimbot with configurable:
- FOV
- Smoothness
- Trigger key
- Triggerbot
- FOV visualization
- Optional teleport targeting
- Forward teleport
- Custom teleport system
- Save/load locations by category
- Persistent teleport storage
- Rotation-aware teleportation
The project is divided into two main layers:
Handles:
- Mono interaction
- Memory / hooks
- Scripting engine
- UI system
Handles:
- Game-specific logic
- Player modifications
- ESP / Aimbot / Teleport
- High-level gameplay manipulation
canvas::add_submenu<regular_submenu>("ESP", "SubmenuESP"_hash, [](regular_submenu* sub)
{
sub->add_option<bool_option<bool>>("esp_activate"_hash);
sub->add_option<bool_option<bool>>("draw_name"_hash);
sub->add_option<bool_option<bool>>("draw_health"_hash);
});This project integrates QuickJS, enabling runtime scripting using JavaScript.
This allows rapid prototyping and dynamic interaction with the game without rebuilding the project.
- Call exposed native C++ bindings
- Interact with Mono classes and objects
- Execute scripts on-the-fly
- Build features faster before porting to C++
// Hooking Example
detour.add(
"Terminal::ConsoleCommand::IsValid", address, (ctx) => {
console.log("ConsoleCommand", ctx.getArg(0).number().toString(16).toUpperCase());
console.log("Terminal", ctx.getArg(1).number().toString(16).toUpperCase());
console.log("Boolean", ctx.getArg(2).number().toString(16).toUpperCase());
return true;
}
);
detour.enable("Terminal::ConsoleCommand::IsValid");
// Access Max Health Example
const klass = mono.get_class("Player", "assembly_valheim");
console.log("class:", klass);
const field = mono.get_field(klass, "m_baseHP");
console.log("field:", field);
const player = unity.get_local_player();
console.log("player:", player);
mono.set_field_float(player, field, 800.0);
// Add tab menu example
import * as canvas from "canvas";
canvas.add_tab("Test2", 45, sub => {
sub.add_bool("Flying");
sub.add_slider("Max HP", 1, 500, 10);
sub.add_choose("Mode", ["A", "B"], (i, v) => {
console.log(i, v);
});
});