2019-01-31 09:10:19 +00:00
|
|
|
#pragma once
|
2021-09-28 11:15:54 +00:00
|
|
|
#include "types.h"
|
|
|
|
#include "RoMetadataProcess.h"
|
|
|
|
#include "AssetProcess.h"
|
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
#include <nn/hac/NroHeader.h>
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
namespace nstool {
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
class NroProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NroProcess();
|
|
|
|
|
|
|
|
void process();
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
void setInputFile(const std::shared_ptr<tc::io::IStream>& file);
|
2019-01-31 09:10:19 +00:00
|
|
|
void setCliOutputMode(CliOutputMode type);
|
|
|
|
void setVerifyMode(bool verify);
|
|
|
|
|
2020-03-10 10:50:52 +00:00
|
|
|
void setIs64BitInstruction(bool flag);
|
2019-01-31 09:10:19 +00:00
|
|
|
void setListApi(bool listApi);
|
|
|
|
void setListSymbols(bool listSymbols);
|
|
|
|
|
|
|
|
// for homebrew NROs with Asset blobs appended
|
2021-10-01 09:39:34 +00:00
|
|
|
void setAssetIconExtractPath(const tc::io::Path& path);
|
|
|
|
void setAssetNacpExtractPath(const tc::io::Path& path);
|
2021-10-11 12:18:43 +00:00
|
|
|
void setAssetRomfsShowFsTree(bool show_fs_tree);
|
|
|
|
void setAssetRomfsExtractJobs(const std::vector<nstool::ExtractJob>& extract_jobs);
|
2019-01-31 09:10:19 +00:00
|
|
|
|
2021-10-11 12:18:43 +00:00
|
|
|
const nstool::RoMetadataProcess& getRoMetadataProcess() const;
|
2019-01-31 09:10:19 +00:00
|
|
|
private:
|
2021-10-11 12:18:43 +00:00
|
|
|
std::string mModuleName;
|
2019-01-31 09:10:19 +00:00
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
std::shared_ptr<tc::io::IStream> mFile;
|
2019-01-31 09:10:19 +00:00
|
|
|
CliOutputMode mCliOutputMode;
|
|
|
|
bool mVerify;
|
|
|
|
|
|
|
|
nn::hac::NroHeader mHdr;
|
2021-09-28 11:15:54 +00:00
|
|
|
tc::ByteData mTextBlob, mRoBlob, mDataBlob;
|
2021-10-11 12:18:43 +00:00
|
|
|
nstool::RoMetadataProcess mRoMeta;
|
2019-01-31 09:10:19 +00:00
|
|
|
bool mIsHomebrewNro;
|
2021-10-11 12:18:43 +00:00
|
|
|
nstool::AssetProcess mAssetProc;
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
void importHeader();
|
|
|
|
void importCodeSegments();
|
|
|
|
void displayHeader();
|
|
|
|
void processRoMeta();
|
2021-09-28 11:15:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|