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 <assert.h> |
| 7 | #include "common/assert.h" |
| 8 | #ifndef IM_ASSERT |
| 9 | #define IM_ASSERT(_EXPR) ASSERT(_EXPR) |
| 10 | #endif |
| 11 | #include "GuiLogSink.h" |
| 12 | #include "imgui.h" |
| 13 | |
| 14 | // ╔═══════════════════════════════════════════════════════════════════════════╗ |
| 15 | // ║ ConsoleLog: Collapsible log panel widget for bottom of main window ║ |
| 16 | // ║ ║ |
| 17 | // ║ Layout: ║ |
| 18 | // ║ ┌──────────────────────────────────────────────────────────────────────┐ ║ |
| 19 | // ║ │ ▼ Console [Clear] [Auto⬤] │ ║ |
| 20 | // ║ ├──────────────────────────────────────────────────────────────────────┤ ║ |
| 21 | // ║ │ [12:34:56] [INFO] PKG Loaded: CUSA12345 │ ║ |
| 22 | // ║ │ [12:34:57] [WARN] RIF file checksum validation... │ ║ |
| 23 | // ║ │ [12:34:58] [ERROR] Failed to extract file: ... │ ║ |
| 24 | // ║ └──────────────────────────────────────────────────────────────────────┘ ║ |
| 25 | // ╚═══════════════════════════════════════════════════════════════════════════╝ |
| 26 | |
| 27 | namespace ShadPKG::GUI { |
| 28 | |
| 29 | class ConsoleLog { |
| 30 | public: |
| 31 | ConsoleLog() = default; |
| 32 | ~ConsoleLog() = default; |
| 33 | |
| 34 | // Draw the console panel |
| 35 | // Returns true if the console is expanded |
| 36 | void Draw(float height = 150.0f); |
| 37 | |
| 38 | // Control |
| 39 | bool IsExpanded() const { return expanded_; } |
| 40 | void SetExpanded(bool expanded) { expanded_ = expanded; } |
| 41 | |
| 42 | private: |
| 43 | bool expanded_ = true; |
| 44 | bool showInfo_ = true; |
| 45 | bool showWarnings_ = true; |
| 46 | bool showErrors_ = true; |
| 47 | }; |
| 48 | |
| 49 | } // namespace ShadPKG::GUI |
| 50 |