A tool for deriving PKG packet encryption keys for ps4 written in c++
| 1 | // SPDX-FileCopyrightText: Copyright 2025 shadPKG |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "../GUIContext.h" |
| 7 | #include <string> |
| 8 | |
| 9 | // ╔═══════════════════════════════════════════════════════════════════════════╗ |
| 10 | // ║ RIFView: RIF file generation and validation ║ |
| 11 | // ║ ║ |
| 12 | // ║ Features: ║ |
| 13 | // ║ - Generate RIF from Content ID ║ |
| 14 | // ║ - Validate existing RIF files ║ |
| 15 | // ║ - Display RIF file information ║ |
| 16 | // ╚═══════════════════════════════════════════════════════════════════════════╝ |
| 17 | |
| 18 | namespace ShadPKG::GUI { |
| 19 | |
| 20 | class RIFView { |
| 21 | public: |
| 22 | RIFView() = default; |
| 23 | ~RIFView() = default; |
| 24 | |
| 25 | void Draw(GUIContext &ctx); |
| 26 | |
| 27 | private: |
| 28 | // Generate section |
| 29 | char contentIdBuf_[64] = ""; |
| 30 | char outputDirBuf_[512] = ""; |
| 31 | bool generateSuccess_ = false; |
| 32 | bool generateFailed_ = false; |
| 33 | std::string generatedPath_; |
| 34 | |
| 35 | // Validate section |
| 36 | char rifPathBuf_[512] = ""; |
| 37 | bool validated_ = false; |
| 38 | bool rifValid_ = false; |
| 39 | std::string rifInfo_; |
| 40 | |
| 41 | // UI sections |
| 42 | void DrawGenerateSection(); |
| 43 | void DrawValidateSection(); |
| 44 | |
| 45 | // Actions |
| 46 | void GenerateRif(); |
| 47 | void ValidateRif(); |
| 48 | |
| 49 | bool ShowOpenFileDialog(const char *title, const char *filter, char *outPath, |
| 50 | size_t pathSize); |
| 51 | bool ShowSelectFolderDialog(const char *title, char *outPath, |
| 52 | size_t pathSize); |
| 53 | }; |
| 54 | |
| 55 | } // namespace ShadPKG::GUI |
| 56 |