Commit Graph
20 Commits
Author SHA1 Message Date
Henrik Rydgård 2100e4ec47 Reject ATRAC files with oversized packets at parse time; honor Verify errors
- InitContextFromTrackInfo now rejects files where sampleSize (from
  blockAlign) exceeds the buffer size, instead of only clamping later in
  DecodeForSas. Keep the DecodeForSas check as defense-in-depth since a
  large buffer could still allow a crafted packet to overflow the fixed
  assembly buffer.
- CChunkFileReader::Verify now returns ERROR_BROKEN_STATE if bounds
  checking fails, so modified savestates are rejected here too.
2026-08-01 11:57:27 +02:00
Henrik Rydgård 58d4759ceb Add bounds checking to savestate deserialization
PointerWrap tracked no end-of-buffer, so DoState() implementations could
read past the end of a crafted or truncated savestate via DoVoid's
unchecked memcpy, and DoVector could resize to an attacker-controlled
size before reading.

- PointerWrap now tracks a read end; DoVoid/ExpectVoid fail (MODE_NOOP)
  before reading out of bounds.
- String reads are bounds-checked for the whole string including NUL.
- DoVector rejects sizes that can't fit in the remaining buffer.
- LoadPtr takes the buffer size and sets the read end.
- Capping the decompression buffer allocation in LoadFile.
2026-08-01 11:57:24 +02:00
Henrik Rydgård b3346df646 ImDebugger: Add a window to inspect upcoming CoreTiming events 2024-12-07 16:28:27 +01:00
Henrik Rydgård cf49ff04ca More accurate error reporting for savestate loads 2024-07-20 10:55:16 +02:00
Henrik Rydgård a1010e3b2e Add some more checks in sceFont 2024-07-20 10:42:01 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 9bd67df5b2 Achievement savestate fixes 2023-07-08 21:47:16 +02:00
Henrik Rydgård 132e8eeccd Now these variables need to be initialized 2023-02-14 22:46:32 +01:00
Henrik Rydgård cebb885e84 Address feedback 2023-02-14 10:09:54 +01:00
Henrik Rydgård a7baa3580b Some code cleanups around rewind. 2023-02-14 10:09:36 +01:00
Unknown W. Brackets ef04c4f55c Utility: Report YugiohSaveFix usage. 2022-12-19 07:56:23 -08:00
Henrik Rydgård c7041d6e97 Reserve some space in the checkpoints vector 2022-12-02 22:46:39 +01:00
Henrik Rydgård f5a7661c51 Add a NOOP state to reduce logspam after error 2022-12-02 22:46:38 +01:00
Henrik Rydgård 52a684644d Verify that the Measure and Save passes match accurately through checkpointing
Adding this after seeing some very suspicious behavior in Ratchet &
Clank.
2022-12-02 22:46:38 +01:00
Henrik Rydgård 237fbca979 Savestate: Prepare some sanity checks 2022-12-02 22:46:38 +01:00
Unknown W. Brackets a1b88bedd9 SaveState: Validate size matches measured.
In #14653, a save state appears to have been generated truncated.
This attempts to detect that at generation time.
2021-08-07 13:55:29 -07:00
Henrik Rydgård c6c5a93bf4 Couple of minor things, crashfix on deserialization failure 2021-07-25 15:42:12 +02:00
Henrik Rydgård 025bcb1673 Introduce Path, start using it all over the place.
Still lots left to convert!

Convert GetSysDirectory to return Path.

More buildfixing

Remove unnecessary Path( constructors
2021-05-13 10:39:16 +02:00
Henrik Rydgård 74f8b3c69a Yet another one 2020-10-15 00:03:47 +02:00
Unknown W. Brackets b8342fb8ec SaveState: Rename ChunkFile files to Serialize.
Makes more sense and less weird than ChunkFileDoMap, etc.
2020-08-10 08:04:05 +00:00