From 77c252a4c07df194eba3662d4742abfad1eb264f Mon Sep 17 00:00:00 2001 From: Eladash Date: Thu, 16 Sep 2021 11:04:47 +0300 Subject: [PATCH] PKG: Debugging messages --- rpcs3/Crypto/unpkg.cpp | 5 +++-- rpcs3/Crypto/unpkg.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index 45268062de..97a468305e 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -75,7 +75,7 @@ bool package_reader::read_header() pkg_log.notice("Header: data_size = 0x%x = %d", m_header.data_size, m_header.data_size); pkg_log.notice("Header: title_id = %s", m_header.title_id); pkg_log.notice("Header: qa_digest = 0x%x 0x%x", m_header.qa_digest[0], m_header.qa_digest[1]); - //pkg_log.notice("Header: klicensee = 0x%x = %d", header.klicensee, header.klicensee); + pkg_log.notice("Header: klicensee = %s", m_header.klicensee.value()); // Get extended PKG information for PSP or PSVita if (m_header.pkg_platform == PKG_PLATFORM_TYPE_PSP_PSVITA) @@ -742,7 +742,8 @@ bool package_reader::extract_data(atomic_t& sync) const std::string name{reinterpret_cast(m_buf.get()), entry.name_size}; const std::string path = dir + vfs::escape(name); - pkg_log.notice("Entry 0x%08x: %s", entry.type, name); + const bool log_error = entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS); + (log_error ? pkg_log.error : pkg_log.notice)("Entry 0x%08x: %s (pad=0x%x)", entry.type, name, entry.pad); switch (entry.type & 0xff) { diff --git a/rpcs3/Crypto/unpkg.h b/rpcs3/Crypto/unpkg.h index 8c751b04f4..8a87d7c452 100644 --- a/rpcs3/Crypto/unpkg.h +++ b/rpcs3/Crypto/unpkg.h @@ -35,6 +35,8 @@ enum : u32 PKG_FILE_ENTRY_OVERWRITE = 0x80000000, PKG_FILE_ENTRY_PSP = 0x10000000, + + PKG_FILE_ENTRY_KNOWN_BITS = 0xff | PKG_FILE_ENTRY_PSP | PKG_FILE_ENTRY_OVERWRITE, }; enum : u32