General Formatting

This commit is contained in:
Stevoisiak 2015-02-28 17:24:02 -05:00
parent ede4977d12
commit eff924e9e2
5 changed files with 11 additions and 10 deletions

View File

@ -77,8 +77,8 @@ bool CISOFileReader::Read(u64 offset, u64 nbytes, u8* out_ptr)
}
out_ptr += bytes_to_read;
offset += bytes_to_read;
nbytes -= bytes_to_read;
offset += bytes_to_read;
nbytes -= bytes_to_read;
}
return true;

View File

@ -240,14 +240,14 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
m_Content.resize(m_numEntries);
for (u32 i=0; i<m_numEntries; i++)
for (u32 i=0; i < m_numEntries; i++)
{
SNANDContent& rContent = m_Content[i];
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i);
rContent.m_Size= (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
rContent.m_Size = (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
memcpy(rContent.m_SHA1Hash, pTMD + 0x01f4 + 0x24*i, 20);
memcpy(rContent.m_Header, pTMD + 0x01e4 + 0x24*i, 36);
@ -271,7 +271,7 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
else
rContent.m_Filename = StringFromFormat("%s/%08x.app", m_Path.c_str(), rContent.m_ContentID);
// Be graceful about incorrect tmds.
// Be graceful about incorrect TMDs.
if (File::Exists(rContent.m_Filename))
rContent.m_Size = (u32) File::GetSize(rContent.m_Filename);
}
@ -355,7 +355,7 @@ void CNANDContentLoader::RemoveTitle() const
INFO_LOG(DISCIO, "RemoveTitle %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID);
if (IsValid())
{
// remove tmd?
// remove TMD?
for (u32 i = 0; i < m_numEntries; i++)
{
if (!(m_Content[i].m_Type & 0x8000)) // skip shared apps
@ -455,7 +455,7 @@ u64 CNANDContentManager::Install_WiiWAD(std::string &fileName)
u64 TitleID = ContentLoader.GetTitleID();
//copy WAD's tmd header and contents to content directory
//copy WAD's TMD header and contents to content directory
std::string ContentPath(Common::GetTitleContentPath(TitleID));
std::string TMDFileName(Common::GetTMDFileName(TitleID));

View File

@ -140,9 +140,9 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt
if (!reader->Read(fileOffset, fileBytes, _pBuffer))
return false;
_Length -= fileBytes;
_Length -= fileBytes;
_pBuffer += fileBytes;
_Offset += fileBytes;
_Offset += fileBytes;
}
++fileIter;

View File

@ -22,6 +22,7 @@ CVolumeWAD::CVolumeWAD(IBlobReader* _pReader)
: m_pReader(_pReader), m_offset(0), m_tmd_offset(0), m_opening_bnr_offset(0),
m_hdr_size(0), m_cert_size(0), m_tick_size(0), m_tmd_size(0), m_data_size(0)
{
// Source: http://wiibrew.org/wiki/WAD_files
Read(0x00, 4, (u8*)&m_hdr_size);
Read(0x08, 4, (u8*)&m_cert_size);
Read(0x10, 4, (u8*)&m_tick_size);

View File

@ -95,7 +95,7 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer, bool de
memcpy(_pBuffer, &m_LastDecryptedBlock[Offset], (size_t)CopySize);
// Update offsets
_Length -= CopySize;
_Length -= CopySize;
_pBuffer += CopySize;
_ReadOffset += CopySize;
}