diff options
| author | bunnei <bunneidev@gmail.com> | 2018-10-08 12:30:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-08 12:30:33 -0400 |
| commit | 6b48ba52712e5ea9cadb1177c06cb3ca65492c38 (patch) | |
| tree | 365bb902d31fd5d5d585fc2f5d9e9dac274b02ec /src/core/file_sys/ips_layer.h | |
| parent | fd891ee9c0342b603574e57ef178620439927256 (diff) | |
| parent | 110d5784702282c594fe57f84f8d6bda21a82d50 (diff) | |
Merge pull request #1424 from DarkLordZach/ips-witch
ips_layer: Add support for IPSwitch executable patches
Diffstat (limited to 'src/core/file_sys/ips_layer.h')
| -rw-r--r-- | src/core/file_sys/ips_layer.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/file_sys/ips_layer.h b/src/core/file_sys/ips_layer.h index 81c163494..57da00da8 100644 --- a/src/core/file_sys/ips_layer.h +++ b/src/core/file_sys/ips_layer.h @@ -12,4 +12,34 @@ namespace FileSys { VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips); +class IPSwitchCompiler { +public: + explicit IPSwitchCompiler(VirtualFile patch_text); + ~IPSwitchCompiler(); + + std::array<u8, 0x20> GetBuildID() const; + bool IsValid() const; + VirtualFile Apply(const VirtualFile& in) const; + +private: + void ParseFlag(const std::string& flag); + void Parse(); + + bool valid = false; + + struct IPSwitchPatch { + std::string name; + bool enabled; + std::map<u32, std::vector<u8>> records; + }; + + VirtualFile patch_text; + std::vector<IPSwitchPatch> patches; + std::array<u8, 0x20> nso_build_id{}; + bool is_little_endian = false; + s64 offset_shift = 0; + bool print_values = false; + std::string last_comment = ""; +}; + } // namespace FileSys |
