[hac|nstool] Move define headers to separate folder. Renamed classes to omit "Binary".

This commit is contained in:
jakcron 2018-10-22 21:30:49 +08:00
parent 7937055bd6
commit c35f31f431
64 changed files with 362 additions and 362 deletions

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <nn/hac/nro.h> #include <nn/hac/define/nro.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -2,10 +2,10 @@
#include <string> #include <string>
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/aci.h> #include <nn/hac/define/aci.h>
#include <nn/hac/FileSystemAccessControlBinary.h> #include <nn/hac/FileSystemAccessControl.h>
#include <nn/hac/ServiceAccessControlBinary.h> #include <nn/hac/ServiceAccessControl.h>
#include <nn/hac/KernelCapabilityBinary.h> #include <nn/hac/KernelCapabilityControl.h>
namespace nn namespace nn
{ {
@ -33,14 +33,14 @@ namespace hac
uint64_t getProgramId() const; uint64_t getProgramId() const;
void setProgramId(uint64_t program_id); void setProgramId(uint64_t program_id);
const nn::hac::FileSystemAccessControlBinary& getFileSystemAccessControl() const; const nn::hac::FileSystemAccessControl& getFileSystemAccessControl() const;
void setFileSystemAccessControl(const FileSystemAccessControlBinary& fac); void setFileSystemAccessControl(const FileSystemAccessControl& fac);
const nn::hac::ServiceAccessControlBinary& getServiceAccessControl() const; const nn::hac::ServiceAccessControl& getServiceAccessControl() const;
void setServiceAccessControl(const ServiceAccessControlBinary& sac); void setServiceAccessControl(const ServiceAccessControl& sac);
const nn::hac::KernelCapabilityBinary& getKernelCapabilities() const; const nn::hac::KernelCapabilityControl& getKernelCapabilities() const;
void setKernelCapabilities(const KernelCapabilityBinary& kc); void setKernelCapabilities(const KernelCapabilityControl& kc);
private: private:
const std::string kModuleName = "ACCESS_CONTROL_INFO_BINARY"; const std::string kModuleName = "ACCESS_CONTROL_INFO_BINARY";
@ -49,9 +49,9 @@ namespace hac
// variables // variables
uint64_t mProgramId; uint64_t mProgramId;
nn::hac::FileSystemAccessControlBinary mFileSystemAccessControl; nn::hac::FileSystemAccessControl mFileSystemAccessControl;
nn::hac::ServiceAccessControlBinary mServiceAccessControl; nn::hac::ServiceAccessControl mServiceAccessControl;
nn::hac::KernelCapabilityBinary mKernelCapabilities; nn::hac::KernelCapabilityControl mKernelCapabilities;
}; };
} }
} }

View file

@ -3,10 +3,10 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/aci.h> #include <nn/hac/define/aci.h>
#include <nn/hac/FileSystemAccessControlBinary.h> #include <nn/hac/FileSystemAccessControl.h>
#include <nn/hac/ServiceAccessControlBinary.h> #include <nn/hac/ServiceAccessControl.h>
#include <nn/hac/KernelCapabilityBinary.h> #include <nn/hac/KernelCapabilityControl.h>
namespace nn namespace nn
{ {
@ -66,14 +66,14 @@ namespace hac
const sProgramIdRestrict& getProgramIdRestrict() const; const sProgramIdRestrict& getProgramIdRestrict() const;
void setProgramIdRestrict(const sProgramIdRestrict& pid_restrict); void setProgramIdRestrict(const sProgramIdRestrict& pid_restrict);
const nn::hac::FileSystemAccessControlBinary& getFileSystemAccessControl() const; const nn::hac::FileSystemAccessControl& getFileSystemAccessControl() const;
void setFileSystemAccessControl(const FileSystemAccessControlBinary& fac); void setFileSystemAccessControl(const FileSystemAccessControl& fac);
const nn::hac::ServiceAccessControlBinary& getServiceAccessControl() const; const nn::hac::ServiceAccessControl& getServiceAccessControl() const;
void setServiceAccessControl(const ServiceAccessControlBinary& sac); void setServiceAccessControl(const ServiceAccessControl& sac);
const nn::hac::KernelCapabilityBinary& getKernelCapabilities() const; const nn::hac::KernelCapabilityControl& getKernelCapabilities() const;
void setKernelCapabilities(const KernelCapabilityBinary& kc); void setKernelCapabilities(const KernelCapabilityControl& kc);
private: private:
const std::string kModuleName = "ACCESS_CONTROL_INFO_DESC_BINARY"; const std::string kModuleName = "ACCESS_CONTROL_INFO_DESC_BINARY";
@ -84,9 +84,9 @@ namespace hac
fnd::rsa::sRsa2048Key mNcaHeaderSignature2Key; fnd::rsa::sRsa2048Key mNcaHeaderSignature2Key;
fnd::List<aci::Flag> mFlags; fnd::List<aci::Flag> mFlags;
sProgramIdRestrict mProgramIdRestrict; sProgramIdRestrict mProgramIdRestrict;
nn::hac::FileSystemAccessControlBinary mFileSystemAccessControl; nn::hac::FileSystemAccessControl mFileSystemAccessControl;
nn::hac::ServiceAccessControlBinary mServiceAccessControl; nn::hac::ServiceAccessControl mServiceAccessControl;
nn::hac::KernelCapabilityBinary mKernelCapabilities; nn::hac::KernelCapabilityControl mKernelCapabilities;
}; };
} }
} }

View file

