Skip to content

Latest commit

History

101 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Quest Modloader Banner

Quest UE4 Modloader

A universal Lua modding framework for Unreal Engine 4 games on Meta Quest

BuildReleaseLicenseWiki

FeaturesQuick StartBuildingCreating ModsLua APIWikiContributing


Overview

Quest UE4 Modloader is a C++ injection framework that adds UE4SS-compatible Lua scripting to Unreal Engine 4 games running on Meta Quest (Android ARM64). Originally built for Resident Evil 4 VR, it is designed to be universal — adaptable to any UE4 title on Quest with minimal changes.

The modloader is injected as a shared library (libmodloader.so) and provides:

  • Full UE4 reflection access — read/write any UObject property, call any UFunction
  • Lua 5.4 scripting — write mods in Lua with a rich, documented API
  • Hot-reload — push mod changes without rebuilding the modloader
  • Live debugging — TCP bridge for real-time exec_lua commands via ADB
  • ProcessEvent hooking — pre/post hooks on any Blueprint or native UFunction
  • Native ARM64 hooking — Dobby-powered inline hooks on stripped native functions
  • PAK mounting — inject custom .pak content before engine initialization
  • SDK generation — auto-dump all classes, structs, and enums from the running game

Features

Core Engine

FeatureDescription
🔧 UObject ReflectionRead/write properties, call functions via Get/Set/Call
🪝 ProcessEvent HooksPre/post hooks on any UFunction — block, modify, or observe
🔩 Native HooksDobby ARM64 inline hooks for stripped C++ functions
📦 PAK MountingMount custom .pak files before engine init
🧩 Mod LoaderAuto-discovers and loads Lua mods from mods/<Name>/main.lua
🌐 ADB BridgeTCP JSON bridge (port 19420) for live exec_lua and commands
📋 SDK DumperAuto-generates full SDK (classes/structs/enums) from reflection

Lua API Highlights

FeatureDescription
🔍 FindFirstOf / FindAllOfFind live UObject instances by class name
📝 obj:Get / obj:SetRead/write properties via reflection
📞 obj:CallInvoke UFunctions via ProcessEvent
🏗️ CreateWidgetCreate UMG widgets via WidgetBlueprintLibrary
📐 LuaUStructFull struct support (FVector, FRotator, etc.) with field access
⏱️ TimersExecuteWithDelay, LoopAsync, ExecuteInGameThread
💾 ModConfigPer-mod JSON config persistence
🔗 SharedAPICross-mod communication table

Developer Tools

ToolDescription
deploy.pyAll-in-one deploy script (mods, modloader, logs, launch, SDK)
Bridge ConsoleInteractive REPL for live Lua execution on device
SDK DumpFull class/struct/enum dump for IntelliSense
IDA MappingDumper-7-style function-rename scripts for IDA/Ghidra — see docs/IDA_MAPPING.md
LSPosed ModuleRoot injection with no APK patching — see lsposed-module/

Quick Start

Prerequisites

  • Meta Quest (Quest 2/3/Pro) with developer mode enabled
  • ADB installed and device connected (USB or wireless)
  • APK Patching Required to load libmodloader.so — or use the LSPosed module to inject via root with no patching
  • Android NDK r23c (for building from source — see Building)
  • Python 3.8+ (for deployment tools)

Installation

  1. Download the latest release from Releases
  2. Extract the archive — you'll get libmodloader.so and the mods/ folder
  3. Push to your Quest:
    adb push libmodloader.so /sdcard/UE4Mods/libmodloader.so
    adb push mods/ /sdcard/UE4Mods/mods/
  4. Launch the game — mods load automatically

Deploy Script (Recommended)

# Configure your device in tools/deploy.py, then:
python tools/deploy.py all # Push modloader + all mods
python tools/deploy.py launch # Kill + relaunch game
python tools/deploy.py log # Pull latest log
python tools/deploy.py console # Interactive bridge REPL

Building

Requirements

  • CMake 3.22+
  • Ninja build system
  • Android NDK r23c (23.1.7779620)
  • C++17 compiler (provided by NDK)

Build from Source

# Clone with submodules
git clone --recursive https://github.com/xAstroBoy/quest-ue4-modloader.git
cd quest-ue4-modloader
# Set NDK path (or edit modloader/build.bat)set NDK=C:\Android\ndk\23.1.7779620
# Buildcd modloader
.\build.bat # Windows# OR
./build.sh # Linux/macOS (CI)

The output libmodloader.so will be in modloader/build/.

GitHub Actions

Every push to main and every pull request triggers an automatic build via GitHub Actions. Pre-built binaries are attached to every Release.

Creating Mods

Mods are Lua scripts placed in mods/<ModName>/main.lua. They're loaded automatically on game start.

Minimal Example

-- mods/HelloWorld/main.luaLog("Hello from HelloWorld mod!")
-- Find a game objectlocalplayer=FindFirstOf("PlayerController")
ifplayerandplayer:IsValid() thenLog("Player found: " ..player:GetName())
end

Toggle Mod (with Debug Menu)

