diff options
| author | nakeee <nakeee@gmail.com> | 2009-03-03 00:21:08 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2009-03-03 00:21:08 +0000 |
| commit | e9430a0252160e1cd944a4e6422160585b7e7869 (patch) | |
| tree | ff16cbe95d2be9f4470ea33714ef4075814f50f8 /Source/Core/DiscIO/Src/NANDContentLoader.cpp | |
| parent | 9ef42aefac405e7f4eea922980c1934d2c1c635d (diff) | |
fixed crash on linux, added DISCIO logging type, some extra logging messages and some logging cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2533 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/NANDContentLoader.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Src/NANDContentLoader.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp index b52fe15ccc..6e7a9ed578 100644 --- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp @@ -18,10 +18,10 @@ #include "stdafx.h"
#include "NANDContentLoader.h"
-
#include "AES/aes.h"
#include "MathUtil.h"
#include "FileUtil.h"
+#include "Log.h"
namespace DiscIO
{
@@ -97,12 +97,14 @@ bool CNANDContentLoader::CreateFromWAD(const std::string& _rName) bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
{
std::string TMDFileName(_rPath);
- TMDFileName += "/title.tmd";
+ TMDFileName += "/title.tmd";
FILE* pTMDFile = fopen(TMDFileName.c_str(), "rb");
- if (pTMDFile == NULL)
+ if (pTMDFile == NULL) {
+ ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",
+ TMDFileName.c_str());
return false;
-
+ }
u64 Size = File::GetSize(TMDFileName.c_str());
u8* pTMD = new u8[Size];
fread(pTMD, Size, 1, pTMDFile);
@@ -126,7 +128,7 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath) rContent.m_pData = NULL;
char szFilename[1024];
- sprintf(szFilename, "%s\\%08x.app", _rPath.c_str(), rContent.m_ContentID);
+ sprintf(szFilename, "%s/%08x.app", _rPath.c_str(), rContent.m_ContentID);
FILE* pFile = fopen(szFilename, "rb");
// i have seen TMDs which index to app which doesn't exist...
@@ -139,7 +141,11 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath) fread(rContent.m_pData, Size, 1, pFile);
fclose(pFile);
- }
+ } else {
+ ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",
+ szFilename);
+
+ }
}
return true;
@@ -191,6 +197,7 @@ u8* CNANDContentLoader::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
{
+ ERROR_LOG(DISCIO, "WiiWAD: Could not read from file");
PanicAlert("WiiWAD: Could not read from file");
}
return pTmpBuffer;
@@ -233,7 +240,7 @@ bool CNANDContentLoader::ParseTMD(u8* pDataApp, u32 pDataAppSize, u8* pTicket, u u32 RoundedSize = ROUND_UP(rContent.m_Size, 0x40);
rContent.m_pData = new u8[RoundedSize];
-
+
memset(IV, 0, sizeof IV);
memcpy(IV, pTMD + 0x01e8 + 0x24*i, 2);
AESDecode(DecryptTitleKey, IV, p, RoundedSize, rContent.m_pData);
@@ -283,4 +290,7 @@ bool CNANDContentLoader::ParseWAD(DiscIO::IBlobReader& _rReader) return Result;
}
-}
\ No newline at end of file +} // namespace end
+
+
+
|
