diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp index 16b8d3d70c..802b722406 100644 --- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp @@ -26,6 +26,73 @@ namespace DiscIO { + +class CSharedContent +{ +public: + + static CSharedContent& AccessInstance() { return m_Instance; } + + std::string GetFilenameFromSHA1(u8* _pHash); + +private: + + + CSharedContent(); + + virtual ~CSharedContent(); + + struct SElement + { + u8 FileName[8]; + u8 SHA1Hash[20]; + }; + + std::vector m_Elements; + static CSharedContent m_Instance; +}; + +CSharedContent CSharedContent::m_Instance; + +CSharedContent::CSharedContent() +{ + char szFilename[1024]; + sprintf(szFilename, "%sshared1/content.map", FULL_WII_USER_DIR); + if (File::Exists(szFilename)) + { + FILE* pFile = fopen(szFilename, "rb"); + while(!feof(pFile)) + { + SElement Element; + if (fread(&Element, sizeof(SElement), 1, pFile) == 1) + { + m_Elements.push_back(Element); + } + } + } +} + +CSharedContent::~CSharedContent() +{} + +std::string CSharedContent::GetFilenameFromSHA1(u8* _pHash) +{ + for (size_t i=0; i