2018-11-05 13:11:08 +00:00
|
|
|
#pragma once
|
2021-09-28 11:15:54 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
2018-11-05 13:11:08 +00:00
|
|
|
#include <nn/hac/IniHeader.h>
|
|
|
|
#include <nn/hac/KernelInitialProcessHeader.h>
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
namespace nstool {
|
2018-11-05 13:11:08 +00:00
|
|
|
|
|
|
|
class IniProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IniProcess();
|
|
|
|
|
|
|
|
void process();
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
void setInputFile(const std::shared_ptr<tc::io::IStream>& file);
|
2018-11-05 13:11:08 +00:00
|
|
|
void setCliOutputMode(CliOutputMode type);
|
|
|
|
void setVerifyMode(bool verify);
|
|
|
|
|
|
|
|
void setKipExtractPath(const std::string& path);
|
|
|
|
private:
|
|
|
|
const std::string kModuleName = "IniProcess";
|
|
|
|
const std::string kKipExtention = ".kip";
|
|
|
|
const size_t kCacheSize = 0x10000;
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
std::shared_ptr<tc::io::IStream> mFile;
|
2018-11-05 13:11:08 +00:00
|
|
|
CliOutputMode mCliOutputMode;
|
|
|
|
bool mVerify;
|
|
|
|
|
|
|
|
bool mDoExtractKip;
|
|
|
|
std::string mKipExtractPath;
|
|
|
|
|
|
|
|
nn::hac::IniHeader mHdr;
|
2021-09-28 11:15:54 +00:00
|
|
|
std::vector<std::shared_ptr<tc::io::IStream>> mKipList;
|
2018-11-05 13:11:08 +00:00
|
|
|
|
|
|
|
void importHeader();
|
|
|
|
void importKipList();
|
|
|
|
void displayHeader();
|
|
|
|
void displayKipList();
|
|
|
|
void extractKipList();
|
|
|
|
|
|
|
|
size_t getKipSizeFromHeader(const nn::hac::KernelInitialProcessHeader& hdr) const;
|
2021-09-28 11:15:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|