Seregon/ShadPKG

A tool for deriving PKG packet encryption keys for ps4 written in c++

C++/47.3 KB/No license
gui/include/views/DecompilerView.h
ShadPKG / gui / include / views / DecompilerView.h
1#pragma once
2 
3#include "../GUIContext.h"
4#include "core/decompiler/DecompilerContext.h"
5#include "core/file_format/pkg.h"
6#include <memory>
7 
8namespace ShadPKG::GUI {
9 
10class DecompilerView {
11public:
12 DecompilerView();
13 ~DecompilerView() = default;
14 
15 void Draw(GUIContext &ctx);
16 void LoadBinary(const std::string &path);
17 
18private:
19 std::unique_ptr<ShadPKG::Decompiler::DecompilerContext> decompilerCtx_;
20 
21 // UI State
22 std::string retypeSearchBuffer_;
23 bool isRetyping_ = false;
24 std::string variableToRetype_;
25 
26 void DrawRetypePopup();
27 
28 ShadPKG::Decompiler::IR::Function *selectedFunction_ = nullptr;
29 std::shared_ptr<PKG> lastPkg_; // Track current PKG to detect changes
30 bool showDisassembly_ = true;
31 bool showPseudocode_ = true;
32 
33 // Text Editor state (using ImGui input text for now, or just text rendering)
34 std::string currentCode_;
35 bool codeDirty_ = true; // Use to trigger regeneration
36 
37 // Interactive State
38 uint64_t renameAddress_ = 0;
39 char renameBuffer_[256] = "";
40};
41 
42} // namespace ShadPKG::GUI
43