diff --git a/Source/Core/DiscIO/Src/FileHandlerARC.cpp b/Source/Core/DiscIO/Src/FileHandlerARC.cpp index 435cbbf272..ae8b96ac6d 100644 --- a/Source/Core/DiscIO/Src/FileHandlerARC.cpp +++ b/Source/Core/DiscIO/Src/FileHandlerARC.cpp @@ -20,15 +20,32 @@ #include "FileHandlerARC.h" #include "StringUtil.h" +#include "Blob.h" #define ARC_ID 0x55aa382d namespace DiscIO { +CARCFile::CARCFile(const std::string& _rFilename) + : m_pBuffer(NULL) + , m_Initialized(false) +{ + DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rFilename.c_str()); + if (pReader != NULL) + { + u64 FileSize = pReader->GetDataSize(); + m_pBuffer = new u8[FileSize]; + pReader->Read(0, FileSize, m_pBuffer); + delete pReader; + + m_Initialized = ParseBuffer(); + } +} + CARCFile::CARCFile(const u8* _pBuffer, size_t _BufferSize) - : m_pBuffer(NULL), - m_Initialized(false) + : m_pBuffer(NULL) + , m_Initialized(false) { m_pBuffer = new u8[_BufferSize]; diff --git a/Source/Core/DiscIO/Src/FileHandlerARC.h b/Source/Core/DiscIO/Src/FileHandlerARC.h index b58acb958d..c59002eca1 100644 --- a/Source/Core/DiscIO/Src/FileHandlerARC.h +++ b/Source/Core/DiscIO/Src/FileHandlerARC.h @@ -30,6 +30,8 @@ class CARCFile { public: + CARCFile(const std::string& _rFilename); + CARCFile(const u8* _pBuffer, size_t _BufferSize); virtual ~CARCFile();