nstool/src/NroProcess.h

52 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/define/meta.h>
#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 setAssetListFs(bool list);
void setAssetIconExtractPath(const tc::io::Path& path);
void setAssetNacpExtractPath(const tc::io::Path& path);
void setAssetRomfsExtractPath(const tc::io::Path& path);
2019-01-31 09:10:19 +00:00
const RoMetadataProcess& getRoMetadataProcess() const;
private:
const std::string kModuleName = "NroProcess";
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;
2019-01-31 09:10:19 +00:00
RoMetadataProcess mRoMeta;
bool mIsHomebrewNro;
AssetProcess mAssetProc;
void importHeader();
void importCodeSegments();
void displayHeader();
void processRoMeta();
};
}