From b04e39107fd947d59b76214747a81b8cb6fe92a8 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 28 Oct 2018 14:55:32 -0400 Subject: [PATCH] control_metadata: Add GetRawBytes function to NACP Returns the raw bytes of the NACP file. Needed for GetApplicationControlData which returns the raw, unprocessed NACP to the game. --- src/core/file_sys/control_metadata.cpp | 6 ++++++ src/core/file_sys/control_metadata.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/core/file_sys/control_metadata.cpp b/src/core/file_sys/control_metadata.cpp index a012c2be9..c8fa912bf 100644 --- a/src/core/file_sys/control_metadata.cpp +++ b/src/core/file_sys/control_metadata.cpp @@ -66,4 +66,10 @@ std::string NACP::GetVersionString() const { return Common::StringFromFixedZeroTerminatedBuffer(raw->version_string.data(), raw->version_string.size()); } + +std::vector NACP::GetRawBytes() const { + std::vector out(sizeof(RawNACP)); + std::memcpy(out.data(), raw.get(), sizeof(RawNACP)); + return out; +} } // namespace FileSys diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h index 141f7e056..bfaad46b4 100644 --- a/src/core/file_sys/control_metadata.h +++ b/src/core/file_sys/control_metadata.h @@ -81,6 +81,7 @@ public: u64 GetTitleId() const; u64 GetDLCBaseTitleId() const; std::string GetVersionString() const; + std::vector GetRawBytes() const; private: std::unique_ptr raw;