Remove references to nn::hac::meta::InstructionType

This commit is contained in:
Jack 2020-03-10 18:50:52 +08:00
parent 730b7e5641
commit 84e17b5926
8 changed files with 31 additions and 28 deletions

View file

@ -43,9 +43,9 @@ void NroProcess::setVerifyMode(bool verify)
mVerify = verify;
}
void NroProcess::setInstructionType(nn::hac::meta::InstructionType type)
void NroProcess::setIs64BitInstruction(bool flag)
{
mRoMeta.setInstructionType(type);
mRoMeta.setIs64BitInstruction(flag);
}
void NroProcess::setListApi(bool listApi)

View file

@ -22,7 +22,7 @@ public:
void setCliOutputMode(CliOutputMode type);
void setVerifyMode(bool verify);
void setInstructionType(nn::hac::meta::InstructionType type);
void setIs64BitInstruction(bool flag);
void setListApi(bool listApi);
void setListSymbols(bool listSymbols);

View file

@ -9,7 +9,10 @@
NsoProcess::NsoProcess():
mFile(),
mCliOutputMode(_BIT(OUTPUT_BASIC)),
mVerify(false)
mVerify(false),
mIs64BitInstruction(true),
mListApi(false),
mListSymbols(false)
{
}
@ -38,9 +41,9 @@ void NsoProcess::setVerifyMode(bool verify)
mVerify = verify;
}
void NsoProcess::setInstructionType(nn::hac::meta::InstructionType type)
void NsoProcess::setIs64BitInstruction(bool flag)
{
mRoMeta.setInstructionType(type);
mRoMeta.setIs64BitInstruction(flag);
}
void NsoProcess::setListApi(bool listApi)

View file

@ -21,7 +21,7 @@ public:
void setCliOutputMode(CliOutputMode type);
void setVerifyMode(bool verify);
void setInstructionType(nn::hac::meta::InstructionType type);
void setIs64BitInstruction(bool flag);
void setListApi(bool listApi);
void setListSymbols(bool listSymbols);
@ -32,7 +32,7 @@ private:
fnd::SharedPtr<fnd::IFile> mFile;
CliOutputMode mCliOutputMode;
bool mVerify;
nn::hac::meta::InstructionType mInstructionType;
bool mIs64BitInstruction;
bool mListApi;
bool mListSymbols;

View file

@ -7,7 +7,7 @@
RoMetadataProcess::RoMetadataProcess() :
mCliOutputMode(_BIT(OUTPUT_BASIC)),
mInstructionType(nn::hac::meta::INSTR_64BIT),
mIs64BitInstruction(true),
mListApi(false),
mListSymbols(false),
mApiInfo(),
@ -57,9 +57,9 @@ void RoMetadataProcess::setCliOutputMode(CliOutputMode type)
mCliOutputMode = type;
}
void RoMetadataProcess::setInstructionType(nn::hac::meta::InstructionType type)
void RoMetadataProcess::setIs64BitInstruction(bool flag)
{
mInstructionType = type;
mIs64BitInstruction = flag;
}
void RoMetadataProcess::setListApi(bool listApi)
@ -126,7 +126,7 @@ void RoMetadataProcess::importApiList()
if (mDynSym.size > 0)
{
mSymbolList.parseData(mRoBlob.data() + mDynSym.offset, mDynSym.size, mRoBlob.data() + mDynStr.offset, mDynStr.size, mInstructionType == nn::hac::meta::INSTR_64BIT);
mSymbolList.parseData(mRoBlob.data() + mDynSym.offset, mDynSym.size, mRoBlob.data() + mDynStr.offset, mDynStr.size, mIs64BitInstruction);
}
}

View file

@ -24,7 +24,7 @@ public:
void setCliOutputMode(CliOutputMode type);
void setInstructionType(nn::hac::meta::InstructionType type);
void setIs64BitInstruction(bool flag);
void setListApi(bool listApi);
void setListSymbols(bool listSymbols);
@ -37,7 +37,7 @@ private:
const std::string kModuleName = "RoMetadataProcess";
CliOutputMode mCliOutputMode;
nn::hac::meta::InstructionType mInstructionType;
bool mIs64BitInstruction;
bool mListApi;
bool mListSymbols;

