mirror of
https://github.com/jakcron/nstool
synced 2024-11-15 02:06:40 +00:00
[nstool] Add definitons and code for recognising INI/KIP files.
This commit is contained in:
parent
8f9694a769
commit
5af7558a1b
2 changed files with 16 additions and 2 deletions
|
@ -24,6 +24,8 @@
|
|||
#include <nn/hac/define/nacp.h>
|
||||
#include <nn/hac/define/nso.h>
|
||||
#include <nn/hac/define/nro.h>
|
||||
#include <nn/hac/define/ini.h>
|
||||
#include <nn/hac/define/kip.h>
|
||||
#include <nn/hac/define/aset.h>
|
||||
#include <nn/pki/SignedData.h>
|
||||
#include <nn/pki/CertificateBody.h>
|
||||
|
@ -52,7 +54,7 @@ void UserSettings::showHelp()
|
|||
printf("\n General Options:\n");
|
||||
printf(" -d, --dev Use devkit keyset.\n");
|
||||
printf(" -k, --keyset Specify keyset file.\n");
|
||||
printf(" -t, --type Specify input file type. [xci, pfs, romfs, nca, meta, cnmt, nso, nro, nacp, aset, cert, tik]\n");
|
||||
printf(" -t, --type Specify input file type. [xci, pfs, romfs, nca, meta, cnmt, nso, nro, ini, kip, nacp, aset, cert, tik]\n");
|
||||
printf(" -y, --verify Verify file.\n");
|
||||
printf("\n Output Options:\n");
|
||||
printf(" --showkeys Show keys generated.\n");
|
||||
|
@ -610,6 +612,10 @@ FileType UserSettings::getFileTypeFromString(const std::string& type_str)
|
|||
type = FILE_NSO;
|
||||
else if (str == "nro")
|
||||
type = FILE_NRO;
|
||||
else if (str == "ini")
|
||||
type = FILE_INI;
|
||||
else if (str == "kip")
|
||||
type = FILE_KIP;
|
||||
else if (str == "nacp")
|
||||
type = FILE_NACP;
|
||||
else if (str == "cert")
|
||||
|
@ -665,9 +671,15 @@ FileType UserSettings::determineFileTypeFromFile(const std::string& path)
|
|||
// test nso
|
||||
else if (_ASSERT_SIZE(sizeof(nn::hac::sNsoHeader)) && _TYPE_PTR(nn::hac::sNsoHeader)->st_magic.get() == nn::hac::nso::kNsoStructMagic)
|
||||
file_type = FILE_NSO;
|
||||
// test nso
|
||||
// test nro
|
||||
else if (_ASSERT_SIZE(sizeof(nn::hac::sNroHeader)) && _TYPE_PTR(nn::hac::sNroHeader)->st_magic.get() == nn::hac::nro::kNroStructMagic)
|
||||
file_type = FILE_NRO;
|
||||
// test ini
|
||||
else if (_ASSERT_SIZE(sizeof(nn::hac::sIniHeader)) && _TYPE_PTR(nn::hac::sIniHeader)->st_magic.get() == nn::hac::ini::kIniStructMagic)
|
||||
file_type = FILE_INI;
|
||||
// test kip
|
||||
else if (_ASSERT_SIZE(sizeof(nn::hac::sKipHeader)) && _TYPE_PTR(nn::hac::sKipHeader)->st_magic.get() == nn::hac::kip::kKipStructMagic)
|
||||
file_type = FILE_KIP;
|
||||
// test pki certificate
|
||||
else if (determineValidEsCertFromSample(scratch))
|
||||
file_type = FILE_PKI_CERT;
|
||||
|
|
|
@ -20,6 +20,8 @@ enum FileType
|
|||
FILE_NSO,
|
||||
FILE_NRO,
|
||||
FILE_NACP,
|
||||
FILE_INI,
|
||||
FILE_KIP,
|
||||
FILE_PKI_CERT,
|
||||
FILE_ES_TIK,
|
||||
FILE_HB_ASSET,
|
||||
|
|
Loading…
Reference in a new issue