Skip to content

skript023/Mono-Hacking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

180 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

C++ Logo

Valheim Hacks

A C++ framework for exploring and reverse engineering Mono / Unity-based games.
Built for direct interaction with the Mono runtime.

โš ๏ธ Strictly for educational and research purposes only.


๐Ÿ“Œ Overview

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)

๐Ÿงฉ Core Framework Features

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

๐ŸŽฎ Game Modules (Valheim)

These features are built on top of the framework and are specific to game behavior manipulation.

๐Ÿ‘ค Player (Self)

  • 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.)

๐ŸŽ’ Inventory

  • Override item properties:
    • Durability
    • Quality
    • Stack size
    • Variant
  • Custom drop amount

๐ŸŒ World

  • Tame all animals (deer, boar, wolf)
  • World interaction utilities

๐Ÿ‘ฅ Online Players

  • Player list retrieval via Mono
  • Dynamic submenu generation per player
  • Extendable for player-specific actions

๐Ÿ‘๏ธ ESP

  • Player/entity ESP
  • Name, health, box rendering
  • Line & skeleton visualization

๐ŸŽฏ Aimbot

  • Aimbot with configurable:
    • FOV
    • Smoothness
    • Trigger key
  • Triggerbot
  • FOV visualization
  • Optional teleport targeting

๐Ÿ“ Teleport System

  • Forward teleport
  • Custom teleport system
  • Save/load locations by category
  • Persistent teleport storage
  • Rotation-aware teleportation

๐Ÿง  Architecture Overview

The project is divided into two main layers:

Core Layer

Handles:

  • Mono interaction
  • Memory / hooks
  • Scripting engine
  • UI system

Feature Layer

Handles:

  • Game-specific logic
  • Player modifications
  • ESP / Aimbot / Teleport
  • High-level gameplay manipulation

๐Ÿงต Example: Dynamic UI System

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);
});

๐Ÿ“œ JavaScript Scripting (QuickJS)

This project integrates QuickJS, enabling runtime scripting using JavaScript.

This allows rapid prototyping and dynamic interaction with the game without rebuilding the project.

Capabilities

  • Call exposed native C++ bindings
  • Interact with Mono classes and objects
  • Execute scripts on-the-fly
  • Build features faster before porting to C++

Example

// 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);
  });
});

Packages

 
 
 

Contributors

Languages