-- mods/MyToggle/main.lualocalenabled=false-- Register in the debug menu (requires DebugMenuAPI mod)ifSharedAPIandSharedAPI.DebugMenuthenSharedAPI.DebugMenu.RegisterToggle("MyToggle", "My Feature", false, function(state)
enabled=stateLog("MyToggle: " .. (stateand"ON" or"OFF"))
end)
end-- Hook a game functionRegisterPostHook("/Script/Game.MyClass:MyFunction", function(self, func, parms)
ifnotenabledthenreturnend-- Modify behavior when enabledlocalobj=self:get()
obj:Set("SomeProperty", 42)
end)

ProcessEvent Hook

-- Pre-hook: return "BLOCK" to prevent the original from runningRegisterPreHook("/Script/Game.DamageSystem:ApplyDamage", function(self, func, parms)
return"BLOCK" -- Block all damageend)
-- Post-hook: modify return values or read resultsRegisterPostHook("/Script/Game.Player:GetHealth", function(self, func, parms)
WriteU8(parms, 100) -- Override return to always 100end)

See the examples/ directory and the Wiki for more.

Lua API

Full API reference: docs/LUA_API.md | Wiki: Lua API

API Categories (click to expand)
#CategoryKey Functions
1LoggingLog, LogWarn, LogError, print
2NotificationsNotify(title, body)
3Object FindingFindFirstOf, FindAllOf, FindClass, FindObject
4ConstructionConstructObject, CreateWidget
5UObject MethodsGet, Set, Call, IsValid, GetName, GetClass
6ProcessEvent HooksRegisterPreHook, RegisterPostHook, RegisterHook
7Native HooksRegisterNativeHook, CallNative
8Memory R/WReadU8ReadU64, WriteU8WriteU64, ReadFloat
9TimersExecuteWithDelay, LoopAsync, ExecuteInGameThread
10StructsLuaUStruct — Clone, CopyFrom, GetFields, field access
11TArray1-indexed, ForEach, Add, #arr
12EnumsEnums.*, FindEnum, GetEnumTable, AppendEnumValue
13ConfigModConfig.Load, ModConfig.Save
14File I/OReadTextFile, WriteTextFile, FileExists
15BridgeRegisterBridgeCommand

Project Structure

quest-ue4-modloader/
├── modloader/ # C++ modloader core
│ ├── CMakeLists.txt # CMake build config
│ ├── build.bat / build.sh # Build scripts
│ ├── src/ # Source files
│ │ ├── main.cpp # Entry point (JNI_OnLoad)
│ │ ├── core/ # Init, config, symbols, pattern scanner
│ │ ├── hook/ # ProcessEvent + native Dobby hooks
│ │ ├── lua/ # Lua 5.4 bindings (sol2)
│ │ ├── reflection/ # UE4 reflection walker, SDK dump
│ │ ├── mods/ # Mod discovery and loading
│ │ ├── pak/ # Custom PAK mounting
│ │ ├── bridge/ # ADB TCP bridge
│ │ └── util/ # Logger, crash handler, notifications
│ ├── include/ # Header files
│ └── third_party/ # Vendored deps (Lua 5.4, sol2, Dobby, nlohmann/json)
│
├── mods/ # Lua mods (each in own folder)
│ ├── DebugMenuAPI/ # In-game mod menu system
│ ├── GodMode/ # Invincibility
│ ├── NoRecoil/ # Remove weapon recoil
│ └── ... # 21 mods included
│
├── examples/ # Example mods for learning
│ ├── HelloWorld/
│ ├── SimpleToggle/
│ ├── PropertyHook/
│ └── NativeHook/
│
├── tools/ # Python deployment & testing tools
│ └── deploy.py # Main deploy/test/console tool
│
├── docs/ # Documentation
│ └── LUA_API.md # Complete API reference
│
└── wiki/ # GitHub Wiki source pages

Supported Games

GamePlatformStatus
Resident Evil 4 VRQuest 2/3✅ Fully supported (primary target)
Other UE4 Quest titlesQuest 2/3🔄 Adaptable (universal design)

Making it universal: The modloader's core (reflection, hooks, Lua bindings) is game-agnostic. Game-specific parts are limited to symbol addresses and mod scripts. See the Wiki: Porting Guide for adapting to other titles.

Wiki

The Wiki contains detailed documentation:

PageDescription
HomeOverview and navigation
Getting StartedSetup, installation, first mod
Lua API ReferenceComplete API documentation
Creating ModsMod development guide
ArchitectureHow the modloader works internally
Debug Menu APIIn-game menu system for mods
Porting GuideAdapting to other UE4 Quest games
TroubleshootingCommon issues and solutions

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a PR.

  • 🐛 Bug reports — use the Bug Report template
  • Feature requests — use the Feature Request template
  • 🔧 Mod submissions — PRs welcome for new example mods
  • 📝 Documentation — Wiki improvements always appreciated

License

This project is licensed under the MIT License — see LICENSE for details.

Credits

  • Dobby — ARM64 inline hooking framework
  • sol2 — C++/Lua binding library
  • Lua 5.4 — Scripting language
  • nlohmann/json — JSON library
  • UE4SS — Inspiration for the Lua API design

Made with ❤️ for the Quest modding community

About

Universal Lua modding framework for Unreal Engine games compiled on arm64 — Android, Dobby hooks, full UE4 reflection, live ADB bridge, designed to be universal.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

16 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages