2019-01-31 09:10:19 +00:00
|
|
|
#pragma once
|
2021-09-28 11:15:54 +00:00
|
|
|
#include "types.h"
|
|
|
|
#include "SdkApiString.h"
|
|
|
|
#include "ElfSymbolParser.h"
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
#include <nn/hac/define/meta.h>
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
namespace nstool {
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
class RoMetadataProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RoMetadataProcess();
|
|
|
|
|
|
|
|
void process();
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
void setRoBinary(const tc::ByteData& bin);
|
2019-01-31 09:10:19 +00:00
|
|
|
void setApiInfo(size_t offset, size_t size);
|
|
|
|
void setDynSym(size_t offset, size_t size);
|
|
|
|
void setDynStr(size_t offset, size_t size);
|
|
|
|
|
|
|
|
void setCliOutputMode(CliOutputMode type);
|
|
|
|
|
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);
|
|
|
|
|
2021-10-01 13:14:46 +00:00
|
|
|
const std::vector<nstool::SdkApiString>& getSdkVerApiList() const;
|
|
|
|
const std::vector<nstool::SdkApiString>& getPublicApiList() const;
|
|
|
|
const std::vector<nstool::SdkApiString>& getDebugApiList() const;
|
|
|
|
const std::vector<nstool::SdkApiString>& getPrivateApiList() const;
|
|
|
|
const std::vector<nstool::SdkApiString>& getGuidelineApiList() const;
|
|
|
|
const std::vector<nstool::ElfSymbolParser::sElfSymbol>& getSymbolList() const;
|
2019-01-31 09:10:19 +00:00
|
|
|
private:
|
2021-10-01 13:14:46 +00:00
|
|
|
std::string mModuleName;
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
CliOutputMode mCliOutputMode;
|
2020-03-10 10:50:52 +00:00
|
|
|
bool mIs64BitInstruction;
|
2019-01-31 09:10:19 +00:00
|
|
|
bool mListApi;
|
|
|
|
bool mListSymbols;
|
|
|
|
|
|
|
|
struct sLayout
|
|
|
|
{
|
|
|
|
sLayout() : offset(0), size(0) {}
|
|
|
|
size_t offset;
|
|
|
|
size_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
sLayout mApiInfo;
|
|
|
|
sLayout mDynSym;
|
|
|
|
sLayout mDynStr;
|
2021-09-28 11:15:54 +00:00
|
|
|
tc::ByteData mRoBlob;
|
2019-01-31 09:10:19 +00:00
|
|
|
std::vector<SdkApiString> mSdkVerApiList;
|
|
|
|
std::vector<SdkApiString> mPublicApiList;
|
|
|
|
std::vector<SdkApiString> mDebugApiList;
|
|
|
|
std::vector<SdkApiString> mPrivateApiList;
|
2020-05-23 08:03:27 +00:00
|
|
|
std::vector<SdkApiString> mGuidelineApiList;
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
ElfSymbolParser mSymbolList;
|
|
|
|
|
|
|
|
void importApiList();
|
|
|
|
void displayRoMetaData();
|
|
|
|
|
2021-10-01 13:14:46 +00:00
|
|
|
std::string getSectionIndexStr(uint16_t shn_index) const;
|
|
|
|
std::string getSymbolTypeStr(byte_t symbol_type) const;
|
|
|
|
std::string getSymbolBindingStr(byte_t symbol_binding) const;
|
2021-09-28 11:15:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|