From 306739c2c479b646270f7cd8000bb11483613d50 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 30 Sep 2018 18:13:22 -0400 Subject: ips_layer: Add IPSwitchCompiler to process IPSwitch format --- src/core/file_sys/ips_layer.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/core/file_sys/ips_layer.h') diff --git a/src/core/file_sys/ips_layer.h b/src/core/file_sys/ips_layer.h index 81c163494..bb35542c8 100644 --- a/src/core/file_sys/ips_layer.h +++ b/src/core/file_sys/ips_layer.h @@ -12,4 +12,30 @@ namespace FileSys { VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips); +class IPSwitchCompiler { +public: + explicit IPSwitchCompiler(VirtualFile patch_text); + std::array GetBuildID() const; + bool IsValid() const; + VirtualFile Apply(const VirtualFile& in) const; + +private: + void Parse(); + + bool valid; + + struct IPSwitchPatch { + std::string name; + bool enabled; + std::map> records; + }; + + VirtualFile patch_text; + std::vector patches; + std::array nso_build_id; + bool is_little_endian; + u64 offset_shift; + bool print_values; +}; + } // namespace FileSys -- cgit v1.2.3