From 1a6269db5140004bde756ef4901032ef8c05f60c Mon Sep 17 00:00:00 2001 From: jakcron Date: Tue, 10 Jul 2018 23:13:19 +0800 Subject: [PATCH] [nxtool] Add get() methods to Nso & Nro Processes for access to .ro data --- programs/nstool/source/NroProcess.cpp | 5 ++++ programs/nstool/source/NroProcess.h | 2 ++ programs/nstool/source/NsoProcess.cpp | 5 ++++ programs/nstool/source/NsoProcess.h | 2 ++ programs/nstool/source/RoMetadataProcess.cpp | 25 ++++++++++++++++++++ programs/nstool/source/RoMetadataProcess.h | 6 +++++ 6 files changed, 45 insertions(+) diff --git a/programs/nstool/source/NroProcess.cpp b/programs/nstool/source/NroProcess.cpp index f7aace2..1ecb652 100644 --- a/programs/nstool/source/NroProcess.cpp +++ b/programs/nstool/source/NroProcess.cpp @@ -91,6 +91,11 @@ void NroProcess::setAssetRomfsExtractPath(const std::string& path) mAssetProc.setRomfsExtractPath(path); } +const RoMetadataProcess& NroProcess::getRoMetadataProcess() const +{ + return mRoMeta; +} + void NroProcess::importHeader() { fnd::Vec scratch; diff --git a/programs/nstool/source/NroProcess.h b/programs/nstool/source/NroProcess.h index 3c5ee99..6fbdf59 100644 --- a/programs/nstool/source/NroProcess.h +++ b/programs/nstool/source/NroProcess.h @@ -31,6 +31,8 @@ public: void setAssetIconExtractPath(const std::string& path); void setAssetNacpExtractPath(const std::string& path); void setAssetRomfsExtractPath(const std::string& path); + + const RoMetadataProcess& getRoMetadataProcess() const; private: const std::string kModuleName = "NroProcess"; diff --git a/programs/nstool/source/NsoProcess.cpp b/programs/nstool/source/NsoProcess.cpp index ac68f3a..ff81e7f 100644 --- a/programs/nstool/source/NsoProcess.cpp +++ b/programs/nstool/source/NsoProcess.cpp @@ -66,6 +66,11 @@ void NsoProcess::setListSymbols(bool listSymbols) mRoMeta.setListSymbols(listSymbols); } +const RoMetadataProcess& NsoProcess::getRoMetadataProcess() const +{ + return mRoMeta; +} + void NsoProcess::importHeader() { fnd::Vec scratch; diff --git a/programs/nstool/source/NsoProcess.h b/programs/nstool/source/NsoProcess.h index 3fcecec..9088da2 100644 --- a/programs/nstool/source/NsoProcess.h +++ b/programs/nstool/source/NsoProcess.h @@ -24,6 +24,8 @@ public: void setInstructionType(nx::npdm::InstructionType type); void setListApi(bool listApi); void setListSymbols(bool listSymbols); + + const RoMetadataProcess& getRoMetadataProcess() const; private: const std::string kModuleName = "NsoProcess"; diff --git a/programs/nstool/source/RoMetadataProcess.cpp b/programs/nstool/source/RoMetadataProcess.cpp index 89b891a..af06e44 100644 --- a/programs/nstool/source/RoMetadataProcess.cpp +++ b/programs/nstool/source/RoMetadataProcess.cpp @@ -74,6 +74,31 @@ void RoMetadataProcess::setListSymbols(bool listSymbols) mListSymbols = listSymbols; } +const std::vector& RoMetadataProcess::getSdkVerApiList() const +{ + return mSdkVerApiList; +} + +const std::vector& RoMetadataProcess::getPublicApiList() const +{ + return mPublicApiList; +} + +const std::vector& RoMetadataProcess::getDebugApiList() const +{ + return mDebugApiList; +} + +const std::vector& RoMetadataProcess::getPrivateApiList() const +{ + return mPrivateApiList; +} + +const fnd::List& RoMetadataProcess::getSymbolList() const +{ + return mSymbolList.getSymbolList(); +} + void RoMetadataProcess::importApiList() { if (mApiInfo.size > 0) diff --git a/programs/nstool/source/RoMetadataProcess.h b/programs/nstool/source/RoMetadataProcess.h index 5ac36c7..477374f 100644 --- a/programs/nstool/source/RoMetadataProcess.h +++ b/programs/nstool/source/RoMetadataProcess.h @@ -27,6 +27,12 @@ public: void setInstructionType(nx::npdm::InstructionType type); 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";