Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

lovely-injector

> 编程语言
Open source

A runtime lua injector for games built with LÖVE

580 stars0 likes2 views
WebsiteGitHub

About

A runtime lua injector for games built with LÖVE

Lovely is a runtime lua injector for LÖVE 2d

Lovely is a lua injector which embeds code into a LÖVE 2d game at runtime. Unlike executable patchers, mods can be installed, updated, and removed over and over again without requiring a partial or total game reinstallation. This is accomplished through in-process lua API detouring and an easy to use (and distribute) patch system.

Manual Installation

Windows + Proton / Wine

  1. Download the latest release for Windows. This will be lovely-x86_64-pc-windows-msvc.zip.
  2. Open the .zip archive, copy version.dll into the game directory. You can navigate to the game's directory by right-clicking the game in Steam, hovering "Manage", and selecting "Browse local files".
  3. Put one or more mods into the mod directory (NOT the same as the game directory). You may need to create the Mods folder yourself, or launch Balatro with lovely installed once to create it automatically. If you are modding Balatro, this should be
  • %AppData%/Balatro/Mods on Windows
  • ~/.steam/steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro/Mods on Steam Deck (~/ will be called Home if you are moving files in the GUI file manager)
  • Flatpak version of Steam: ~/.var/app/com.valvesoftware.Steam/.steam/steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro/Mods
  1. Only Steam Deck / Proton / Wine Set your game's launch options in Steam to WINEDLLOVERRIDES="version=n,b" %command%.
  2. Run the game through Steam.

Mac

  1. Download the latest release for Mac. If you have an M-series CPU (M1, M2, etc.) then this will be lovely-aarch64-apple-darwin.tar.gz. If you have an Intel CPU then it will be lovely-x86_64-apple-darwin.tar.gz
  2. Open the .zip archive, copy liblovely.dylib and run_lovely_macos.sh into the game directory. You can navigate to the game's directory by right-clicking the game in Steam, hovering "Manage", and selecting "Browse local files".
  3. Put one or more mods into the Mac mod directory (NOT the same as the game directory). This should be /Users/$USER/Library/Application Support/Balatro/Mods where $USER is your username (if you are modding Balatro).
    If you can't find this folder, try pressing Shift-Command-. (period) to show hidden files in Finder.
  4. Run the game by either dragging and dropping run_lovely_macos.sh onto Terminal.app in Applications > Utilities and then pressing enter, or by executing sh run_lovely_macos.sh in the terminal within the game directory.

Note: You cannot run your game through Steam on Mac due to a bug within the Steam client. You must run it with the run_lovely_macos.sh script.

Important: Mods with Lovely patch files (lovely.toml or in lovely/*.toml) must be installed into their own folder (or zip file) within the mod directory. No exceptions!

Linux Native

  1. Install love using your distribution's package manager. This is sudo pacman -S love on SteamOS and Arch-based distros, and sudo apt install love on Ubuntu & Debian-based ones.
  2. Download the latest release for Linux. This will be x86_64-unknown-linux-gnu.tar.gz.
  3. Open the .tar.gz archive, copy liblovely.so and run_lovely_linux.sh into the game directory. You can navigate to the game's directory by right-clicking the game in Steam, hovering "Manage", and selecting "Browse local files".
  4. Put one or more mods into the mod directory (NOT the same as the game directory). If you are modding Balatro, this should be ~/.local/share/love/Mods.
  5. Run the game by executing ./run_lovely_linux.sh in the terminal within the game directory (you can copy this file into the directory of choice).

Patches

Note that the patch format is unstable and prone to change until Lovely is out of early development.

Patch files define where and how code injection occurs within the game process. A good (complex) example of this can be found in the Steamodded repo here.

…

TL;DR - Patch variants

  • Use pattern patches to surgically embed code at specific locations within the target. Supports * (matches 0 or more occurrences of any character) and ? (matches exactly one occurrence of any character) wildcards.
  • Use regex patches only when the pattern patch does not fulfill your needs. This is basically the pattern patch but with a backing regex query engine, capture groups and all.
  • Use copy patches when you need to copy a large amount of position-independent code into the target.
  • Use module patches to inject a lua module into the game's runtime. Note that this currently only supports single file modules, but this should be changing soon.

Patch files

Patch files are loaded from mod directories inside of the mod folder (MOD_DIR). Lovely will load any patch files present within MOD_DIR/ModName/lovely/ or load a single patch from MOD_DIR/ModName/lovely.toml. If multiple patches are loaded they will be injected into the game in the order by order of their priority.

Paths defined within the patch are rooted by the mod's directory. For example, core/deck.lua resolves to MOD_DIR/ModName/core/deck.lua.

Patch targets

Each patch definition has one or more patch targets. These targets are typically the relative paths of source files when dumped from the game with a tool like 7zip. For example, one can target a top-level file like main.lua, or one in a subdirectory like engine/event.lua.

For certain games/libraries, files are loaded differently. Targets (or more specifically buffer names) can be arbitrarily anything.

Lovely itself uses the format of =[lovely ""] for buffers loaded via module patch.

Patch debugging

Lovely dumps patched lua source files to MOD_DIR/lovely/dump. Logs are likewise written to MOD_DIR/lovely/log.

Not yet implemented

  • manifest.version

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言