Commit Graph

39 Commits

Author SHA1 Message Date
emoose
6ba9b032a3 [VFS/STFS] Check for end-of-chain when reading dir entries, warn if chain size is wrong 2021-05-05 12:35:51 -05:00
emoose
8d7768c7fa [VFS/STFS] Secondary hash-block improvements
GetBlockHash now visits upper-level hash tables (if needed) to check the active_index flag that decides if secondary hash-block should be used or not.
This should give better support for CON packages, important for X360 profiles/game saves (some well-used profiles can be heavily fragmented)
2021-05-05 12:35:51 -05:00
emoose
09e0db029a [VFS/STFS] Add BlockToHashBlockOffsetSTFS for more accurate hash table offset 2021-05-05 12:35:51 -05:00
emoose
509f33ba27 [VFS/STFS] Fix BlockToOffsetSTFS for non-read_only_format (CON) packages
Previous code would give wrong results for those types of packages as the block_shift would cancel itself out, moving it to happen afterward let it give the right result though, probably a mistake while reversing it.
(eg. block 0 would give 0xB000, but that's wrong for non-read_only packages as 0xA000 and 0xB000 are reserved for the first hash-table there, fixed code returns the correct 0xC000 offset)

Also changed it to a multiply & renamed it to blocks_per_hash_table to make it more obvious what the purpose is.
2021-05-05 12:35:51 -05:00
emoose
14783b03f2 [VFS/STFS] Update mmap_total_size & total_allocation_units() 2021-05-05 12:35:51 -05:00
emoose
84f566d92b [VFS] STFS/XContent structure improvements
Now makes use of xe::be<T> and removes need for read() method
2021-05-05 12:35:51 -05:00
gibbed
cf0251cd9f [Kernel/VFS] Cleanup info query/set+sector size.
[VFS] Device now exposes name, attributes, component name max length.
[VFS] Fix STFS device to return 0x200 sector size. XCTD compression
      userland code appears to always expect a sector size of 0x200.
[Kernel] Move X_FILE_*_INFORMATION structs to new files.
[Kernel] Move NtQueryInformationFile, NtSetInformationFile,
         NtQueryVolumeInformationFile to new file.
[Kernel] Cleanup implementation of NtQueryInformationFile,
         NetSetInformationFile, NtQueryVolumeInformationFile.
[Kernel] Properly validate arguments to NtQueryInformationFile,
         NetSetInformationFile, NtQueryVolumeInformationFile.
[Kernel] Properly implement query of XFileFsVolumeInformation.
[Kernel] Properly implement query of XFileFsSizeInformation.
[Kernel] Properly implement query of XFileFsAttributeInformation.
2020-04-20 16:08:02 -05:00
gibbed
1c2d6753bb [Kernel/VFS] Specify root entry to open from + cleanup.
[VFS] Allow specifying root entry to open from with OpenFile.
[Kernel] NtCreateFile now opens from root entry when available instead
         of needlessly building a full path and resolving from that.
[VFS] Reduce code duplication by adding Entry::ResolvePath.
[VFS] Remove ResolveBasePath to avoid multiple calls to find_base_guest_path.
2020-04-20 01:14:07 -05:00
gibbed
0d010a2e3d [VFS] Fix data fragment path for multi-file STFS. 2020-04-09 11:33:08 -05:00
gibbed
ed04d96e67 Avoid using '#' format spec for X hex numbers.
Avoid using '#' format spec for X (uppercase) hex numbers, as it
results in output like "0XABCDEF" instead of "0xABCDEF".
2020-04-09 11:25:08 -05:00
Sandy Carter
c8e64da4eb filesystem: use std for PathExists
Remove custom platform implementation of `PathExists` and replace uses
with `std::filesystem::exists`.
2020-04-09 09:44:48 -05:00
Sandy Carter
a9fa38c88b filesystem: use std for IsFolder
Remove custom platform implementation of IsFolder and replace
single use with `std::filesystem::is_directory`.
2020-04-09 09:44:48 -05:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
Triang3l
e07b0ed2ad [VFS] Fix some security issues in StfsContainerDevice code 2019-10-22 08:55:45 +03:00
gibbed
e72cacc986 [VFS] Make ResolvePath argument a const reference. 2019-07-29 16:04:25 -05:00
Wildenhaus
798e88224a Ordinal offset calculation for games with many files 2018-12-15 20:27:15 -05:00
Wildhaus
151a955c6a Support EGDF and XSF layouts 2018-11-28 10:08:07 -05:00
Wildhaus
80375c62e8 Add support for STFS Metadata V2 2018-11-11 15:27:34 -05:00
Wildhaus
19fb21da7d Games on Demand / Multifile STFS (SVOD) Support 2018-11-11 15:27:29 -05:00
Dr. Chat
ef18e9d649 [VFS] Fix Stfs GetBlockHash (and simplify it) 2018-05-29 23:12:27 -05:00
Dr. Chat
a0464f54ba [VFS] SVOD (with EGDF) support 2018-05-29 14:12:09 -05:00
Dr. Chat
fed3c10c60 [VFS] Properly detect STFS volume descriptor type 2018-05-27 14:03:29 -05:00
Dr. Chat
3e216f0553 [VFS] Panic when fed a GoD container 2018-05-26 21:19:34 -05:00
Dr. Chat
728ed593ad [VFS] Make ResolvePath / Dump virtual 2018-05-26 18:51:03 -05:00
Dr. Chat
1def8cfc59 [VFS] Rename a couple STFSVolumeDescriptor fields 2018-05-26 09:06:10 -05:00
Ink
fe3d31067f * proper FAT timestamp handling 2017-02-23 19:38:29 +03:00
Ink
0d8a81137c * make vfs::Entry time stamps consistent (as Windows FILETIME) 2017-01-06 04:17:04 +03:00
Dr. Chat
9cf324f689 Fix VFS files not having correct paths recorded. 2015-12-29 13:09:53 -08:00
Ben Vanik
8b0d4fb51c Linux tweaks. 2015-08-18 14:18:00 -07:00
Ben Vanik
14beb27ebc xb style. 2015-08-07 07:56:57 -07:00
Ben Vanik
12a29371e3 Clang fixes. 2015-07-19 18:32:48 -07:00
Ben Vanik
91d7acf59e Fixing some particularly bad /W4. 2015-07-18 23:04:21 -07:00
Ben Vanik
c9f4d00da3 STFS->Stfs.
Fixes #309.
2015-06-29 10:38:51 -07:00
Ben Vanik
0104a2290f Adding locks and parents to vfs.
Progress on #305.
2015-06-29 05:07:29 -07:00
Ben Vanik
30e0c6dbb1 Support --target=path to stfs root.
Fixes #302.
2015-06-28 15:28:04 -07:00
Ben Vanik
83872d8e8f Refactoring vfs to remove a lot of duplicated code.
Progress on #294.
2015-06-27 22:37:49 -07:00
Ben Vanik
abf47b7973 Removing utilities (that were just adding needless layers).
Progress on #294.
2015-06-27 16:27:38 -07:00
Ben Vanik
0716cf84c0 Renaming xe::fs to xe::filesystem and xe::kernel::fs to xe::vfs.
Progress on #294.
2015-06-27 13:31:21 -07:00