Commit Graph

18 Commits

Author SHA1 Message Date
0d666fcf4f pe_inspect: classify system DLLs on Linux through the Wine prefix, bundled names without case
On a host that isn't Windows, classify_dll marked the C runtime and every
system DLL `shim`: the bundled check was case-sensitive (an import of
MSVCP140.dll missed the package's msvcp140.dll), System32 doesn't exist and
the API-set query only works on Windows. The first look's to-do list was
wrong there.

- bundled: the game folder is listed once and compared lower-cased.
- elsewhere than Windows, `system` is checked in the Wine prefix's system32
  ($WINEPREFIX, else ~/.wine), without case, and API sets through the
  prefix's apisetschema.dll (version-6 schema; Wine installs no file for
  most of them).
- with no prefix, a DLL that is neither bundled nor owned by the runtime's
  shims (SHIM_TABLEs in runtime/shims, less owns_dll's host list) is
  "unverified", shown as `system (unverified)`; first_look.ps1 lists those
  after the to-do and warns.
- the report's new `system_dlls` field and the Markdown/stdout summary say
  where system DLLs were checked. Windows classification is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:00:38 -05:00
849d3709b9 first_look: resolve literal paths for the executable and its reports (#3175)
Squash-merged after diff review of PR #3175
2026-11-23 09:50:47 -06:00
86fd2fda81 first_look: use the existing Visual Studio loader build (#3510)
Squash-merged after diff review of PR #3510 - first_look: use the existing Visual Studio loader build
2026-11-23 09:40:42 -06:00
561b65a832 Merge remote-tracking branch 'origin/main' into triage-r44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	.github/workflows/runtime.yml
#	tests/test_first_look_shim_report.py
2026-11-23 06:28:03 -05:00
902358c8aa tools/exe_checklist.py: every ASSUMPTION / UNVERIFIED / VERIFY note in one list for the exe's first look
Collects the marked notes of runtime/src, runtime/shims and docs/*.md with file
and line, each from its marker to the end of its comment run or list item
(trailing 'see the header' comments are left out). Given gdk_runtime_calls'
JSON, a shim's notes are marked called / not called by whether the executable
calls a class that file serves, called first. first_look.ps1 writes
reports/exe/<name>/checklist.md. tests/test_exe_checklist.py: 6 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:00:14 -05:00
a2e5b153b0 Merge pull request #4560 from mohamedsaad.lahlou
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:56 -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
be8570ace1 Merge remote-tracking branch 'origin/main' into triage-r43
# Conflicts:
#	docs/runtime_imports.md
#	runtime/CMakeLists.txt
#	runtime/shims/xgameruntime.cpp
#	runtime/test/xmem_test.cpp
#	tools/rdna2spirv.py
2026-11-22 22:12:50 -05:00
a021da3bfa First look: rebuild when the loader TLS helper is missing 2026-11-23 03:27:37 +01:00
6fedabb12d first_look.ps1: rebuild gta6rt.exe when it is older than the runtime sources
It built the loader only when runtime\build\gta6rt.exe was missing, so after a pull the day-one dry run used the
old binary and its shim to-do list described the old shim table, with no error. A loader older than any file under
runtime\src, runtime\shims or runtime\CMakeLists.txt is now rebuilt first (the copy on this machine was two days
behind main). tests/test_first_look_rebuild.py covers both cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:19:13 -05:00
7fd5e7614f Merge pull request #3455 from Sebastião
# Conflicts:
#	docs/design.md
2026-11-22 17:02:07 -05:00
95f822d11b Add gdk_runtime_calls: list the runtime classes and slots an image calls through xgameruntime.lib
A title linked with xgameruntime.lib imports no GDK function: each thunk asks
QueryApiImpl (through a helper) for a class and interface, calls one vtable
slot and releases the object. tools/gdk_runtime_calls.py finds those thunks in
a PE without running it: the helper a known id's lea feeds, every call to it,
the class id in rcx and the interface id in rdx (unknown ids reported as such,
calls whose ids it can't read listed) and each slot called up to Release (CFG
dispatch, call [r+disp8/disp32], any vtable register, register copies
followed), scoped by .pdata or a byte window. Slots are named from
tools/gdk_runtime_classes.json (ids, inheritance and method order of
xgameruntime-docs, GPL-3.0, facts only; made by
tools/gen_gdk_runtime_classes.py). The report flags classes
runtime/shims/xgameruntime.cpp serves, estimates argument counts, says whether
anything in the image reaches each thunk, and lists known ids no thunk uses.
Text by default, --json, --out DIR.

Measured on the package: XCurl.dll and the four classes read by hand in
libHttpClient.GDK.dll match the slots in docs/runtime_imports.md.
libHttpClient holds the ids of 23 of the 24 documented classes (not
XGameActivationImpl's) and thunks for all 23, but is incrementally linked and
references only 15 of its 404 thunks (XThreadingImpl, XErrorImpl); the
module table now says so instead of "24 of 24, five called through thunks".
scripts/first_look.ps1 runs the tool on the executable, and the day-one
checklist in docs/design.md points at its report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:28:05 +00:00
1057331f91 Merge pull request #3222 from desamodeth 2026-11-22 15:15:56 -05:00
fc1f9b3cb1 first_look: refresh the shim report when all dependencies are present
AI-assisted-by: Codex Astra 6.2 High
2026-11-22 22:44:19 +03:00
8534220f5f Keep stderr in first_look dry-run reports 2026-11-22 18:39:42 +01:00
5b08d8f9dc Return the loader exit status from first_look 2026-11-22 18:32:36 +01:00
41cb7c541c pe_inspect.py: one report per input image (same-stem inputs overwrote each other)
Reports were named after the image's stem, so game.exe + game.dll, or a/x.exe +
b/x.exe, in one call wrote the same <out>/<stem>.json/.md and the last one won,
with exit 0. Reports are now named after the full file name (game.exe.json,
game.dll.md); a second image with the same file name from another directory
gets a numbered suffix (x.exe-2.json), compared case-insensitively, and the
name used is printed to stderr. The same path given twice is inspected once.

scripts/first_look.ps1, the only consumer of the report name, reads
<exe file name>.json. Tests cover the exe/dll pair and the two-directory case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:49:13 +01:00
db0dc8bd5e Initial commit: Leonida, build-it-yourself PC port groundwork
Shader pipeline (carve, FSSM unpack, gfx1013 disassembly, RDNA2 to SPIR-V),
asset export via rpf9-explorer's Core (submodule), PE loader and shim
skeleton, and make_game.py, which builds from the user's own copy of the game.
No game data, keys or executables are included.

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