OLD-7084: restore old upstream PR 7084 - pe_inspect: classify system DLLs on Linux through the Wine prefix, bundled names without case #653
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!653
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/653/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@aslan2142 on GitHub · 2026-11-24 11:01 UTC · original
aslan2142:pe-inspect-linux-classes→main· +440 −12 · 5 files · 6 commits · merged 2026-11-25 22:19 UTCClaimed in the coordination issue as: OLD-7084 #14
Restoration of my original pull request, old upstream PR 7084 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c; no changes beyond the rebase.Depends on: #45 (conflicts only in
tests/test_pe_inspect.py, both add tests at the end; keeping both blocks resolves it)What and why
On a host that isn't Windows,
classify_dllintools/pe_inspect.pymarked the C runtime and every system DLL asshim, so the first look's to-do list was wrong there. There were three causes:MSVCP140.dllmissed the package'smsvcp140.dll.The change:
system32($WINEPREFIX, else~/.wine). API sets are resolved through the prefix'sapisetschema.dll(version-6 schema), because Wine installs no file for most of them.unverified, shown assystem (unverified). The shims' DLLs are theSHIM_TABLEs inruntime/shims, less the host DLLs thatowns_dllleaves out.scripts/first_look.ps1lists these DLLs after the to-do and prints a warning.system_dllsfield, plus a line in the Markdown and stdout summaries, says where system DLLs were checked.docs/design.md(day one, import table) andREADME.md(setWINEPREFIXon Linux) describe the above.Tested
Linux, Python 3.14.10, CPU only, synthetic PE images and temporary folders standing in for the game folder and the Wine prefix. No game files.
python -I tests/test_pe_inspect.py:pe_inspecthas noIS_WINDOWS).test_system_dll_is_classified_system, which needs Windows).python -I tests/test_text_write_line_endings.py: OK.python -m compileall -q tools tests,git diff --checkandpython -I scripts/check_no_game_data.pyon the five changed files: clean.scripts/first_look.ps1was not run (no PowerShell or game executable here).GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
@Poussistar on GitHub · 2026-11-24 18:09 UTC · original
Verified at head against
main3aa975421d(clean worktree,git apply pull/653.diff): the PR's own test file is red, and it is a real classification bug rather than a too-strict test.Clean
mainon the same file:Ran 60 tests ... OK (skipped=1), so the red is this PR's own.Cause:
owns_dllgainedws2_32.dllandwsock32.dllin itshost[]list (runtime/shims/registry.cpp:497-498; host-owned with a partial override, likekernel32.dll), andruntime/shims/ws2_offline.cpphas aSHIM_TABLEthat names both._SHIM_HOST_DLLShere stops atuser32.dll, so:Those two are then reported as
shimoff Windows, while the registry does not own them — the same false classification this PR removes for the others.One-line fix, following the order of
owns_dll's table:With it:
Ran 67 tests ... OK (skipped=1),runtime_shim_dlls()gives 14 names withws2_32.dll: False, wsock32.dll: False, andtest_text_write_line_endings.pyplustest_docs_cli_flags.py/test_docs_links.pystill pass. Negative control: the same file without the two names is the failure above.Linux host, CPython 3.14.7, no game files. AI-assisted.
@aslan2142 on GitHub · 2026-11-25 00:29 UTC · original
Thanks for running it and finding the cause.
4532b5b75:_SHIM_HOST_DLLSnow listsws2_32.dllandwsock32.dll, in the same order asowns_dll's host list inruntime/shims/registry.cpp, soruntime_shim_dlls()no longer reports them asshimoff Windows.mainis merged in first (70d615b3b, no conflicts), so the branch carries theowns_dlllist the test compares with.python -I tests/test_pe_inspect.py, 67 tests OK (1 skipped), plustest_tool_startup,test_tool_stdout_encoding, thetest_docs_*files,test_text_write_line_endings,test_ci_registrationandcheck_no_game_data.pyon the changed files.AI-assisted (Claude Code, Claude Opus 5.5).
@aslan2142 on GitHub · 2026-11-25 22:20 UTC · original
Merged:
pe_inspectclassifies system DLLs on Linux through the Wine prefix.mainmerged in.mainaddedadvapi32.dlltoowns_dll's host list inruntime/shims/registry.cpp, which madetest_runtime_shim_dlls_follow_the_registryfail._SHIM_HOST_DLLSnow lists it too, in the same order. The earlierws2_32.dll/wsock32.dllpoint was fixed in4532b5b75.tests/test_pe_inspect.pypasses (1 skipped), and so dotest_tool_startup, the docs tests,test_ci_registrationandtest_ctest_registration.test_tool_stdout_encodingfails the same way onmainalone, on tools this PR doesn't touch.main392dda8f0+ca9e45dbd: the semantic suite passes (492 files, 6,315 tests, 0 files failed);test_pe_inspectpass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 5 changed files.AI-assisted (Claude Code, Claude Opus 5.5).