Commit Graph

60 Commits

Author SHA1 Message Date
DotDebian d9852df2a2 fix(libc): track writes to singly mapped direct memory without faults on Windows
A direct memory page mapped at one guest address now lives in private
MEM_WRITE_WATCH memory at that address, and its writes are collected with
GetWriteWatch like flexible memory: no fault is raised. A page mapped at a
second address moves its whole resident run into the section, behind a
read-only fence while it is copied, and every address becomes a view of it,
tracked by write protection. Unmapped resident pages that are not blank are
kept in a private reservation until they are mapped again, not in the
section.

Ported onto main's 4 KiB subpage tracking of shared views: resident runs
keep a per-page collected bit and enter the fresh ranges, so Fresh and
Armed collections select them like shared views; a demoted run carries its
collected bits into the views and reports every page once. MapAlias throws
through refuse() when a resident run extends outside the aliased range, and
the caller keeps main's fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
2026-10-14 02:39:10 +02:00
codingreapermaps 430e5c833e feat(relinker): add --trace-imports for Windows executables
With --trace-imports the entry stub resolves TraceImport_nid_no_patch
in libc.prx and passes each function import through it before writing
the slot: every PLT slot, and a GOT slot only when the original symbol
is a function, so data imports such as __stdoutp keep their address.
Without the option the output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:55:31 +02:00
Adrià 2f5c3a4bf5
Merge pull request #4559 from MarcZX100/codex/import-audit-sectionless-modules
fix(tools): audit sectionless guest modules
2026-10-13 16:43:53 +02:00
Avijit Singh 1796482721 docs(relinker): clarify skipped SELF modules
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-13 18:04:49 +05:30
Adrià afbc22fb1a
Merge pull request #4140 from veosett/fix/relinker-windows-fixed-base
feat(relinker): support fixed Windows guest image bases
2026-10-13 14:26:54 +02:00
boykopovar 8485298e46
Merge pull request #5114 from boykopovar/feat/web-relinker-ui
feat(pages): add web relinker ui
2026-10-13 15:16:10 +03:00
Adrià a2a3a3a94d
Merge pull request #4062 from danzaio/fix/windows-log-without-standard-handles
fix(relinker): log Windows output when standard handles are missing
2026-10-13 14:11:42 +02:00
boykopovar 860cecf11e docs(readme): link online converter and simplify progress history 2026-10-13 15:03:17 +03:00
Kovalev Vladislav 319fa5779a feat(relinker): support fixed Windows guest image bases 2026-10-13 12:55:54 +02:00
Adrià b1328fc0f9
Merge pull request #4100 from nyavana/docs/relinker-help-refresh
docs(relinker): correct help and exit-code usage
2026-10-13 12:54:27 +02:00
p3nicillin 99efb32c40 feat: convert a title's other executables and start them with sceSystemServiceLoadExec
The relinker's repeatable --executable converts another executable of the
title beside the output, sharing its libs, app0 and guest modules.
sceSystemServiceLoadExec maps /app0 paths to those executables, passes the
argument list on the new command line and finds the main executable through
APS5_EBOOT. RetroArch (PPSA99169) starts its frontend picker this way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 08:51:50 +01:00
MarcZX100 acd821f7ce fix(tools): audit sectionless guest modules 2026-10-12 18:46:25 +00:00
Leandro Soares 6054923cd5 fix(tools): audit the imports of --modules files
(cherry picked from commit 2d0d707802c190f4d8ed93d01427576accbc08b1)
2026-10-12 18:46:25 +00:00
Dean acbaa8a16d
Merge pull request #4495 from SibteProf/fix/relinker-sdk-mman-syscalls
fix(relinker): recognize SDK memory syscall trap patterns
2026-10-13 07:29:18 +13:00
Dean 57f5ec232c
Merge pull request #4338 from ArjenS-LA/fix/diagnostic-input-preservation
fix(relinker): preserve inputs when writing Windows diagnostics
2026-10-13 04:52:18 +13:00
SibteProf c0967216bf fix(relinker): recognize SDK memory syscall trap patterns 2026-10-12 18:25:06 +05:00
Dean 3356c28fd6
Merge pull request #4106 from fma-rc/feat/agc-present-mode
feat(agc): select the swapchain present mode with ANYPS5_PRESENT_MODE
2026-10-12 23:53:46 +13:00
Dean 00fe732b2f
Merge pull request #4032 from fma-rc/feat/pad-input-file-sticks
feat(pad): hold the sticks from the controller command file
2026-10-12 21:37:30 +13:00
MarcZX10 656c81ac8b
docs: clarify runtime code generation limits for --to-intel (#4257) 2026-10-12 20:29:46 +13:00
ArjenS-LA 4b6bb2f059 fix(relinker): preserve inputs when writing Windows diagnostics 2026-10-12 00:01:25 -07:00
fma-rc 21b9e2efeb
feat(agc): select the swapchain present mode with ANYPS5_PRESENT_MODE 2026-10-12 08:30:00 +02:00
danzaio b390831a58 docs(user): relocate Windows standard handles logging note to Windows runtime layout section 2026-10-12 00:18:47 -03:00
Doston Abdullayev ab3e926058 feat(relinker): write the output of a Windows executable without standard handles to anyps5.log
A --windows-gui build started from Explorer, or any Windows executable
started without a standard output or error handle, lost everything it
printed: the entry stub's messages, the libraries' stdout and stderr,
uncaught exception messages and crash reports.

Before it enters its directory or loads a library, the entry stub now
checks the standard output and error handles, and gives each missing one
anyps5.log beside the executable. The C runtime of the libraries it then
loads adopts the file. Executables started with handles are unchanged,
and one that cannot create the file starts as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:15:49 -03:00
Dean 26d87eec20
Merge pull request #3850 from SandstromPL/fix/relinker-module-dir-root
fix(relinker): accept the input's directory as a module directory
2026-10-12 16:07:27 +13:00
fma-rc e0eef6c57f
feat(pad): hold the sticks from the controller command file 2026-10-12 04:47:59 +02:00
nyavana 67cdc9edcc docs(relinker): correct help and exit-code usage
Document --help output and status, distinguish no-argument errors, and include help in the successful exit code description.

AI-assisted: yes (OpenAI Codex).
2026-10-11 16:09:56 -07:00
Adrià 66e87807d5
Merge pull request #3804 from MarcZX100/codex/relinker-trap-sdk-syscalls-2136
feat(relinker): trap exact SDK syscall stubs on request
2026-10-12 00:05:38 +02:00
Adrià 5acbcd64ba
Merge pull request #3768 from MarcZX100/codex/docs-dozen-workaround-3255
docs: document Windows Dozen driver workaround
2026-10-11 23:59:39 +02:00
SandstromPL 7f0c5d9d4d fix(relinker): accept the input's directory as a module directory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 23:21:34 +05:30
MarcZX100 0a6247532e feat(relinker): trap exact SDK syscall stubs on request 2026-10-11 16:54:02 +00:00
MarcZX100 63a45aacdf docs: document Windows Dozen driver workaround 2026-10-11 16:35:54 +00:00
Ondra97 1f34f6e8d4 fix(relinker): preserve inputs when writing desktop assets 2026-10-11 17:11:26 +02:00
TibixDev 3a35841aad feat(pad): accept timed controller pulses from a local command file
Add an optional input helper for test runs without desktop input injection. Preserve physical input and release injected buttons automatically.

Validation: guest_pad tests and Python helper CLI smoke checks passed. Written with AI assistance.
2026-10-11 10:54:18 +02:00
Merijn 1c6eac425d feat(relinker): add --module-dir for modules loaded at run time
Relinks the ELF modules of extra directories under the module parent directory. Modules the executable or another module needs start with the executable; the others are initialized when the title loads them with sceKernelLoadStartModule, with its start arguments (Windows: __aps5_guest_initialize export; Linux: left out of DT_NEEDED).

Squashed onto main by the reviewer (history had a merge commit).
2026-10-11 10:11:31 +02:00
Adrià 59a8cbab89
Merge pull request #2981 from MarcZX100/codex/system-service-language-2769
feat(libSceSystemService): select the console language
2026-10-11 01:43:53 +02:00
simonbbby cfd61a5977 fix(relinker): treat address-taken code as reachable in unused-filter=1
The CFG used by unused-filter=1 followed only direct branches, so code reached
through lea, relative-relocated pointers or jump tables was unreachable and its
imports were dropped. It now roots RIP-relative lea targets, relative relocation
targets and relative jump tables, and counts any RIP-relative reference to a GOT
slot as an access. Address-taken targets are walked after the direct control
flow, and a target that does not decode as an instruction is not code.
2026-10-11 00:35:27 +02:00
mugurc 92b20608e8 feat(relinker): convert for Rosetta with --to-rosetta
Rosetta runs AVX2, FMA, BMI1/2, F16C and MOVBE, but, unlike an Intel
host, it has neither RDSEED, CLWB nor RDPID. --to-rosetta converts
everything --to-intel does and lowers these three as well:

- RDSEED becomes RDRAND (the /6 form of the same opcode), which also
  returns a random value and sets CF.
- CLWB only writes a cache line back, so it becomes a NOP of the same
  length.
- RDPID becomes a load of 0 through an optional stub: Rosetta's TSC_AUX
  is a constant, not a processor index, so every thread reports
  processor 0. A site with no movable instruction after it for the jump
  is kept.

The flag implies --to-intel and conflicts with --windows. It is
independent of --macos: it only changes what the conversion produces, so
--macos alone leaves these instructions as they are, as on an Intel Mac,
and a title for Rosetta is relinked with --macos --to-rosetta. Intel
output is unchanged: the target is a parameter of the converter, Intel by
default.
2026-10-10 22:46:45 +03:00
Get-fix fb380440d7 feat(libSceSystemService): select the console language with ANYPS5_LANGUAGE
sceSystemServiceParamGetInt always reported English (United States) as
the console language, so a title that follows the console's language,
such as Jelly5 (PPSA99505) with its Arabic text, can only show English.
ANYPS5_LANGUAGE now selects a console language number from 0 to 30
(21 is Arabic). Unset or empty keeps English (United States); any other
value throws at the language query instead of being ignored.

(cherry picked from commit 9bcf196daa01b07a22be876a7f1143149503e054)
2026-10-10 19:25:39 +00:00
boykopovar f756225f09 docs(usage): add sce-module-path optional flag 2026-10-10 14:38:04 +03:00
boykopovar 336d481bff fix(relinker): default module path to input elf directory 2026-10-10 14:12:04 +03:00
boykopovar bec6d62b29 feat(relinker): add explicit guest module parent path option 2026-10-10 14:10:13 +03:00
Patrick Elsasser bc444a675d fix(relinker): reject guest modules in SELF containers
A bundled module whose file starts with a SELF container magic
(4f 15 3d 1d or 54 14 f5 ee) was skipped like any other non-ELF file,
so the relink succeeded without it and the module was missing at run
time. The guest module scan now throws, naming the module, as
ElfReader already does for a SELF executable.

Fixes #2599

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 10:22:58 +02:00
Sasha Papo 3221ae8acd fix(agc): accept only 1 for APS5_STORE_AT_FLIP and test the switch instead of FlushAllPending
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 08:56:11 +02:00
Sasha Papo ef53b0614f feat(agc): store pending storage-image results at each flip with APS5_STORE_AT_FLIP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 08:56:02 +02:00
Dean e2ba429015
Merge pull request #2243 from NumberGuan/codex/protect-relinker-inputs
fix(relinker): protect executable inputs from output overwrites
2026-10-10 17:45:47 +13:00
Dean 70e66d8efa
Merge pull request #1688 from johnmaia/fix/agc-udmabuf-permission
fix(agc): name the reason when /dev/udmabuf cannot be opened
2026-10-10 17:40:48 +13:00
Adrià 3181e7116d
Merge pull request #1597 from mugurc/macos-relinker
feat(relinker): write Mach-O output for macOS with --macos
2026-10-10 03:13:21 +02:00
john.maia f70d2bdf87 fix(agc): name the reason when /dev/udmabuf cannot be opened
On Linux, shared direct memory is imported through /dev/udmabuf (#943).
Many distributions create it as root:kvm 0660, so a user outside the
kvm group cannot open it. The ranges are then copied instead of
imported, and GPU stores through FLAT/GLOBAL addresses to them fail
with "BDA access failed": DOOM PPSA99666's compute presenter falls back
to its CPU scaler. The only trace was "failed at open /dev/udmabuf
(-1000072003)", a Vulkan result that hides errno.

Print the open error once, with the fix for EACCES, and document the
requirement in USAGE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 23:42:31 +01:00
Dean a4e0889b5d
Merge pull request #2209 from Rohan03x/docs/windows-runtime-dlls
docs(usage): list the MinGW runtime DLLs a self-built libs directory needs
2026-10-10 10:46:02 +13:00
mugurc 703989b94b feat(relinker): write Mach-O output for macOS with --macos
The guest image reader and the module builder already produce a
platform-neutral GuestImage; --macos adds a third writer next to the ELF
and PE ones. The executable and every bundled module become x86-64 Mach-O
files (modules as dylibs in app0/sce_module) that run under Rosetta on
Apple silicon.

FreeBSD code reaches its thread pointer through %fs, which macOS cannot
set, so the writer rewrites each %fs access into a stub that reads the
image's thread pointer from a pthread key and allocates the TLS block on
a thread's first access. Dynamic TLS goes through the image's descriptor
instead of __tls_get_addr. Imports bind by NID to the prx libraries
beside the output, exports and TLS imports use the dynamic symbol names,
and the image's metadata lives in __APS5DATA,__meta.

--macos conflicts with --windows. The macOS runtime that consumes the
output (TLS allocation, libraries built for macOS) comes in separate
changes.
2026-10-10 00:13:39 +03:00