#pragma once #include #include #include #include #include #include "common.h" #include "SdkApiString.h" #include "ElfSymbolParser.h" class RoMetadataProcess { public: RoMetadataProcess(); void process(); void setRoBinary(const fnd::Vec& bin); 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); void setListApi(bool listApi); void setListSymbols(bool listSymbols); const std::vector& getSdkVerApiList() const; const std::vector& getPublicApiList() const; const std::vector& getDebugApiList() const; const std::vector& getPrivateApiList() const; const fnd::List& getSymbolList() const; private: const std::string kModuleName = "RoMetadataProcess"; CliOutputMode mCliOutputMode; bool mIs64BitInstruction; bool mListApi; bool mListSymbols; struct sLayout { sLayout() : offset(0), size(0) {} size_t offset; size_t size; }; sLayout mApiInfo; sLayout mDynSym; sLayout mDynStr; fnd::Vec mRoBlob; std::vector mSdkVerApiList; std::vector mPublicApiList; std::vector mDebugApiList; std::vector mPrivateApiList; ElfSymbolParser mSymbolList; void importApiList(); void displayRoMetaData(); const char* getSectionIndexStr(uint16_t shn_index) const; const char* getSymbolTypeStr(byte_t symbol_type) const; const char* getSymbolBindingStr(byte_t symbol_binding) const; };