Commit Graph

8 Commits

Author SHA1 Message Date
5a8af54cbd build(linux): add Build.sh and Mods.sh, the shell counterparts of Build.bat and Mods.bat
Linux and macOS had no one-command entry point: Build.bat and Mods.bat are
cmd.exe scripts. Build.sh and Mods.sh find Python 3.12 or newer (the
versioned python3.N first, since a distribution's python3 can be older)
and run make_game.py or the mod manager's window with -I, passing every
argument through. They install and download nothing.

tests/test_shell_launchers.py runs both against stub interpreters on a
private PATH. The mod manager's missing-Tkinter message now names the
distribution package off Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:51:04 -05:00
234d657349 mods: the mod manager and four manifest-only examples
tools/leonida_mods.py manages the port's mods folder: create, install,
list, check, enable, disable, pack, remove and a gta6rt launcher, with a
Tkinter window behind Mods.bat on Windows. Packages are plain ZIPs with
mod.json at the top level; the installer refuses paths that climb out of
the package and never touches game data. mods/ ships four archetype-swap
examples, three of them installed disabled.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-23 13:47:00 -07:00
15a686db31 docs: mark the d3d12_vulkan.md and modding.md notes the executable checklist was missing (#5288)
Squash-merged after diff review of PR #5288
2026-11-23 10:38:03 -06:00
a637671a94 mods: a mod.json with a UTF-8 byte-order mark loads; UTF-16 is named; contexts are bounded before the cast (#6724)
Squash-merged after diff review of PR #6724 - mods: a mod.json with a UTF-8 byte-order mark loads; UTF-16 is named; contexts are bounded before the cast
2026-11-23 10:00:38 -06:00
98fa503f8a Mods: first-person view, the base (camera section, view-mode getter hook)
mod.json gains "camera": {"view_mode": "first_person"|"default", "first_person_value", "contexts"}.
gta6rt --view-mode-getter RVA hooks the game's view-mode getter with a result-override thunk (code_hooks.h:
the original runs, then its result and first argument go through leonida::mods::override_view_mode), so the listed
contexts answer first person and the others keep the game's mode. mods/first_person asks for it on foot.

docs/modding.md records why switching a mode is enough: the game's tuning data refers to a first-person view
(FirstPersonDirectionDot, UseFirstPersonCameraMatrix on cloth capsules, FIRST_PERSON_VIEW hit-reaction recovery, a
firstpersonshooter HUD texture; RDR2's engine branch), while GTA V's camera class names are not present by joaat.
The context numbering and the first-person enum value (4, GTA V's) are manifest settings to confirm in the
executable. ctest mods and code_hooks cover the parser, the override and the thunk on x64 code in memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:27 -05:00
3eb4410b8d tools/find_hash_lookup.py: rank the archetype-lookup candidates for the mod hook
Reads a PE without running it: finds where the code loads a model hash (default Lucia's player model 0xE472B687 and
cs_mandy 0xD7C0CDFF), takes the direct calls right after, and ranks those targets by how many hashes lead to them and
how many direct callers the whole image has. first_look.ps1 writes hash_lookup.json, so the day-one report already
names the RVA for gta6rt --archetype-lookup (docs/modding.md). A packed or encrypted file is refused with that
reason. tests/test_find_hash_lookup.py runs it on synthetic PE images.

test_first_look_shim_report copies every tool first_look.ps1 runs (it had failed since gdk_runtime_calls.py joined
the script in round 43).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:56:15 -05:00
9e6444fadb Mods: the archetype hook, --archetype-lookup RVA[,ARG]
code_hooks.h hooks a function of the mapped game image without patching it: every direct call/jmp rel32 to it in the
image's executable sections is pointed at a thunk that saves rcx/rdx/r8/r9 and xmm0-3, passes the hash (argument 0
or 1) through leonida::mods::active().remap() and jumps on to the original. gta6rt installs it right after mapping,
before any image code runs, and logs how many call sites it redirected, so a --dry-run with a candidate RVA tells
whether it is the archetype lookup. ctest code_hooks runs the thunk on x64 functions written into memory (call and
tail jump remapped, r8 preserved, a branch elsewhere left byte for byte). With the executable's lookup RVA this
applies mods/mandy_prison_intro; docs/modding.md says how to find it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:53:19 -05:00
db51b7d3f9 Mods: mod.json manifests with archetype swaps, and the Mandy prison-intro mod
gta6rt reads mods/<folder>/mod.json next to gta6rt.exe (or --mods DIR), checks each and logs it. An archetype swap
names two models the game has (by joaat name or 0x hash): when the game asks for `from` it gets `to`. The swaps
are loaded into leonida::mods::active(); they apply once the game's archetype lookup is hooked, which needs the
executable's address for it (docs/modding.md, Day one).

mods/mandy_prison_intro swaps Lucia's player model player_story000_00 (0xE472B687) for cs_mandy (0xD7C0CDFF), the
ids measured in the packs tables; mods_test checks joaat reproduces both. Conditions narrower than "always" are
refused until a hook provides mission state. No game data in either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:41:02 -05:00