diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp index 16c110716e..0cb561728a 100644 --- a/Source/Core/DiscIO/FileMonitor.cpp +++ b/Source/Core/DiscIO/FileMonitor.cpp @@ -92,7 +92,7 @@ void ReadFileSystem(const std::string& filename) FileAccess = true; } -// Check if we should play this file +// Logs a file if it passes a few checks void CheckFile(const std::string& file, u64 size) { // Don't do anything if the log is unselected diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index 10a3e51f05..1e7213ee36 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -17,6 +17,7 @@ #include "Common/MathUtil.h" #include "Core/VolumeHandler.h" #include "DiscIO/FileBlob.h" +#include "DiscIO/FileMonitor.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeDirectory.h" @@ -125,13 +126,16 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt { _dbg_assert_(DVDINTERFACE, fileIter->first <= _Offset); u64 fileOffset = _Offset - fileIter->first; + const std::string fileName = fileIter->second; - std::unique_ptr reader(PlainFileReader::Create(fileIter->second)); + std::unique_ptr reader(PlainFileReader::Create(fileName)); if (reader == nullptr) return false; u64 fileSize = reader->GetDataSize(); + FileMon::CheckFile(fileName, fileSize); + if (fileOffset < fileSize) { u64 fileBytes = fileSize - fileOffset;