nstool/src/RoMetadataProcess.h

69 lines
1.7 KiB
C
Raw Normal View History

2019-01-31 09:10:19 +00:00
#pragma once
#include "types.h"
#include "SdkApiString.h"
#include "ElfSymbolParser.h"
2019-01-31 09:10:19 +00:00
#include <nn/hac/define/meta.h>
namespace nstool {
2019-01-31 09:10:19 +00:00
class RoMetadataProcess
{
public:
RoMetadataProcess();
void process();
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);
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;
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;
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;
};
}