Commit Graph
216 Commits
Author SHA1 Message Date
Megamouse 7a90d09cfe Qt: move guest memory dump code to own class 2026-07-23 10:58:18 +02:00
caner 5ecfc95c13 Qt: add guest memory dump utility (#19068)
This adds a tool that writes a snapshot of the full PS3 guest address
space to disk for offline analysis.

This tool produces a flat image that any hex editor or script can index
directly by guest address. It dumps allocated PS3 guest memory only, not
RPCS3 host-process memory, host registers, or GPU-side state.

What it does:

1. Pauses emulation and waits up to five seconds for every PPU, SPU, and
RSX thread to settle. If they do not settle, nothing is written.
2. Copies every allocated guest page into an intermediate buffer on a
named worker thread, then writes it to a sparse `guest_memory.bin` whose
file offset equals the PS3 effective address. Reads go through
`vm::g_sudo_addr` so guest protected pages are captured too.
3. Saves each live SPU thread's 256 KB local store to its own file, with
its ID, LV2 ID, PC, and type recorded.
4. Writes `manifest.json`, listing every allocated region with its
addresses and permissions, the storage mode, and the SPU local-store
table.
5. Resumes emulation.

The menu entry is under Utilities next to Memory Viewer and is enabled
while a game is loaded. Free space is checked before writing. If sparse
file setup fails, the incomplete attempt is removed and the user can
choose another destination or cancel. Failed or cancelled dumps remove
their output folder instead of leaving a partial image.

Tested on Windows using an NTFS destination with a build from this
branch: dumped a running game with 479,535,104 allocated guest bytes
across 76 regions and five SPU local stores. The image was sparse, its
offsets matched guest addresses, and emulation resumed cleanly. The
sparse file failure path was also exercised with a temporary local test:
choosing another location reopened the destination picker, while
cancelling aborted the attempt without leaving partial output. Runtime
behavior on Linux and macOS is untested.

The first draft of this implementation was AI assisted. I reviewed and
adjusted the code and tested the Windows/NTFS path myself. I am happy to
rework anything or answer any questions.
2026-07-23 00:08:05 +00:00
Antonino Di Guardo 026297334f Some fixes (#18686)
### FIXES + MINOR IMPROVEMENTS:
- Fixed issue18685: Not a real issue. PR18648 added some logging that made
evident a missing check on the validity of the paths in `games.yml`
before trying to manage the path as a possible ISO file. That missing
check was already present but simply invisible due to missing log
- Fixed `bytes_to_hex()` function used to store file hash hex string: In
some cases the integrity check wrongly reported the check as failed
- Optimized `fs::get_optical_raw_device()` function: Moved under
`_WIN32` block a check valid only on `Windows` and simplified the logic
to detect a CDROM / BD as raw device
- Used `iso_file` objects instead of `fs:file` in `ISO.cpp`: It allows
to use proper `bool()` operator on some checks
2026-05-07 06:38:57 +03:00
Megamouse a8dd053593 Fix some warnings 2026-04-30 20:41:35 +02:00
digant73 79d0e0eb3c reduce check for raw device 2026-04-30 10:39:10 +03:00
digant73 570b2bddca Avoid to open bd drive if no content is present 2026-04-30 10:39:10 +03:00
Antonino Di Guardo b212935c70 Add support to play from a BD Drive (currently only on Windows) (#18648)
Follow up of #18345 to add support (currently only on `Windows`; see
notes below) for playing a PS3 disc game directly from a Blu-Ray Disc
Drive.

### HOW IT WORKS:
- The BD drive can be added as any other game so from `VFS games` or
from `Add Games` menu. In case it is selected from `VFS games`, any
attempt to write files is discarded, e.g. file `Disc Games Can Be Put
Here For Automatic Detection.txt`
- It scans the default redump keys folder `<rpcs3>/data/redump` (it
currently needs to be manually created due it is not yet provided by
rpcs3 installation) to find a matching decryption key

### NOTES:
- Support is currently provided on `Windows` where I can fully test it.
I cannot test under other OS. However, the additions needed for the
other OS are limited only on `fs::file.h/cpp`. In particular inside the
following new functions:
  - `bool is_optical_raw_device(const std::string& path);`
- `bool get_optical_raw_device(const std::string& path, std::string*
raw_device = nullptr);`
- Icons etc. are always refreshed (ISO cache cannot be used due `mtime`
on raw device is not available and any cache check would always fail)
- Code in `ISO.h/cpp` needed some rework to properly manage a read on a
raw device (alignment on offset, size and memory is mandatory). The BD
drive needs to be detected as a file, not as a folder

### MINOR FIXES:
- Fixed wrong specifier used in logging on `ISO.h/cpp`
2026-04-29 05:42:49 +03:00
Elad bd95c728f0 sys_fs: Implement ENOTDIR 2026-03-31 21:56:30 +02:00
Elad 35ccd63dbc Win32/File.cpp: Fix fs::file constraints to avoid crashes 2026-02-28 10:58:25 +02:00
Megamouse ff992a67c8 win/fs: check file handle with GetFileInformationByHandle when creating fs::file
On empty mounted drives CreateFileW may return a valid handle even if the drive is not usable.
We have to check the file handle early. Otherwise other functions may fail later as a result.
2026-02-20 11:25:39 +02:00
digant73 9fb7c8f52c Add multi-selection context menu
fix compile errors on Mac and provide reviewed changes

fix wrong resolved conflict

removed duplicate

cleanup after latest merged PRs

minor cleanup

rename and move get_existing_dir() to File.cpp

apply reviewed changes
2026-01-06 09:47:15 +01:00
Megamouse 9897a80216 CMake: fix gcc build 2025-04-30 10:08:16 +02:00
DH d766baef12 fs::file: implement release_handle
cleanup
2025-03-10 21:09:27 +01:00
DH 95d0cb18e4 Coding style issues fixes
Thanks @Megamouse
2025-03-10 21:09:27 +01:00
DH f3d988d8ab fs::file: add from_native_handle constructor
fs::get_*_dir tweaks for android
2025-03-10 21:09:27 +01:00
RipleyTom cd87a64621 Headers cleanup 2025-02-11 20:38:35 +01:00
Megamouse a7edfa221e windows: move logs to log dir 2025-01-16 21:33:33 +01:00
Megamouse 451e953d26 windows: move config.yml and games.yml to /config/ 2025-01-16 21:33:33 +01:00
Megamouse 1966171838 Use string_view in rXml 2025-01-14 21:35:57 +01:00
Elad 2b9f076024 fs: Minor fix of fs::dir::open
Did not close previous handle on fs::dir::open like on fs::file
2024-11-28 05:47:40 +02:00
oltolm 2b0f786b2d Fix std::basic_string warnings (#16261) 2024-11-11 21:54:44 +02:00
Megamouse 2262ac1684 Qt: Replace QMap with std::map
This should reduce the amount of string conversions during list refreshes
2024-11-06 09:34:32 +01:00
Elad b053b1e200 Another attempt to fix fs::pending_file for hardlinks 2024-11-02 21:43:35 +02:00
Elad d3c0ec5651 Print last system error on fs::error::unknown 2024-11-02 21:43:35 +02:00
Elad 4206b022b6 Win32/File.cpp: Use ReplaceFile for hardlink overwrite 2024-11-01 07:37:57 +02:00