@ -2,7 +2,7 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
namespace nn namespace nn
{ {

View file

@ -3,7 +3,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <nn/hac/nacp.h> #include <nn/hac/define/nacp.h>
namespace nn namespace nn
{ {

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/nacp.h> #include <nn/hac/define/nacp.h>
namespace nn namespace nn
{ {

View file

@ -2,7 +2,7 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
namespace nn namespace nn
{ {

View file

@ -2,7 +2,7 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
namespace nn namespace nn
{ {

View file

@ -3,7 +3,7 @@
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
#include <nn/hac/ContentInfo.h> #include <nn/hac/ContentInfo.h>
#include <nn/hac/ContentMetaInfo.h> #include <nn/hac/ContentMetaInfo.h>
#include <nn/hac/ApplicationMetaExtendedHeader.h> #include <nn/hac/ApplicationMetaExtendedHeader.h>

View file

@ -2,7 +2,7 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
namespace nn namespace nn
{ {

View file

@ -2,7 +2,7 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
namespace nn namespace nn
{ {

View file

@ -3,13 +3,13 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <nn/hac/fac.h> #include <nn/hac/define/fac.h>
namespace nn namespace nn
{ {
namespace hac namespace hac
{ {
class FileSystemAccessControlBinary : class FileSystemAccessControl :
public fnd::IByteModel public fnd::IByteModel
{ {
public: public:
@ -36,12 +36,12 @@ namespace hac
} }
}; };
FileSystemAccessControlBinary(); FileSystemAccessControl();
FileSystemAccessControlBinary(const FileSystemAccessControlBinary& other); FileSystemAccessControl(const FileSystemAccessControl& other);
void operator=(const FileSystemAccessControlBinary& other); void operator=(const FileSystemAccessControl& other);
bool operator==(const FileSystemAccessControlBinary& other) const; bool operator==(const FileSystemAccessControl& other) const;
bool operator!=(const FileSystemAccessControlBinary& other) const; bool operator!=(const FileSystemAccessControl& other) const;
// IByteModel // IByteModel
void toBytes(); void toBytes();
@ -63,7 +63,7 @@ namespace hac
const fnd::List<sSaveDataOwnerId>& getSaveDataOwnerIdList() const; const fnd::List<sSaveDataOwnerId>& getSaveDataOwnerIdList() const;
void setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list); void setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list);
private: private:
const std::string kModuleName = "FILE_SYSTEM_ACCESS_CONTROL_BINARY"; const std::string kModuleName = "FILE_SYSTEM_ACCESS_CONTROL";
// raw data // raw data
fnd::Vec<byte_t> mRawBinary; fnd::Vec<byte_t> mRawBinary;

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/hierarchicalintegrity.h> #include <nn/hac/define/hierarchicalintegrity.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <fnd/sha.h> #include <fnd/sha.h>

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/hierarchicalsha256.h> #include <nn/hac/define/hierarchicalsha256.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>

View file

@ -16,16 +16,16 @@ namespace nn
{ {
namespace hac namespace hac
{ {
class KernelCapabilityBinary : class KernelCapabilityControl :
public fnd::IByteModel public fnd::IByteModel
{ {
public: public:
KernelCapabilityBinary(); KernelCapabilityControl();
KernelCapabilityBinary(const KernelCapabilityBinary& other); KernelCapabilityControl(const KernelCapabilityControl& other);
void operator=(const KernelCapabilityBinary& other); void operator=(const KernelCapabilityControl& other);
bool operator==(const KernelCapabilityBinary& other) const; bool operator==(const KernelCapabilityControl& other) const;
bool operator!=(const KernelCapabilityBinary& other) const; bool operator!=(const KernelCapabilityControl& other) const;
// IByteModel // IByteModel
void toBytes(); void toBytes();
@ -59,7 +59,7 @@ namespace hac
MiscFlagsHandler& getMiscFlags(); MiscFlagsHandler& getMiscFlags();
private: private:
const std::string kModuleName = "KC_BINARY"; const std::string kModuleName = "KERNEL_CAPABILITY_CONTROL";
// raw binary // raw binary
fnd::Vec<byte_t> mRawBinary; fnd::Vec<byte_t> mRawBinary;

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <nn/hac/kc.h> #include <nn/hac/define/kc.h>
namespace nn namespace nn
{ {

View file

@ -1,80 +0,0 @@
#pragma once
#include <string>
#include <fnd/List.h>
#include <fnd/IByteModel.h>
#include <nn/hac/meta.h>
#include <nn/hac/AccessControlInfo.h>
#include <nn/hac/AccessControlInfoDesc.h>
namespace nn
{
namespace hac
{
class MetaBinary :
public fnd::IByteModel
{
public:
MetaBinary();
MetaBinary(const MetaBinary& other);
void operator=(const MetaBinary& other);
bool operator==(const MetaBinary& other) const;
bool operator!=(const MetaBinary& other) const;
// IByteModel
void toBytes();
void fromBytes(const byte_t* bytes, size_t len);
const fnd::Vec<byte_t>& getBytes() const;
// variables
void clear();
meta::InstructionType getInstructionType() const;
void setInstructionType(meta::InstructionType type);
meta::ProcAddrSpaceType getProcAddressSpaceType() const;
void setProcAddressSpaceType(meta::ProcAddrSpaceType type);
byte_t getMainThreadPriority() const;
void setMainThreadPriority(byte_t priority);
byte_t getMainThreadCpuId() const;
void setMainThreadCpuId(byte_t cpu_id);
uint32_t getVersion() const;
void setVersion(uint32_t version);
uint32_t getMainThreadStackSize() const;
void setMainThreadStackSize(uint32_t size);
const std::string& getName() const;
void setName(const std::string& name);
const std::string& getProductCode() const;
void setProductCode(const std::string& product_code);
const AccessControlInfo& getAci() const;
void setAci(const AccessControlInfo& aci);
const AccessControlInfoDesc& getAcid() const;
void setAcid(const AccessControlInfoDesc& acid);
private:
const std::string kModuleName = "META_BINARY";
// raw binary
fnd::Vec<byte_t> mRawBinary;
// variables
meta::InstructionType mInstructionType;
meta::ProcAddrSpaceType mProcAddressSpaceType;
byte_t mMainThreadPriority;
byte_t mMainThreadCpuId;
uint32_t mVersion;
uint32_t mMainThreadStackSize;
std::string mName;
std::string mProductCode;
AccessControlInfo mAci;
AccessControlInfoDesc mAcid;
};
}
}

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/nca.h> #include <nn/hac/define/nca.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/nca.h> #include <nn/hac/define/nca.h>
namespace nn namespace nn
{ {

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <cstring> #include <cstring>
#include <nn/hac/nro.h> #include <nn/hac/define/nro.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <cstring> #include <cstring>
#include <nn/hac/nso.h> #include <nn/hac/define/nso.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>

View file

@ -2,7 +2,7 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
namespace nn namespace nn
{ {

View file

@ -3,7 +3,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <nn/hac/pfs.h> #include <nn/hac/define/pfs.h>
namespace nn namespace nn
{ {

View file

@ -9,16 +9,16 @@ namespace nn
{ {
namespace hac namespace hac
{ {
class ServiceAccessControlBinary : class ServiceAccessControl :
public fnd::IByteModel public fnd::IByteModel
{ {
public: public:
ServiceAccessControlBinary(); ServiceAccessControl();
ServiceAccessControlBinary(const ServiceAccessControlBinary& other); ServiceAccessControl(const ServiceAccessControl& other);
void operator=(const ServiceAccessControlBinary& other); void operator=(const ServiceAccessControl& other);
bool operator==(const ServiceAccessControlBinary& other) const; bool operator==(const ServiceAccessControl& other) const;
bool operator!=(const ServiceAccessControlBinary& other) const; bool operator!=(const ServiceAccessControl& other) const;
// IByteModel // IByteModel
void toBytes(); void toBytes();
@ -30,7 +30,7 @@ namespace hac
const fnd::List<ServiceAccessControlEntry>& getServiceList() const; const fnd::List<ServiceAccessControlEntry>& getServiceList() const;
void addService(const ServiceAccessControlEntry& service); void addService(const ServiceAccessControlEntry& service);
private: private:
const std::string kModuleName = "SERVICE_ACCESS_CONTROL_BINARY"; const std::string kModuleName = "SERVICE_ACCESS_CONTROL";
// raw binary // raw binary
fnd::Vec<byte_t> mRawBinary; fnd::Vec<byte_t> mRawBinary;

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/xci.h> #include <nn/hac/define/xci.h>
#include <fnd/IByteModel.h> #include <fnd/IByteModel.h>
#include <fnd/List.h> #include <fnd/List.h>

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <nn/hac/xci.h> #include <nn/hac/define/xci.h>
namespace nn namespace nn
{ {

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -0,0 +1,58 @@
#pragma once
#include <fnd/types.h>
#include <nn/hac/define/macro.h>
namespace nn
{
namespace hac
{
namespace meta
{
static const uint32_t kMetaStructMagic = _MAKE_STRUCT_MAGIC_U32("META");
static const size_t kNameMaxLen = 0x10;
static const size_t kProductCodeMaxLen = 0x10;
static const uint32_t kMaxPriority = BIT(6) - 1;
static const size_t kSectionAlignSize = 0x10;
static const uint32_t kDefaultMainThreadStackSize = 4096;
enum InstructionType
{
INSTR_32BIT,
INSTR_64BIT,
};
enum ProcAddrSpaceType
{
ADDR_SPACE_64BIT = 1,
ADDR_SPACE_32BIT,
ADDR_SPACE_32BIT_NO_RESERVED,
};
}
#pragma pack(push,1)
struct sMetaSection
{
le_uint32_t offset;
le_uint32_t size;
};
struct sMetaHeader
{
le_uint32_t st_magic;
byte_t reserved_0[8];
byte_t flags;
byte_t reserved_1;
byte_t main_thread_priority;
byte_t main_thread_cpu_id;
byte_t reserved_2[8];
le_uint32_t version;
le_uint32_t main_thread_stack_size;
char name[meta::kNameMaxLen]; // important
char product_code[meta::kProductCodeMaxLen]; // can be empty
byte_t reserved_3[48];
sMetaSection aci;
sMetaSection acid;
};
#pragma pack(pop)
}
}

View file

@ -3,7 +3,7 @@
#include <fnd/aes.h> #include <fnd/aes.h>
#include <fnd/sha.h> #include <fnd/sha.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/sha.h> #include <fnd/sha.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/sha.h> #include <fnd/sha.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -4,7 +4,7 @@
#include <fnd/aes.h> #include <fnd/aes.h>
#include <fnd/sha.h> #include <fnd/sha.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <nn/hac/macro.h> #include <nn/hac/define/macro.h>
namespace nn namespace nn
{ {

View file

@ -1,58 +1,80 @@
#pragma once #pragma once
#include <fnd/types.h> #include <string>
#include <nn/hac/macro.h> #include <fnd/List.h>
#include <fnd/IByteModel.h>
#include <nn/hac/define/meta.h>
#include <nn/hac/AccessControlInfo.h>
#include <nn/hac/AccessControlInfoDesc.h>
namespace nn namespace nn
{ {
namespace hac namespace hac
{ {
namespace meta class Meta :
public fnd::IByteModel
{ {
static const uint32_t kMetaStructMagic = _MAKE_STRUCT_MAGIC_U32("META"); public:
static const size_t kNameMaxLen = 0x10; Meta();
static const size_t kProductCodeMaxLen = 0x10; Meta(const Meta& other);
static const uint32_t kMaxPriority = BIT(6) - 1;
static const size_t kSectionAlignSize = 0x10;
static const uint32_t kDefaultMainThreadStackSize = 4096;
enum InstructionType void operator=(const Meta& other);
{ bool operator==(const Meta& other) const;
INSTR_32BIT, bool operator!=(const Meta& other) const;
INSTR_64BIT,
};
enum ProcAddrSpaceType // IByteModel
{ void toBytes();
ADDR_SPACE_64BIT = 1, void fromBytes(const byte_t* bytes, size_t len);
ADDR_SPACE_32BIT, const fnd::Vec<byte_t>& getBytes() const;
ADDR_SPACE_32BIT_NO_RESERVED,
// variables
void clear();
meta::InstructionType getInstructionType() const;
void setInstructionType(meta::InstructionType type);
meta::ProcAddrSpaceType getProcAddressSpaceType() const;
void setProcAddressSpaceType(meta::ProcAddrSpaceType type);
byte_t getMainThreadPriority() const;
void setMainThreadPriority(byte_t priority);
byte_t getMainThreadCpuId() const;
void setMainThreadCpuId(byte_t cpu_id);
uint32_t getVersion() const;
void setVersion(uint32_t version);
uint32_t getMainThreadStackSize() const;
void setMainThreadStackSize(uint32_t size);
const std::string& getName() const;
void setName(const std::string& name);
const std::string& getProductCode() const;
void setProductCode(const std::string& product_code);
const AccessControlInfo& getAci() const;
void setAci(const AccessControlInfo& aci);
const AccessControlInfoDesc& getAcid() const;
void setAcid(const AccessControlInfoDesc& acid);
private:
const std::string kModuleName = "META";
// raw binary
fnd::Vec<byte_t> mRawBinary;
// variables
meta::InstructionType mInstructionType;
meta::ProcAddrSpaceType mProcAddressSpaceType;
byte_t mMainThreadPriority;
byte_t mMainThreadCpuId;
uint32_t mVersion;
uint32_t mMainThreadStackSize;
std::string mName;
std::string mProductCode;
AccessControlInfo mAci;
AccessControlInfoDesc mAcid;
}; };
} }
#pragma pack(push,1)
struct sMetaSection
{
le_uint32_t offset;
le_uint32_t size;
};
struct sMetaHeader
{
le_uint32_t st_magic;
byte_t reserved_0[8];
byte_t flags;
byte_t reserved_1;
byte_t main_thread_priority;
byte_t main_thread_cpu_id;
byte_t reserved_2[8];
le_uint32_t version;
le_uint32_t main_thread_stack_size;
char name[meta::kNameMaxLen]; // important
char product_code[meta::kProductCodeMaxLen]; // can be empty
byte_t reserved_3[48];
sMetaSection aci;
sMetaSection acid;
};
#pragma pack(pop)
}
} }

View file

@ -37,7 +37,7 @@
<ClInclude Include="include\nn\hac\delta.h" /> <ClInclude Include="include\nn\hac\delta.h" />
<ClInclude Include="include\nn\hac\DeltaMetaExtendedHeader.h" /> <ClInclude Include="include\nn\hac\DeltaMetaExtendedHeader.h" />
<ClInclude Include="include\nn\hac\fac.h" /> <ClInclude Include="include\nn\hac\fac.h" />
<ClInclude Include="include\nn\hac\FileSystemAccessControlBinary.h" /> <ClInclude Include="include\nn\hac\FileSystemAccessControl.h" />
<ClInclude Include="include\nn\hac\HandleTableSizeEntry.h" /> <ClInclude Include="include\nn\hac\HandleTableSizeEntry.h" />
<ClInclude Include="include\nn\hac\HandleTableSizeHandler.h" /> <ClInclude Include="include\nn\hac\HandleTableSizeHandler.h" />
<ClInclude Include="include\nn\hac\hierarchicalintegrity.h" /> <ClInclude Include="include\nn\hac\hierarchicalintegrity.h" />
@ -49,7 +49,7 @@
<ClInclude Include="include\nn\hac\InteruptEntry.h" /> <ClInclude Include="include\nn\hac\InteruptEntry.h" />
<ClInclude Include="include\nn\hac\InteruptHandler.h" /> <ClInclude Include="include\nn\hac\InteruptHandler.h" />
<ClInclude Include="include\nn\hac\kc.h" /> <ClInclude Include="include\nn\hac\kc.h" />
<ClInclude Include="include\nn\hac\KernelCapabilityBinary.h" /> <ClInclude Include="include\nn\hac\KernelCapabilityControl.h" />
<ClInclude Include="include\nn\hac\KernelCapabilityEntry.h" /> <ClInclude Include="include\nn\hac\KernelCapabilityEntry.h" />
<ClInclude Include="include\nn\hac\KernelVersionEntry.h" /> <ClInclude Include="include\nn\hac\KernelVersionEntry.h" />
<ClInclude Include="include\nn\hac\KernelVersionHandler.h" /> <ClInclude Include="include\nn\hac\KernelVersionHandler.h" />
@ -57,7 +57,7 @@
<ClInclude Include="include\nn\hac\MemoryMappingHandler.h" /> <ClInclude Include="include\nn\hac\MemoryMappingHandler.h" />
<ClInclude Include="include\nn\hac\MemoryPageEntry.h" /> <ClInclude Include="include\nn\hac\MemoryPageEntry.h" />
<ClInclude Include="include\nn\hac\meta.h" /> <ClInclude Include="include\nn\hac\meta.h" />
<ClInclude Include="include\nn\hac\MetaBinary.h" /> <ClInclude Include="include\nn\hac\Meta.h" />
<ClInclude Include="include\nn\hac\MiscFlagsEntry.h" /> <ClInclude Include="include\nn\hac\MiscFlagsEntry.h" />
<ClInclude Include="include\nn\hac\MiscFlagsHandler.h" /> <ClInclude Include="include\nn\hac\MiscFlagsHandler.h" />
<ClInclude Include="include\nn\hac\MiscParamsEntry.h" /> <ClInclude Include="include\nn\hac\MiscParamsEntry.h" />
@ -76,7 +76,7 @@
<ClInclude Include="include\nn\hac\PfsHeader.h" /> <ClInclude Include="include\nn\hac\PfsHeader.h" />
<ClInclude Include="include\nn\hac\Result.h" /> <ClInclude Include="include\nn\hac\Result.h" />
<ClInclude Include="include\nn\hac\romfs.h" /> <ClInclude Include="include\nn\hac\romfs.h" />
<ClInclude Include="include\nn\hac\ServiceAccessControlBinary.h" /> <ClInclude Include="include\nn\hac\ServiceAccessControl.h" />
<ClInclude Include="include\nn\hac\ServiceAccessControlEntry.h" /> <ClInclude Include="include\nn\hac\ServiceAccessControlEntry.h" />
<ClInclude Include="include\nn\hac\SystemCallEntry.h" /> <ClInclude Include="include\nn\hac\SystemCallEntry.h" />
<ClInclude Include="include\nn\hac\SystemCallHandler.h" /> <ClInclude Include="include\nn\hac\SystemCallHandler.h" />
@ -98,7 +98,7 @@
<ClCompile Include="source\ContentMeta.cpp" /> <ClCompile Include="source\ContentMeta.cpp" />
<ClCompile Include="source\ContentMetaInfo.cpp" /> <ClCompile Include="source\ContentMetaInfo.cpp" />
<ClCompile Include="source\DeltaMetaExtendedHeader.cpp" /> <ClCompile Include="source\DeltaMetaExtendedHeader.cpp" />
<ClCompile Include="source\FileSystemAccessControlBinary.cpp" /> <ClCompile Include="source\FileSystemAccessControl.cpp" />
<ClCompile Include="source\HandleTableSizeEntry.cpp" /> <ClCompile Include="source\HandleTableSizeEntry.cpp" />
<ClCompile Include="source\HandleTableSizeHandler.cpp" /> <ClCompile Include="source\HandleTableSizeHandler.cpp" />
<ClCompile Include="source\HierarchicalIntegrityHeader.cpp" /> <ClCompile Include="source\HierarchicalIntegrityHeader.cpp" />
@ -106,13 +106,13 @@
<ClCompile Include="source\IdConverter.cpp" /> <ClCompile Include="source\IdConverter.cpp" />
<ClCompile Include="source\InteruptEntry.cpp" /> <ClCompile Include="source\InteruptEntry.cpp" />
<ClCompile Include="source\InteruptHandler.cpp" /> <ClCompile Include="source\InteruptHandler.cpp" />
<ClCompile Include="source\KernelCapabilityBinary.cpp" /> <ClCompile Include="source\KernelCapabilityControl.cpp" />
<ClCompile Include="source\KernelCapabilityEntry.cpp" /> <ClCompile Include="source\KernelCapabilityEntry.cpp" />
<ClCompile Include="source\KernelVersionEntry.cpp" /> <ClCompile Include="source\KernelVersionEntry.cpp" />
<ClCompile Include="source\KernelVersionHandler.cpp" /> <ClCompile Include="source\KernelVersionHandler.cpp" />
<ClCompile Include="source\MemoryMappingHandler.cpp" /> <ClCompile Include="source\MemoryMappingHandler.cpp" />
<ClCompile Include="source\MemoryPageEntry.cpp" /> <ClCompile Include="source\MemoryPageEntry.cpp" />
<ClCompile Include="source\MetaBinary.cpp" /> <ClCompile Include="source\Meta.cpp" />
<ClCompile Include="source\MiscFlagsEntry.cpp" /> <ClCompile Include="source\MiscFlagsEntry.cpp" />
<ClCompile Include="source\MiscFlagsHandler.cpp" /> <ClCompile Include="source\MiscFlagsHandler.cpp" />
<ClCompile Include="source\MiscParamsEntry.cpp" /> <ClCompile Include="source\MiscParamsEntry.cpp" />
@ -124,7 +124,7 @@
<ClCompile Include="source\PatchMetaExtendedHeader.cpp" /> <ClCompile Include="source\PatchMetaExtendedHeader.cpp" />
<ClCompile Include="source\PfsHeader.cpp" /> <ClCompile Include="source\PfsHeader.cpp" />
<ClCompile Include="source\Result.cpp" /> <ClCompile Include="source\Result.cpp" />
<ClCompile Include="source\ServiceAccessControlBinary.cpp" /> <ClCompile Include="source\ServiceAccessControl.cpp" />
<ClCompile Include="source\ServiceAccessControlEntry.cpp" /> <ClCompile Include="source\ServiceAccessControlEntry.cpp" />
<ClCompile Include="source\SystemCallEntry.cpp" /> <ClCompile Include="source\SystemCallEntry.cpp" />
<ClCompile Include="source\SystemCallHandler.cpp" /> <ClCompile Include="source\SystemCallHandler.cpp" />

View file

@ -63,7 +63,7 @@
<ClInclude Include="include\nn\hac\fac.h"> <ClInclude Include="include\nn\hac\fac.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\FileSystemAccessControlBinary.h"> <ClInclude Include="include\nn\hac\FileSystemAccessControl.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\HandleTableSizeEntry.h"> <ClInclude Include="include\nn\hac\HandleTableSizeEntry.h">
@ -99,7 +99,7 @@
<ClInclude Include="include\nn\hac\kc.h"> <ClInclude Include="include\nn\hac\kc.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\KernelCapabilityBinary.h"> <ClInclude Include="include\nn\hac\KernelCapabilityControl.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\KernelCapabilityEntry.h"> <ClInclude Include="include\nn\hac\KernelCapabilityEntry.h">
@ -123,7 +123,7 @@
<ClInclude Include="include\nn\hac\meta.h"> <ClInclude Include="include\nn\hac\meta.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\MetaBinary.h"> <ClInclude Include="include\nn\hac\Meta.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\MiscFlagsEntry.h"> <ClInclude Include="include\nn\hac\MiscFlagsEntry.h">
@ -180,7 +180,7 @@
<ClInclude Include="include\nn\hac\romfs.h"> <ClInclude Include="include\nn\hac\romfs.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\ServiceAccessControlBinary.h"> <ClInclude Include="include\nn\hac\ServiceAccessControl.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\nn\hac\ServiceAccessControlEntry.h"> <ClInclude Include="include\nn\hac\ServiceAccessControlEntry.h">
@ -242,7 +242,7 @@
<ClCompile Include="source\DeltaMetaExtendedHeader.cpp"> <ClCompile Include="source\DeltaMetaExtendedHeader.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\FileSystemAccessControlBinary.cpp"> <ClCompile Include="source\FileSystemAccessControl.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\HandleTableSizeEntry.cpp"> <ClCompile Include="source\HandleTableSizeEntry.cpp">
@ -263,7 +263,7 @@
<ClCompile Include="source\InteruptHandler.cpp"> <ClCompile Include="source\InteruptHandler.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\KernelCapabilityBinary.cpp"> <ClCompile Include="source\KernelCapabilityControl.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\KernelCapabilityEntry.cpp"> <ClCompile Include="source\KernelCapabilityEntry.cpp">
@ -299,7 +299,7 @@
<ClCompile Include="source\NcaUtils.cpp"> <ClCompile Include="source\NcaUtils.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\MetaBinary.cpp"> <ClCompile Include="source\Meta.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\NroHeader.cpp"> <ClCompile Include="source\NroHeader.cpp">
@ -314,7 +314,7 @@
<ClCompile Include="source\PfsHeader.cpp"> <ClCompile Include="source\PfsHeader.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\ServiceAccessControlBinary.cpp"> <ClCompile Include="source\ServiceAccessControl.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="source\ServiceAccessControlEntry.cpp"> <ClCompile Include="source\ServiceAccessControlEntry.cpp">

View file

@ -142,32 +142,32 @@ void nn::hac::AccessControlInfo::setProgramId(uint64_t program_id)
mProgramId = program_id; mProgramId = program_id;
} }
const nn::hac::FileSystemAccessControlBinary& nn::hac::AccessControlInfo::getFileSystemAccessControl() const const nn::hac::FileSystemAccessControl& nn::hac::AccessControlInfo::getFileSystemAccessControl() const
{ {
return mFileSystemAccessControl; return mFileSystemAccessControl;
} }
void nn::hac::AccessControlInfo::setFileSystemAccessControl(const nn::hac::FileSystemAccessControlBinary& fac) void nn::hac::AccessControlInfo::setFileSystemAccessControl(const nn::hac::FileSystemAccessControl& fac)
{ {
mFileSystemAccessControl = fac; mFileSystemAccessControl = fac;
} }
const nn::hac::ServiceAccessControlBinary& nn::hac::AccessControlInfo::getServiceAccessControl() const const nn::hac::ServiceAccessControl& nn::hac::AccessControlInfo::getServiceAccessControl() const
{ {
return mServiceAccessControl; return mServiceAccessControl;
} }
void nn::hac::AccessControlInfo::setServiceAccessControl(const nn::hac::ServiceAccessControlBinary& sac) void nn::hac::AccessControlInfo::setServiceAccessControl(const nn::hac::ServiceAccessControl& sac)
{ {
mServiceAccessControl = sac; mServiceAccessControl = sac;
} }
const nn::hac::KernelCapabilityBinary& nn::hac::AccessControlInfo::getKernelCapabilities() const const nn::hac::KernelCapabilityControl& nn::hac::AccessControlInfo::getKernelCapabilities() const
{ {
return mKernelCapabilities; return mKernelCapabilities;
} }
void nn::hac::AccessControlInfo::setKernelCapabilities(const nn::hac::KernelCapabilityBinary& kc) void nn::hac::AccessControlInfo::setKernelCapabilities(const nn::hac::KernelCapabilityControl& kc)
{ {
mKernelCapabilities = kc; mKernelCapabilities = kc;
} }

View file

@ -220,32 +220,32 @@ void nn::hac::AccessControlInfoDesc::setProgramIdRestrict(const sProgramIdRestri
mProgramIdRestrict = pid_restrict; mProgramIdRestrict = pid_restrict;
} }
const nn::hac::FileSystemAccessControlBinary& nn::hac::AccessControlInfoDesc::getFileSystemAccessControl() const const nn::hac::FileSystemAccessControl& nn::hac::AccessControlInfoDesc::getFileSystemAccessControl() const
{ {
return mFileSystemAccessControl; return mFileSystemAccessControl;
} }
void nn::hac::AccessControlInfoDesc::setFileSystemAccessControl(const nn::hac::FileSystemAccessControlBinary& fac) void nn::hac::AccessControlInfoDesc::setFileSystemAccessControl(const nn::hac::FileSystemAccessControl& fac)
{ {
mFileSystemAccessControl = fac; mFileSystemAccessControl = fac;
} }
const nn::hac::ServiceAccessControlBinary& nn::hac::AccessControlInfoDesc::getServiceAccessControl() const const nn::hac::ServiceAccessControl& nn::hac::AccessControlInfoDesc::getServiceAccessControl() const
{ {
return mServiceAccessControl; return mServiceAccessControl;
} }
void nn::hac::AccessControlInfoDesc::setServiceAccessControl(const nn::hac::ServiceAccessControlBinary& sac) void nn::hac::AccessControlInfoDesc::setServiceAccessControl(const nn::hac::ServiceAccessControl& sac)
{ {
mServiceAccessControl = sac; mServiceAccessControl = sac;
} }
const nn::hac::KernelCapabilityBinary& nn::hac::AccessControlInfoDesc::getKernelCapabilities() const const nn::hac::KernelCapabilityControl& nn::hac::AccessControlInfoDesc::getKernelCapabilities() const
{ {
return mKernelCapabilities; return mKernelCapabilities;
} }
void nn::hac::AccessControlInfoDesc::setKernelCapabilities(const nn::hac::KernelCapabilityBinary& kc) void nn::hac::AccessControlInfoDesc::setKernelCapabilities(const nn::hac::KernelCapabilityControl& kc)
{ {
mKernelCapabilities = kc; mKernelCapabilities = kc;
} }

View file

@ -1,17 +1,17 @@
#include <cstring> #include <cstring>
#include <nn/hac/FileSystemAccessControlBinary.h> #include <nn/hac/FileSystemAccessControl.h>
nn::hac::FileSystemAccessControlBinary::FileSystemAccessControlBinary() nn::hac::FileSystemAccessControl::FileSystemAccessControl()
{ {
clear(); clear();
} }
nn::hac::FileSystemAccessControlBinary::FileSystemAccessControlBinary(const FileSystemAccessControlBinary & other) nn::hac::FileSystemAccessControl::FileSystemAccessControl(const FileSystemAccessControl & other)
{ {
*this = other; *this = other;
} }
void nn::hac::FileSystemAccessControlBinary::operator=(const FileSystemAccessControlBinary & other) void nn::hac::FileSystemAccessControl::operator=(const FileSystemAccessControl & other)
{ {
mRawBinary = other.mRawBinary; mRawBinary = other.mRawBinary;
mVersion = other.mVersion; mVersion = other.mVersion;
@ -20,7 +20,7 @@ void nn::hac::FileSystemAccessControlBinary::operator=(const FileSystemAccessCon
mSaveDataOwnerIdList = other.mSaveDataOwnerIdList; mSaveDataOwnerIdList = other.mSaveDataOwnerIdList;
} }
bool nn::hac::FileSystemAccessControlBinary::operator==(const FileSystemAccessControlBinary & other) const bool nn::hac::FileSystemAccessControl::operator==(const FileSystemAccessControl & other) const
{ {
return (mVersion == other.mVersion) \ return (mVersion == other.mVersion) \
&& (mFsaRights == other.mFsaRights) \ && (mFsaRights == other.mFsaRights) \
@ -28,12 +28,12 @@ bool nn::hac::FileSystemAccessControlBinary::operator==(const FileSystemAccessCo
&& (mSaveDataOwnerIdList == other.mSaveDataOwnerIdList); && (mSaveDataOwnerIdList == other.mSaveDataOwnerIdList);
} }
bool nn::hac::FileSystemAccessControlBinary::operator!=(const FileSystemAccessControlBinary & other) const bool nn::hac::FileSystemAccessControl::operator!=(const FileSystemAccessControl & other) const
{ {
return !(*this == other); return !(*this == other);
} }
void nn::hac::FileSystemAccessControlBinary::toBytes() void nn::hac::FileSystemAccessControl::toBytes()
{ {
// determine section layout // determine section layout
struct sLayout { struct sLayout {
@ -98,7 +98,7 @@ void nn::hac::FileSystemAccessControlBinary::toBytes()
} }
} }
void nn::hac::FileSystemAccessControlBinary::fromBytes(const byte_t* data, size_t len) void nn::hac::FileSystemAccessControl::fromBytes(const byte_t* data, size_t len)
{ {
// check size // check size
if (len < sizeof(sFacHeader)) if (len < sizeof(sFacHeader))
@ -164,12 +164,12 @@ void nn::hac::FileSystemAccessControlBinary::fromBytes(const byte_t* data, size_
} }
} }
const fnd::Vec<byte_t>& nn::hac::FileSystemAccessControlBinary::getBytes() const const fnd::Vec<byte_t>& nn::hac::FileSystemAccessControl::getBytes() const
{ {
return mRawBinary; return mRawBinary;
} }
void nn::hac::FileSystemAccessControlBinary::clear() void nn::hac::FileSystemAccessControl::clear()
{ {
mRawBinary.clear(); mRawBinary.clear();
mVersion = 0; mVersion = 0;
@ -178,42 +178,42 @@ void nn::hac::FileSystemAccessControlBinary::clear()
mSaveDataOwnerIdList.clear(); mSaveDataOwnerIdList.clear();
} }
uint32_t nn::hac::FileSystemAccessControlBinary::getFormatVersion() const uint32_t nn::hac::FileSystemAccessControl::getFormatVersion() const
{ {
return mVersion; return mVersion;
} }
void nn::hac::FileSystemAccessControlBinary::setFormatVersion(uint32_t format_version) void nn::hac::FileSystemAccessControl::setFormatVersion(uint32_t format_version)
{ {
mVersion = format_version; mVersion = format_version;
} }
const fnd::List<nn::hac::fac::FsAccessFlag>& nn::hac::FileSystemAccessControlBinary::getFsaRightsList() const const fnd::List<nn::hac::fac::FsAccessFlag>& nn::hac::FileSystemAccessControl::getFsaRightsList() const
{ {
return mFsaRights; return mFsaRights;
} }
void nn::hac::FileSystemAccessControlBinary::setFsaRightsList(const fnd::List<fac::FsAccessFlag>& list) void nn::hac::FileSystemAccessControl::setFsaRightsList(const fnd::List<fac::FsAccessFlag>& list)
{ {
mFsaRights = list; mFsaRights = list;
} }
const fnd::List<uint64_t>& nn::hac::FileSystemAccessControlBinary::getContentOwnerIdList() const const fnd::List<uint64_t>& nn::hac::FileSystemAccessControl::getContentOwnerIdList() const
{ {
return mContentOwnerIdList; return mContentOwnerIdList;
} }
void nn::hac::FileSystemAccessControlBinary::setContentOwnerIdList(const fnd::List<uint64_t>& list) void nn::hac::FileSystemAccessControl::setContentOwnerIdList(const fnd::List<uint64_t>& list)
{ {
mContentOwnerIdList = list; mContentOwnerIdList = list;
} }
const fnd::List<nn::hac::FileSystemAccessControlBinary::sSaveDataOwnerId>& nn::hac::FileSystemAccessControlBinary::getSaveDataOwnerIdList() const const fnd::List<nn::hac::FileSystemAccessControl::sSaveDataOwnerId>& nn::hac::FileSystemAccessControl::getSaveDataOwnerIdList() const
{ {
return mSaveDataOwnerIdList; return mSaveDataOwnerIdList;
} }
void nn::hac::FileSystemAccessControlBinary::setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list) void nn::hac::FileSystemAccessControl::setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list)
{ {
mSaveDataOwnerIdList = list; mSaveDataOwnerIdList = list;
} }

View file

@ -1,14 +1,14 @@
#include <nn/hac/KernelCapabilityBinary.h> #include <nn/hac/KernelCapabilityControl.h>
nn::hac::KernelCapabilityBinary::KernelCapabilityBinary() nn::hac::KernelCapabilityControl::KernelCapabilityControl()
{} {}
nn::hac::KernelCapabilityBinary::KernelCapabilityBinary(const KernelCapabilityBinary & other) nn::hac::KernelCapabilityControl::KernelCapabilityControl(const KernelCapabilityControl & other)
{ {
*this = other; *this = other;
} }
void nn::hac::KernelCapabilityBinary::operator=(const KernelCapabilityBinary & other) void nn::hac::KernelCapabilityControl::operator=(const KernelCapabilityControl & other)
{ {
clear(); clear();
mRawBinary = other.mRawBinary; mRawBinary = other.mRawBinary;
@ -22,7 +22,7 @@ void nn::hac::KernelCapabilityBinary::operator=(const KernelCapabilityBinary & o
mMiscFlags = other.mMiscFlags; mMiscFlags = other.mMiscFlags;
} }
bool nn::hac::KernelCapabilityBinary::operator==(const KernelCapabilityBinary & other) const bool nn::hac::KernelCapabilityControl::operator==(const KernelCapabilityControl & other) const
{ {
return (mThreadInfo == other.mThreadInfo) \ return (mThreadInfo == other.mThreadInfo) \
&& (mSystemCalls == other.mSystemCalls) \ && (mSystemCalls == other.mSystemCalls) \
@ -34,12 +34,12 @@ bool nn::hac::KernelCapabilityBinary::operator==(const KernelCapabilityBinary &
&& (mMiscFlags == other.mMiscFlags); && (mMiscFlags == other.mMiscFlags);
} }
bool nn::hac::KernelCapabilityBinary::operator!=(const KernelCapabilityBinary & other) const bool nn::hac::KernelCapabilityControl::operator!=(const KernelCapabilityControl & other) const
{ {
return !(*this == other); return !(*this == other);
} }
void nn::hac::KernelCapabilityBinary::toBytes() void nn::hac::KernelCapabilityControl::toBytes()
{ {
fnd::List<KernelCapabilityEntry> caps; fnd::List<KernelCapabilityEntry> caps;
@ -64,14 +64,14 @@ void nn::hac::KernelCapabilityBinary::toBytes()
} }
} }
void nn::hac::KernelCapabilityBinary::fromBytes(const byte_t * data, size_t len) void nn::hac::KernelCapabilityControl::fromBytes(const byte_t * data, size_t len)
{ {
if ((len % sizeof(uint32_t)) != 0) if ((len % sizeof(uint32_t)) != 0)
{ {
throw fnd::Exception(kModuleName, "KernelCapabilityEntry list must be aligned to 4 bytes"); throw fnd::Exception(kModuleName, "KernelCapabilityEntry list must be aligned to 4 bytes");
} }
// save copy of KernelCapabilityBinary // save copy of KernelCapabilityControl
mRawBinary.alloc(len); mRawBinary.alloc(len);
memcpy(mRawBinary.data(), data, len); memcpy(mRawBinary.data(), data, len);
@ -132,12 +132,12 @@ void nn::hac::KernelCapabilityBinary::fromBytes(const byte_t * data, size_t len)
mMiscFlags.importKernelCapabilityList(miscFlagsCaps); mMiscFlags.importKernelCapabilityList(miscFlagsCaps);
} }
const fnd::Vec<byte_t>& nn::hac::KernelCapabilityBinary::getBytes() const const fnd::Vec<byte_t>& nn::hac::KernelCapabilityControl::getBytes() const
{ {
return mRawBinary; return mRawBinary;
} }
void nn::hac::KernelCapabilityBinary::clear() void nn::hac::KernelCapabilityControl::clear()
{ {
mRawBinary.clear(); mRawBinary.clear();
mThreadInfo.clear(); mThreadInfo.clear();
@ -150,82 +150,82 @@ void nn::hac::KernelCapabilityBinary::clear()
mMiscFlags.clear(); mMiscFlags.clear();
} }
const nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityBinary::getThreadInfo() const const nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityControl::getThreadInfo() const
{ {
return mThreadInfo; return mThreadInfo;
} }
nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityBinary::getThreadInfo() nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityControl::getThreadInfo()
{ {
return mThreadInfo; return mThreadInfo;
} }
const nn::hac::SystemCallHandler & nn::hac::KernelCapabilityBinary::getSystemCalls() const const nn::hac::SystemCallHandler & nn::hac::KernelCapabilityControl::getSystemCalls() const
{ {
return mSystemCalls; return mSystemCalls;
} }
nn::hac::SystemCallHandler & nn::hac::KernelCapabilityBinary::getSystemCalls() nn::hac::SystemCallHandler & nn::hac::KernelCapabilityControl::getSystemCalls()
{ {
return mSystemCalls; return mSystemCalls;
} }
const nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityBinary::getMemoryMaps() const const nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityControl::getMemoryMaps() const
{ {
return mMemoryMap; return mMemoryMap;
} }
nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityBinary::getMemoryMaps() nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityControl::getMemoryMaps()
{ {
return mMemoryMap; return mMemoryMap;
} }
const nn::hac::InteruptHandler & nn::hac::KernelCapabilityBinary::getInterupts() const const nn::hac::InteruptHandler & nn::hac::KernelCapabilityControl::getInterupts() const
{ {
return mInterupts; return mInterupts;
} }
nn::hac::InteruptHandler & nn::hac::KernelCapabilityBinary::getInterupts() nn::hac::InteruptHandler & nn::hac::KernelCapabilityControl::getInterupts()
{ {
return mInterupts; return mInterupts;
} }
const nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityBinary::getMiscParams() const const nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityControl::getMiscParams() const
{ {
return mMiscParams; return mMiscParams;
} }
nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityBinary::getMiscParams() nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityControl::getMiscParams()
{ {
return mMiscParams; return mMiscParams;
} }
const nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityBinary::getKernelVersion() const const nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityControl::getKernelVersion() const
{ {
return mKernelVersion; return mKernelVersion;
} }
nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityBinary::getKernelVersion() nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityControl::getKernelVersion()
{ {
return mKernelVersion; return mKernelVersion;
} }
const nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityBinary::getHandleTableSize() const const nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityControl::getHandleTableSize() const
{ {
return mHandleTableSize; return mHandleTableSize;
} }
nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityBinary::getHandleTableSize() nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityControl::getHandleTableSize()
{ {
return mHandleTableSize; return mHandleTableSize;
} }
const nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityBinary::getMiscFlags() const const nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityControl::getMiscFlags() const
{ {
return mMiscFlags; return mMiscFlags;
} }
nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityBinary::getMiscFlags() nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityControl::getMiscFlags()
{ {
return mMiscFlags; return mMiscFlags;
} }

View file

@ -1,19 +1,19 @@
#include <nn/hac/MetaBinary.h> #include <nn/hac/Meta.h>
#include <fnd/SimpleTextOutput.h> #include <fnd/SimpleTextOutput.h>
nn::hac::MetaBinary::MetaBinary() nn::hac::Meta::Meta()
{ {
clear(); clear();
} }
nn::hac::MetaBinary::MetaBinary(const MetaBinary & other) : nn::hac::Meta::Meta(const Meta & other) :
MetaBinary() Meta()
{ {
*this = other; *this = other;
} }
void nn::hac::MetaBinary::operator=(const MetaBinary & other) void nn::hac::Meta::operator=(const Meta & other)
{ {
mRawBinary = other.mRawBinary; mRawBinary = other.mRawBinary;
mInstructionType = other.mInstructionType; mInstructionType = other.mInstructionType;
@ -28,7 +28,7 @@ void nn::hac::MetaBinary::operator=(const MetaBinary & other)
mAcid = other.mAcid; mAcid = other.mAcid;
} }
bool nn::hac::MetaBinary::operator==(const MetaBinary & other) const bool nn::hac::Meta::operator==(const Meta & other) const
{ {
return (mInstructionType == other.mInstructionType) \ return (mInstructionType == other.mInstructionType) \
&& (mProcAddressSpaceType == other.mProcAddressSpaceType) \ && (mProcAddressSpaceType == other.mProcAddressSpaceType) \
@ -42,12 +42,12 @@ bool nn::hac::MetaBinary::operator==(const MetaBinary & other) const
&& (mAcid == other.mAcid); && (mAcid == other.mAcid);
} }
bool nn::hac::MetaBinary::operator!=(const MetaBinary & other) const bool nn::hac::Meta::operator!=(const Meta & other) const
{ {
return !(*this == other); return !(*this == other);
} }
void nn::hac::MetaBinary::toBytes() void nn::hac::Meta::toBytes()
{ {
if (mAcid.getBytes().size() == 0) if (mAcid.getBytes().size() == 0)
mAcid.toBytes(); mAcid.toBytes();
@ -103,7 +103,7 @@ void nn::hac::MetaBinary::toBytes()
} }
} }
void nn::hac::MetaBinary::fromBytes(const byte_t* data, size_t len) void nn::hac::Meta::fromBytes(const byte_t* data, size_t len)
{ {
// check size // check size
if (len < sizeof(sMetaHeader)) if (len < sizeof(sMetaHeader))
@ -159,12 +159,12 @@ void nn::hac::MetaBinary::fromBytes(const byte_t* data, size_t len)
} }
} }
const fnd::Vec<byte_t>& nn::hac::MetaBinary::getBytes() const const fnd::Vec<byte_t>& nn::hac::Meta::getBytes() const
{ {
return mRawBinary; return mRawBinary;
} }
void nn::hac::MetaBinary::clear() void nn::hac::Meta::clear()
{ {
mRawBinary.clear(); mRawBinary.clear();
mInstructionType = meta::INSTR_64BIT; mInstructionType = meta::INSTR_64BIT;
@ -179,32 +179,32 @@ void nn::hac::MetaBinary::clear()
mAcid.clear(); mAcid.clear();
} }
nn::hac::meta::InstructionType nn::hac::MetaBinary::getInstructionType() const nn::hac::meta::InstructionType nn::hac::Meta::getInstructionType() const
{ {
return mInstructionType; return mInstructionType;
} }
void nn::hac::MetaBinary::setInstructionType(meta::InstructionType type) void nn::hac::Meta::setInstructionType(meta::InstructionType type)
{ {
mInstructionType = type; mInstructionType = type;
} }
nn::hac::meta::ProcAddrSpaceType nn::hac::MetaBinary::getProcAddressSpaceType() const nn::hac::meta::ProcAddrSpaceType nn::hac::Meta::getProcAddressSpaceType() const
{ {
return mProcAddressSpaceType; return mProcAddressSpaceType;
} }
void nn::hac::MetaBinary::setProcAddressSpaceType(meta::ProcAddrSpaceType type) void nn::hac::Meta::setProcAddressSpaceType(meta::ProcAddrSpaceType type)
{ {
mProcAddressSpaceType = type; mProcAddressSpaceType = type;
} }
byte_t nn::hac::MetaBinary::getMainThreadPriority() const byte_t nn::hac::Meta::getMainThreadPriority() const
{ {
return mMainThreadPriority; return mMainThreadPriority;
} }
void nn::hac::MetaBinary::setMainThreadPriority(byte_t priority) void nn::hac::Meta::setMainThreadPriority(byte_t priority)
{ {
if (priority > meta::kMaxPriority) if (priority > meta::kMaxPriority)
{ {
@ -214,42 +214,42 @@ void nn::hac::MetaBinary::setMainThreadPriority(byte_t priority)
mMainThreadPriority = priority; mMainThreadPriority = priority;
} }
byte_t nn::hac::MetaBinary::getMainThreadCpuId() const byte_t nn::hac::Meta::getMainThreadCpuId() const
{ {
return mMainThreadCpuId; return mMainThreadCpuId;
} }
void nn::hac::MetaBinary::setMainThreadCpuId(byte_t core_num) void nn::hac::Meta::setMainThreadCpuId(byte_t core_num)
{ {
mMainThreadCpuId = core_num; mMainThreadCpuId = core_num;
} }
uint32_t nn::hac::MetaBinary::getVersion() const uint32_t nn::hac::Meta::getVersion() const
{ {
return mVersion; return mVersion;
} }
void nn::hac::MetaBinary::setVersion(uint32_t version) void nn::hac::Meta::setVersion(uint32_t version)
{ {
mVersion = version; mVersion = version;
} }
uint32_t nn::hac::MetaBinary::getMainThreadStackSize() const uint32_t nn::hac::Meta::getMainThreadStackSize() const
{ {
return mMainThreadStackSize; return mMainThreadStackSize;
} }
void nn::hac::MetaBinary::setMainThreadStackSize(uint32_t size) void nn::hac::Meta::setMainThreadStackSize(uint32_t size)
{ {
mMainThreadStackSize = size; mMainThreadStackSize = size;
} }
const std::string & nn::hac::MetaBinary::getName() const const std::string & nn::hac::Meta::getName() const
{ {
return mName; return mName;
} }
void nn::hac::MetaBinary::setName(const std::string & name) void nn::hac::Meta::setName(const std::string & name)
{ {
if (name.length() > meta::kNameMaxLen) if (name.length() > meta::kNameMaxLen)
{ {
@ -259,12 +259,12 @@ void nn::hac::MetaBinary::setName(const std::string & name)
mName = name; mName = name;
} }
const std::string & nn::hac::MetaBinary::getProductCode() const const std::string & nn::hac::Meta::getProductCode() const
{ {
return mProductCode; return mProductCode;
} }
void nn::hac::MetaBinary::setProductCode(const std::string & product_code) void nn::hac::Meta::setProductCode(const std::string & product_code)
{ {
if (product_code.length() > meta::kProductCodeMaxLen) if (product_code.length() > meta::kProductCodeMaxLen)
{ {
@ -274,22 +274,22 @@ void nn::hac::MetaBinary::setProductCode(const std::string & product_code)
mProductCode = product_code; mProductCode = product_code;
} }
const nn::hac::AccessControlInfo & nn::hac::MetaBinary::getAci() const const nn::hac::AccessControlInfo & nn::hac::Meta::getAci() const
{ {
return mAci; return mAci;
} }
void nn::hac::MetaBinary::setAci(const AccessControlInfo & aci) void nn::hac::Meta::setAci(const AccessControlInfo & aci)
{ {
mAci = aci; mAci = aci;
} }
const nn::hac::AccessControlInfoDesc & nn::hac::MetaBinary::getAcid() const const nn::hac::AccessControlInfoDesc & nn::hac::Meta::getAcid() const
{ {
return mAcid; return mAcid;
} }
void nn::hac::MetaBinary::setAcid(const AccessControlInfoDesc & acid) void nn::hac::Meta::setAcid(const AccessControlInfoDesc & acid)
{ {
mAcid = acid; mAcid = acid;
} }

View file

@ -1,33 +1,33 @@
#include <cstring> #include <cstring>
#include <nn/hac/ServiceAccessControlBinary.h> #include <nn/hac/ServiceAccessControl.h>
nn::hac::ServiceAccessControlBinary::ServiceAccessControlBinary() nn::hac::ServiceAccessControl::ServiceAccessControl()
{ {
clear(); clear();
} }
nn::hac::ServiceAccessControlBinary::ServiceAccessControlBinary(const ServiceAccessControlBinary & other) nn::hac::ServiceAccessControl::ServiceAccessControl(const ServiceAccessControl & other)
{ {
*this = other; *this = other;
} }
void nn::hac::ServiceAccessControlBinary::operator=(const ServiceAccessControlBinary & other) void nn::hac::ServiceAccessControl::operator=(const ServiceAccessControl & other)
{ {
mRawBinary = other.mRawBinary; mRawBinary = other.mRawBinary;
mServices = other.mServices; mServices = other.mServices;
} }
bool nn::hac::ServiceAccessControlBinary::operator==(const ServiceAccessControlBinary & other) const bool nn::hac::ServiceAccessControl::operator==(const ServiceAccessControl & other) const
{ {
return (mServices == other.mServices); return (mServices == other.mServices);
} }
bool nn::hac::ServiceAccessControlBinary::operator!=(const ServiceAccessControlBinary & other) const bool nn::hac::ServiceAccessControl::operator!=(const ServiceAccessControl & other) const
{ {
return !(*this == other); return !(*this == other);
} }
void nn::hac::ServiceAccessControlBinary::toBytes() void nn::hac::ServiceAccessControl::toBytes()
{ {
size_t totalSize = 0; size_t totalSize = 0;
for (size_t i = 0; i < mServices.size(); i++) for (size_t i = 0; i < mServices.size(); i++)
@ -43,7 +43,7 @@ void nn::hac::ServiceAccessControlBinary::toBytes()
} }
} }
void nn::hac::ServiceAccessControlBinary::fromBytes(const byte_t* data, size_t len) void nn::hac::ServiceAccessControl::fromBytes(const byte_t* data, size_t len)
{ {
clear(); clear();
mRawBinary.alloc(len); mRawBinary.alloc(len);
@ -57,23 +57,23 @@ void nn::hac::ServiceAccessControlBinary::fromBytes(const byte_t* data, size_t l
} }
} }
const fnd::Vec<byte_t>& nn::hac::ServiceAccessControlBinary::getBytes() const const fnd::Vec<byte_t>& nn::hac::ServiceAccessControl::getBytes() const
{ {
return mRawBinary; return mRawBinary;
} }
void nn::hac::ServiceAccessControlBinary::clear() void nn::hac::ServiceAccessControl::clear()
{ {
mRawBinary.clear(); mRawBinary.clear();
mServices.clear(); mServices.clear();
} }
const fnd::List<nn::hac::ServiceAccessControlEntry>& nn::hac::ServiceAccessControlBinary::getServiceList() const const fnd::List<nn::hac::ServiceAccessControlEntry>& nn::hac::ServiceAccessControl::getServiceList() const
{ {
return mServices; return mServices;
} }
void nn::hac::ServiceAccessControlBinary::addService(const ServiceAccessControlEntry& service) void nn::hac::ServiceAccessControl::addService(const ServiceAccessControlEntry& service)
{ {
mServices.addElement(service); mServices.addElement(service);
} }

View file

@ -5,7 +5,7 @@
#include <fnd/aes.h> #include <fnd/aes.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <fnd/ecdsa.h> #include <fnd/ecdsa.h>
#include <nn/hac/nca.h> #include <nn/hac/define/nca.h>
#include <nn/pki/SignedData.h> #include <nn/pki/SignedData.h>
#include <nn/es/TicketBody_V2.h> #include <nn/es/TicketBody_V2.h>

View file

@ -61,7 +61,7 @@ void MetaProcess::setVerifyMode(bool verify)
mVerify = verify; mVerify = verify;
} }
const nn::hac::MetaBinary& MetaProcess::getMetaBinary() const const nn::hac::Meta& MetaProcess::getMeta() const
{ {
return mMeta; return mMeta;
} }
@ -287,7 +287,7 @@ void MetaProcess::validateAciFromAcid(const nn::hac::AccessControlInfo& aci, con
} }
} }
void MetaProcess::displayMetaHeader(const nn::hac::MetaBinary& hdr) void MetaProcess::displayMetaHeader(const nn::hac::Meta& hdr)
{ {
std::cout << "[Meta Header]" << std::endl; std::cout << "[Meta Header]" << std::endl;
std::cout << " Process Architecture Params:" << std::endl; std::cout << " Process Architecture Params:" << std::endl;
@ -328,7 +328,7 @@ void MetaProcess::displayAciDescHdr(const nn::hac::AccessControlInfoDesc& acid)
std::cout << " Max: 0x" << std::hex << std::setw(16) << std::setfill('0') << acid.getProgramIdRestrict().max << std::endl; std::cout << " Max: 0x" << std::hex << std::setw(16) << std::setfill('0') << acid.getProgramIdRestrict().max << std::endl;
} }
void MetaProcess::displayFac(const nn::hac::FileSystemAccessControlBinary& fac) void MetaProcess::displayFac(const nn::hac::FileSystemAccessControl& fac)
{ {
std::cout << "[FS Access Control]" << std::endl; std::cout << "[FS Access Control]" << std::endl;
std::cout << " Format Version: " << std::dec << (uint32_t)fac.getFormatVersion() << std::endl; std::cout << " Format Version: " << std::dec << (uint32_t)fac.getFormatVersion() << std::endl;
@ -373,7 +373,7 @@ void MetaProcess::displayFac(const nn::hac::FileSystemAccessControlBinary& fac)
} }
void MetaProcess::displaySac(const nn::hac::ServiceAccessControlBinary& sac) void MetaProcess::displaySac(const nn::hac::ServiceAccessControl& sac)
{ {
std::cout << "[Service Access Control]" << std::endl; std::cout << "[Service Access Control]" << std::endl;
std::cout << " Service List:" << std::endl; std::cout << " Service List:" << std::endl;
@ -394,7 +394,7 @@ void MetaProcess::displaySac(const nn::hac::ServiceAccessControlBinary& sac)
std::cout << std::endl; std::cout << std::endl;
} }
void MetaProcess::displayKernelCap(const nn::hac::KernelCapabilityBinary& kern) void MetaProcess::displayKernelCap(const nn::hac::KernelCapabilityControl& kern)
{ {
std::cout << "[Kernel Capabilities]" << std::endl; std::cout << "[Kernel Capabilities]" << std::endl;
if (kern.getThreadInfo().isSet()) if (kern.getThreadInfo().isSet())

View file

@ -3,7 +3,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IFile.h> #include <fnd/IFile.h>
#include <fnd/SharedPtr.h> #include <fnd/SharedPtr.h>
#include <nn/hac/MetaBinary.h> #include <nn/hac/Meta.h>
#include "KeyConfiguration.h" #include "KeyConfiguration.h"
#include "common.h" #include "common.h"
@ -20,7 +20,7 @@ public:
void setCliOutputMode(CliOutputMode type); void setCliOutputMode(CliOutputMode type);
void setVerifyMode(bool verify); void setVerifyMode(bool verify);
const nn::hac::MetaBinary& getMetaBinary() const; const nn::hac::Meta& getMeta() const;
private: private:
const std::string kModuleName = "MetaProcess"; const std::string kModuleName = "MetaProcess";
@ -30,19 +30,19 @@ private:
CliOutputMode mCliOutputMode; CliOutputMode mCliOutputMode;
bool mVerify; bool mVerify;
nn::hac::MetaBinary mMeta; nn::hac::Meta mMeta;
void importMeta(); void importMeta();
void validateAcidSignature(const nn::hac::AccessControlInfoDesc& acid); void validateAcidSignature(const nn::hac::AccessControlInfoDesc& acid);
void validateAciFromAcid(const nn::hac::AccessControlInfo& aci, const nn::hac::AccessControlInfoDesc& acid); void validateAciFromAcid(const nn::hac::AccessControlInfo& aci, const nn::hac::AccessControlInfoDesc& acid);
void displayMetaHeader(const nn::hac::MetaBinary& hdr); void displayMetaHeader(const nn::hac::Meta& hdr);
void displayAciHdr(const nn::hac::AccessControlInfo& aci); void displayAciHdr(const nn::hac::AccessControlInfo& aci);
void displayAciDescHdr(const nn::hac::AccessControlInfoDesc& aci); void displayAciDescHdr(const nn::hac::AccessControlInfoDesc& aci);
void displayFac(const nn::hac::FileSystemAccessControlBinary& fac); void displayFac(const nn::hac::FileSystemAccessControl& fac);
void displaySac(const nn::hac::ServiceAccessControlBinary& sac); void displaySac(const nn::hac::ServiceAccessControl& sac);
void displayKernelCap(const nn::hac::KernelCapabilityBinary& kern); void displayKernelCap(const nn::hac::KernelCapabilityControl& kern);
const char* getInstructionTypeStr(nn::hac::meta::InstructionType type) const; const char* getInstructionTypeStr(nn::hac::meta::InstructionType type) const;
const char* getProcAddressSpaceTypeStr(nn::hac::meta::ProcAddrSpaceType type) const; const char* getProcAddressSpaceTypeStr(nn::hac::meta::ProcAddrSpaceType type) const;

View file

@ -415,7 +415,7 @@ void NcaProcess::validateNcaSignatures()
npdm.setCliOutputMode(0); npdm.setCliOutputMode(0);
npdm.process(); npdm.process();
if (fnd::rsa::pss::rsaVerify(npdm.getMetaBinary().getAcid().getNcaHeaderSignature2Key(), fnd::sha::HASH_SHA256, mHdrHash.bytes, mHdrBlock.signature_acid) != 0) if (fnd::rsa::pss::rsaVerify(npdm.getMeta().getAcid().getNcaHeaderSignature2Key(), fnd::sha::HASH_SHA256, mHdrHash.bytes, mHdrBlock.signature_acid) != 0)
{ {
std::cout << "[WARNING] NCA Header ACID Signature: FAIL" << std::endl; std::cout << "[WARNING] NCA Header ACID Signature: FAIL" << std::endl;
} }

View file

@ -4,7 +4,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IFile.h> #include <fnd/IFile.h>
#include <fnd/SharedPtr.h> #include <fnd/SharedPtr.h>
#include <nn/hac/meta.h> #include <nn/hac/define/meta.h>
#include <nn/hac/NroHeader.h> #include <nn/hac/NroHeader.h>
#include "AssetProcess.h" #include "AssetProcess.h"

View file

@ -4,7 +4,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/IFile.h> #include <fnd/IFile.h>
#include <fnd/SharedPtr.h> #include <fnd/SharedPtr.h>
#include <nn/hac/meta.h> #include <nn/hac/define/meta.h>
#include <nn/hac/NsoHeader.h> #include <nn/hac/NsoHeader.h>
#include "common.h" #include "common.h"

View file

@ -4,7 +4,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/Vec.h> #include <fnd/Vec.h>
#include <nn/hac/meta.h> #include <nn/hac/define/meta.h>
#include "common.h" #include "common.h"
#include "SdkApiString.h" #include "SdkApiString.h"

View file

@ -5,7 +5,7 @@
#include <fnd/SharedPtr.h> #include <fnd/SharedPtr.h>
#include <fnd/Vec.h> #include <fnd/Vec.h>
#include <fnd/List.h> #include <fnd/List.h>
#include <nn/hac/romfs.h> #include <nn/hac/define/romfs.h>
#include "common.h" #include "common.h"

View file

@ -15,15 +15,15 @@
#include <fnd/ResourceFileReader.h> #include <fnd/ResourceFileReader.h>
#include <nn/hac/NcaUtils.h> #include <nn/hac/NcaUtils.h>
#include <nn/hac/AesKeygen.h> #include <nn/hac/AesKeygen.h>
#include <nn/hac/xci.h> #include <nn/hac/define/xci.h>
#include <nn/hac/pfs.h> #include <nn/hac/define/pfs.h>
#include <nn/hac/nca.h> #include <nn/hac/define/nca.h>
#include <nn/hac/meta.h> #include <nn/hac/define/meta.h>
#include <nn/hac/romfs.h> #include <nn/hac/define/romfs.h>
#include <nn/hac/cnmt.h> #include <nn/hac/define/cnmt.h>
#include <nn/hac/nacp.h> #include <nn/hac/define/nacp.h>
#include <nn/hac/nso.h> #include <nn/hac/define/nso.h>
#include <nn/hac/nro.h> #include <nn/hac/define/nro.h>
#include <nn/hac/aset.h> #include <nn/hac/aset.h>
#include <nn/pki/SignedData.h> #include <nn/pki/SignedData.h>
#include <nn/pki/CertificateBody.h> #include <nn/pki/CertificateBody.h>

View file

@ -6,7 +6,7 @@
#include <fnd/List.h> #include <fnd/List.h>
#include <nn/pki/SignedData.h> #include <nn/pki/SignedData.h>
#include <nn/pki/CertificateBody.h> #include <nn/pki/CertificateBody.h>
#include <nn/hac/meta.h> #include <nn/hac/define/meta.h>
#include "common.h" #include "common.h"
#include "KeyConfiguration.h" #include "KeyConfiguration.h"

View file

@ -3,7 +3,7 @@
#include <fnd/types.h> #include <fnd/types.h>
#include <fnd/aes.h> #include <fnd/aes.h>
#include <fnd/rsa.h> #include <fnd/rsa.h>
#include <nn/hac/nca.h> #include <nn/hac/define/nca.h>
static const size_t kMasterKeyNum = 0x20; static const size_t kMasterKeyNum = 0x20;
static const size_t kNcaKeakNum = nn::hac::nca::kKeyAreaEncryptionKeyNum; static const size_t kNcaKeakNum = nn::hac::nca::kKeyAreaEncryptionKeyNum;