2019-01-31 09:10:19 +00:00
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
|
|
|
#include <fnd/IFile.h>
|
|
|
|
#include <fnd/SharedPtr.h>
|
|
|
|
#include <nn/hac/define/meta.h>
|
|
|
|
#include <nn/hac/NsoHeader.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "RoMetadataProcess.h"
|
|
|
|
|
|
|
|
class NsoProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NsoProcess();
|
|
|
|
|
|
|
|
void process();
|
|
|
|
|
|
|
|
void setInputFile(const fnd::SharedPtr<fnd::IFile>& file);
|
|
|
|
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);
|
|
|
|
|
|
|
|
const RoMetadataProcess& getRoMetadataProcess() const;
|
|
|
|
private:
|
|
|
|
const std::string kModuleName = "NsoProcess";
|
|
|
|
|
|
|
|
fnd::SharedPtr<fnd::IFile> mFile;
|
|
|
|
CliOutputMode mCliOutputMode;
|
|
|
|
bool mVerify;
|
2020-03-10 10:50:52 +00:00
|
|
|
bool mIs64BitInstruction;
|
2019-01-31 09:10:19 +00:00
|
|
|
bool mListApi;
|
|
|
|
bool mListSymbols;
|
|
|
|
|
|
|
|
nn::hac::NsoHeader mHdr;
|
|
|
|
fnd::Vec<byte_t> mTextBlob, mRoBlob, mDataBlob;
|
|
|
|
RoMetadataProcess mRoMeta;
|
|
|
|
|
|
|
|
void importHeader();
|
|
|
|
void importCodeSegments();
|
|
|
|
void displayNsoHeader();
|
|
|
|
void processRoMeta();
|
2018-06-09 15:32:35 +00:00
|
|
|
};
|