View file

@ -138,9 +138,9 @@ bool UserSettings::isListSymbols() const
return mListSymbols;
}
nn::hac::meta::InstructionType UserSettings::getInstType() const
bool UserSettings::getIs64BitInstruction() const
{
return mInstructionType;
return mIs64BitInstruction;
}
const sOptional<std::string>& UserSettings::getXciUpdatePath() const
@ -564,9 +564,9 @@ void UserSettings::populateUserSettings(sCmdArgs& args)
// determine the architecture type for NSO/NRO
if (args.inst_type.isSet)
mInstructionType = getInstructionTypeFromString(*args.inst_type);
mIs64BitInstruction = getIs64BitInstructionFromString(*args.inst_type);
else
mInstructionType = nn::hac::meta::INSTR_64BIT; // default 64bit
mIs64BitInstruction = true; // default 64bit
mListApi = args.list_api.isSet;
mListSymbols = args.list_sym.isSet;
@ -800,7 +800,7 @@ bool UserSettings::determineValidNacpFromSample(const fnd::Vec<byte_t>& sample)
const nn::hac::sApplicationControlProperty* data = (const nn::hac::sApplicationControlProperty*)sample.data();
if (data->logo_type > nn::hac::nacp::LOGO_Nintendo)
if (data->logo_type > (byte_t)nn::hac::nacp::LogoType::Nintendo)
return false;
if (data->display_version[0] == 0)
@ -862,20 +862,20 @@ bool UserSettings::determineValidEsTikFromSample(const fnd::Vec<byte_t>& sample)
return true;
}
nn::hac::meta::InstructionType UserSettings::getInstructionTypeFromString(const std::string & type_str)
bool UserSettings::getIs64BitInstructionFromString(const std::string & type_str)
{
std::string str = type_str;
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
nn::hac::meta::InstructionType type;
bool flag;
if (str == "32bit")
type = nn::hac::meta::INSTR_32BIT;
flag = false;
else if (str == "64bit")
type = nn::hac::meta::INSTR_64BIT;
flag = true;
else
throw fnd::Exception(kModuleName, "Unsupported instruction type: " + str);
return type;
return flag;
}
void UserSettings::getHomePath(std::string& path) const
@ -944,7 +944,7 @@ void UserSettings::dumpKeyConfig() const
dumpAesKey(aes_key, "Extended Header Encryption Key", 2);
if (mKeyCfg.getAcidSignKey(rsa2048_key) == true)
if (mKeyCfg.getAcidSignKey(rsa2048_key, 0x00) == true)
dumpRsa2048Key(rsa2048_key, "ACID Signer Key", 1);

View file

@ -29,7 +29,7 @@ public:
bool isListFs() const;
bool isListApi() const;
bool isListSymbols() const;
nn::hac::meta::InstructionType getInstType() const;
bool getIs64BitInstruction() const;
// specialised paths
const sOptional<std::string>& getXciUpdatePath() const;
@ -114,7 +114,7 @@ private:
bool mListApi;
bool mListSymbols;
nn::hac::meta::InstructionType mInstructionType;
bool mIs64BitInstruction;
void populateCmdArgs(const std::vector<std::string>& arg_list, sCmdArgs& cmd_args);
void populateKeyset(sCmdArgs& args);
@ -126,7 +126,7 @@ private:
bool determineValidNacpFromSample(const fnd::Vec<byte_t>& sample) const;
bool determineValidEsCertFromSample(const fnd::Vec<byte_t>& sample) const;
bool determineValidEsTikFromSample(const fnd::Vec<byte_t>& sample) const;
nn::hac::meta::InstructionType getInstructionTypeFromString(const std::string& type_str);
bool getIs64BitInstructionFromString(const std::string& type_str);
void getHomePath(std::string& path) const;
void getSwitchPath(std::string& path) const;