nstool/src/NroProcess.h

51 lines
1.2 KiB
C
Raw Normal View History

2019-01-31 09:10:19 +00:00
#pragma once
#include "types.h"
#include "RoMetadataProcess.h"
#include "AssetProcess.h"
2019-01-31 09:10:19 +00:00
#include <nn/hac/NroHeader.h>
namespace nstool {
2019-01-31 09:10:19 +00:00
class NroProcess
{
public:
NroProcess();
void process();
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);
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
void setAssetIconExtractPath(const tc::io::Path& path);
void setAssetNacpExtractPath(const tc::io::Path& path);
void setAssetRomfsShowFsTree(bool show_fs_tree);
void setAssetRomfsExtractJobs(const std::vector<nstool::ExtractJob>& extract_jobs);
2019-01-31 09:10:19 +00:00
const nstool::RoMetadataProcess& getRoMetadataProcess() const;
2019-01-31 09:10:19 +00:00
private:
std::string mModuleName;
2019-01-31 09:10:19 +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;
tc::ByteData mTextBlob, mRoBlob, mDataBlob;
nstool::RoMetadataProcess mRoMeta;
2019-01-31 09:10:19 +00:00
bool mIsHomebrewNro;
nstool::AssetProcess mAssetProc;
2019-01-31 09:10:19 +00:00
void importHeader();
void importCodeSegments();
void displayHeader();
void processRoMeta();
};
}