nstool/src/NsoProcess.h

49 lines
1 KiB
C
Raw Normal View History

2019-01-31 09:10:19 +00:00
#pragma once
#include "types.h"
#include "RoMetadataProcess.h"
2019-01-31 09:10:19 +00:00
#include <nn/hac/define/meta.h>
#include <nn/hac/NsoHeader.h>
namespace nstool {
2019-01-31 09:10:19 +00:00
class NsoProcess
{
public:
NsoProcess();
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);
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;
bool mIs64BitInstruction;
2019-01-31 09:10:19 +00:00
bool mListApi;
bool mListSymbols;
nn::hac::NsoHeader mHdr;
tc::ByteData mTextBlob, mRoBlob, mDataBlob;
nstool::RoMetadataProcess mRoMeta;
2019-01-31 09:10:19 +00:00
void importHeader();
void importCodeSegments();
void displayNsoHeader();
void processRoMeta();
size_t decompressData(const byte_t* src, size_t src_len, byte_t* dst, size_t dst_capacity);
};
}