2021-02-06 17:24:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <borealis.hpp>
|
|
|
|
#include <switch.h>
|
2021-03-16 02:43:48 +00:00
|
|
|
#include <json.hpp>
|
2021-02-06 17:24:47 +00:00
|
|
|
|
|
|
|
class DownloadCheatsPage : public brls::AppletFrame
|
|
|
|
{
|
2021-06-05 18:10:51 +01:00
|
|
|
protected:
|
2021-02-06 17:24:47 +00:00
|
|
|
brls::List* list;
|
|
|
|
brls::Label* label;
|
|
|
|
brls::ListItem* del;
|
2021-06-05 18:10:51 +01:00
|
|
|
uint64_t tid = 0;
|
|
|
|
std::string bid = "";
|
|
|
|
u32 version = 0;
|
2021-02-06 17:24:47 +00:00
|
|
|
|
|
|
|
DownloadCheatsPage(uint64_t tid);
|
2021-06-05 18:10:51 +01:00
|
|
|
void GetBuildID();
|
|
|
|
void GetBuildIDFromDmnt();
|
|
|
|
void GetVersion();
|
|
|
|
void GetBuildIDFromFile();
|
|
|
|
void WriteCheats(std::string cheatContent);
|
|
|
|
void DeleteCheats();
|
2021-02-10 17:41:13 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u64 base;
|
|
|
|
u64 size;
|
|
|
|
} DmntMemoryRegionExtents;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u64 process_id;
|
|
|
|
u64 title_id;
|
|
|
|
DmntMemoryRegionExtents main_nso_extents;
|
|
|
|
DmntMemoryRegionExtents heap_extents;
|
|
|
|
DmntMemoryRegionExtents alias_extents;
|
|
|
|
DmntMemoryRegionExtents address_space_extents;
|
|
|
|
u8 main_nso_build_id[0x20];
|
|
|
|
} DmntCheatProcessMetadata;
|
2021-06-05 18:10:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class DownloadCheatsPage_CheatSlips : public DownloadCheatsPage {
|
|
|
|
|
|
|
|
private:
|
|
|
|
brls::ToggleListItem* listItem;
|
|
|
|
std::vector<std::pair<brls::ToggleListItem*, int>> toggles;
|
|
|
|
std::string GetCheatsTitle(nlohmann::json cheat);
|
|
|
|
void ShowCheatsContent(nlohmann::ordered_json titles);
|
|
|
|
|
|
|
|
public:
|
|
|
|
DownloadCheatsPage_CheatSlips(uint64_t tid);
|
|
|
|
};
|
|
|
|
|
|
|
|
class DownloadCheatsPage_GbaTemp : public DownloadCheatsPage {
|
|
|
|
private:
|
|
|
|
brls::ListItem* listItem;
|
|
|
|
|
|
|
|
public:
|
|
|
|
DownloadCheatsPage_GbaTemp(uint64_t tid);
|
2021-02-06 17:24:47 +00:00
|
|
|
};
|