2018-06-09 15:32:35 +00:00
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
|
|
|
#include <fnd/IFile.h>
|
2018-09-23 03:29:22 +00:00
|
|
|
#include <fnd/SharedPtr.h>
|
2018-08-07 07:17:51 +00:00
|
|
|
#include <nn/hac/npdm.h>
|
|
|
|
#include <nn/hac/NsoHeader.h>
|
2018-06-09 15:32:35 +00:00
|
|
|
|
2018-09-13 11:06:48 +00:00
|
|
|
#include "common.h"
|
2018-06-19 10:37:27 +00:00
|
|
|
#include "RoMetadataProcess.h"
|
2018-06-09 15:32:35 +00:00
|
|
|
|
2018-06-10 15:48:04 +00:00
|
|
|
class NsoProcess
|
2018-06-09 15:32:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-06-10 15:48:04 +00:00
|
|
|
NsoProcess();
|
2018-06-09 15:32:35 +00:00
|
|
|
|
|
|
|
void process();
|
|
|
|
|
2018-09-23 03:29:22 +00:00
|
|
|
void setInputFile(const fnd::SharedPtr<fnd::IFile>& file);
|
2018-06-18 15:30:19 +00:00
|
|
|
void setCliOutputMode(CliOutputMode type);
|
2018-06-09 15:32:35 +00:00
|
|
|
void setVerifyMode(bool verify);
|
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
void setInstructionType(nn::hac::npdm::InstructionType type);
|
2018-06-09 15:32:35 +00:00
|
|
|
void setListApi(bool listApi);
|
|
|
|
void setListSymbols(bool listSymbols);
|
2018-07-10 15:13:19 +00:00
|
|
|
|
|
|
|
const RoMetadataProcess& getRoMetadataProcess() const;
|
2018-06-09 15:32:35 +00:00
|
|
|
private:
|
2018-06-10 15:48:04 +00:00
|
|
|
const std::string kModuleName = "NsoProcess";
|
2018-06-09 15:32:35 +00:00
|
|
|
|
2018-09-23 03:29:22 +00:00
|
|
|
fnd::SharedPtr<fnd::IFile> mFile;
|
2018-06-18 15:30:19 +00:00
|
|
|
CliOutputMode mCliOutputMode;
|
2018-06-09 15:32:35 +00:00
|
|
|
bool mVerify;
|
2018-08-07 07:17:51 +00:00
|
|
|
nn::hac::npdm::InstructionType mInstructionType;
|
2018-06-09 15:32:35 +00:00
|
|
|
bool mListApi;
|
|
|
|
bool mListSymbols;
|
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
nn::hac::NsoHeader mHdr;
|
2018-06-24 15:01:16 +00:00
|
|
|
fnd::Vec<byte_t> mTextBlob, mRoBlob, mDataBlob;
|
2018-06-19 10:37:27 +00:00
|
|
|
RoMetadataProcess mRoMeta;
|
2018-06-09 15:32:35 +00:00
|
|
|
|
|
|
|
void importHeader();
|
|
|
|
void importCodeSegments();
|
|
|
|
void displayNsoHeader();
|
2018-06-19 10:37:27 +00:00
|
|
|
void processRoMeta();
|
2018-06-09 15:32:35 +00:00
|
|
|
};
|