mirror of
https://github.com/jakcron/nstool
synced 2024-11-14 09:46:39 +00:00
[hac|nstool] Move define headers to separate folder. Renamed classes to omit "Binary".
This commit is contained in:
parent
7937055bd6
commit
c35f31f431
64 changed files with 362 additions and 362 deletions
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <nn/hac/nro.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/nro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
#include <string>
|
||||
#include <fnd/types.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/aci.h>
|
||||
#include <nn/hac/FileSystemAccessControlBinary.h>
|
||||
#include <nn/hac/ServiceAccessControlBinary.h>
|
||||
#include <nn/hac/KernelCapabilityBinary.h>
|
||||
#include <nn/hac/define/aci.h>
|
||||
#include <nn/hac/FileSystemAccessControl.h>
|
||||
#include <nn/hac/ServiceAccessControl.h>
|
||||
#include <nn/hac/KernelCapabilityControl.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
@ -33,14 +33,14 @@ namespace hac
|
|||
uint64_t getProgramId() const;
|
||||
void setProgramId(uint64_t program_id);
|
||||
|
||||
const nn::hac::FileSystemAccessControlBinary& getFileSystemAccessControl() const;
|
||||
void setFileSystemAccessControl(const FileSystemAccessControlBinary& fac);
|
||||
const nn::hac::FileSystemAccessControl& getFileSystemAccessControl() const;
|
||||
void setFileSystemAccessControl(const FileSystemAccessControl& fac);
|
||||
|
||||
const nn::hac::ServiceAccessControlBinary& getServiceAccessControl() const;
|
||||
void setServiceAccessControl(const ServiceAccessControlBinary& sac);
|
||||
const nn::hac::ServiceAccessControl& getServiceAccessControl() const;
|
||||
void setServiceAccessControl(const ServiceAccessControl& sac);
|
||||
|
||||
const nn::hac::KernelCapabilityBinary& getKernelCapabilities() const;
|
||||
void setKernelCapabilities(const KernelCapabilityBinary& kc);
|
||||
const nn::hac::KernelCapabilityControl& getKernelCapabilities() const;
|
||||
void setKernelCapabilities(const KernelCapabilityControl& kc);
|
||||
private:
|
||||
const std::string kModuleName = "ACCESS_CONTROL_INFO_BINARY";
|
||||
|
||||
|
@ -49,9 +49,9 @@ namespace hac
|
|||
|
||||
// variables
|
||||
uint64_t mProgramId;
|
||||
nn::hac::FileSystemAccessControlBinary mFileSystemAccessControl;
|
||||
nn::hac::ServiceAccessControlBinary mServiceAccessControl;
|
||||
nn::hac::KernelCapabilityBinary mKernelCapabilities;
|
||||
nn::hac::FileSystemAccessControl mFileSystemAccessControl;
|
||||
nn::hac::ServiceAccessControl mServiceAccessControl;
|
||||
nn::hac::KernelCapabilityControl mKernelCapabilities;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -3,10 +3,10 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/List.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/aci.h>
|
||||
#include <nn/hac/FileSystemAccessControlBinary.h>
|
||||
#include <nn/hac/ServiceAccessControlBinary.h>
|
||||
#include <nn/hac/KernelCapabilityBinary.h>
|
||||
#include <nn/hac/define/aci.h>
|
||||
#include <nn/hac/FileSystemAccessControl.h>
|
||||
#include <nn/hac/ServiceAccessControl.h>
|
||||
#include <nn/hac/KernelCapabilityControl.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
@ -66,14 +66,14 @@ namespace hac
|
|||
const sProgramIdRestrict& getProgramIdRestrict() const;
|
||||
void setProgramIdRestrict(const sProgramIdRestrict& pid_restrict);
|
||||
|
||||
const nn::hac::FileSystemAccessControlBinary& getFileSystemAccessControl() const;
|
||||
void setFileSystemAccessControl(const FileSystemAccessControlBinary& fac);
|
||||
const nn::hac::FileSystemAccessControl& getFileSystemAccessControl() const;
|
||||
void setFileSystemAccessControl(const FileSystemAccessControl& fac);
|
||||
|
||||
const nn::hac::ServiceAccessControlBinary& getServiceAccessControl() const;
|
||||
void setServiceAccessControl(const ServiceAccessControlBinary& sac);
|
||||
const nn::hac::ServiceAccessControl& getServiceAccessControl() const;
|
||||
void setServiceAccessControl(const ServiceAccessControl& sac);
|
||||
|
||||
const nn::hac::KernelCapabilityBinary& getKernelCapabilities() const;
|
||||
void setKernelCapabilities(const KernelCapabilityBinary& kc);
|
||||
const nn::hac::KernelCapabilityControl& getKernelCapabilities() const;
|
||||
void setKernelCapabilities(const KernelCapabilityControl& kc);
|
||||
private:
|
||||
const std::string kModuleName = "ACCESS_CONTROL_INFO_DESC_BINARY";
|
||||
|
||||
|
@ -84,9 +84,9 @@ namespace hac
|
|||
fnd::rsa::sRsa2048Key mNcaHeaderSignature2Key;
|
||||
fnd::List<aci::Flag> mFlags;
|
||||
sProgramIdRestrict mProgramIdRestrict;
|
||||
nn::hac::FileSystemAccessControlBinary mFileSystemAccessControl;
|
||||
nn::hac::ServiceAccessControlBinary mServiceAccessControl;
|
||||
nn::hac::KernelCapabilityBinary mKernelCapabilities;
|
||||
nn::hac::FileSystemAccessControl mFileSystemAccessControl;
|
||||
nn::hac::ServiceAccessControl mServiceAccessControl;
|
||||
nn::hac::KernelCapabilityControl mKernelCapabilities;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
#include <nn/hac/nacp.h>
|
||||
#include <nn/hac/define/nacp.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/nacp.h>
|
||||
#include <nn/hac/define/nacp.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
#include <nn/hac/ContentInfo.h>
|
||||
#include <nn/hac/ContentMetaInfo.h>
|
||||
#include <nn/hac/ApplicationMetaExtendedHeader.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
#include <nn/hac/fac.h>
|
||||
#include <nn/hac/define/fac.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
namespace hac
|
||||
{
|
||||
class FileSystemAccessControlBinary :
|
||||
class FileSystemAccessControl :
|
||||
public fnd::IByteModel
|
||||
{
|
||||
public:
|
||||
|
@ -36,12 +36,12 @@ namespace hac
|
|||
}
|
||||
};
|
||||
|
||||
FileSystemAccessControlBinary();
|
||||
FileSystemAccessControlBinary(const FileSystemAccessControlBinary& other);
|
||||
FileSystemAccessControl();
|
||||
FileSystemAccessControl(const FileSystemAccessControl& other);
|
||||
|
||||
void operator=(const FileSystemAccessControlBinary& other);
|
||||
bool operator==(const FileSystemAccessControlBinary& other) const;
|
||||
bool operator!=(const FileSystemAccessControlBinary& other) const;
|
||||
void operator=(const FileSystemAccessControl& other);
|
||||
bool operator==(const FileSystemAccessControl& other) const;
|
||||
bool operator!=(const FileSystemAccessControl& other) const;
|
||||
|
||||
// IByteModel
|
||||
void toBytes();
|
||||
|
@ -63,7 +63,7 @@ namespace hac
|
|||
const fnd::List<sSaveDataOwnerId>& getSaveDataOwnerIdList() const;
|
||||
void setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list);
|
||||
private:
|
||||
const std::string kModuleName = "FILE_SYSTEM_ACCESS_CONTROL_BINARY";
|
||||
const std::string kModuleName = "FILE_SYSTEM_ACCESS_CONTROL";
|
||||
|
||||
// raw data
|
||||
fnd::Vec<byte_t> mRawBinary;
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/hierarchicalintegrity.h>
|
||||
#include <nn/hac/define/hierarchicalintegrity.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
#include <fnd/sha.h>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/hierarchicalsha256.h>
|
||||
#include <nn/hac/define/hierarchicalsha256.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
|
||||
|
|
|
@ -16,16 +16,16 @@ namespace nn
|
|||
{
|
||||
namespace hac
|
||||
{
|
||||
class KernelCapabilityBinary :
|
||||
class KernelCapabilityControl :
|
||||
public fnd::IByteModel
|
||||
{
|
||||
public:
|
||||
KernelCapabilityBinary();
|
||||
KernelCapabilityBinary(const KernelCapabilityBinary& other);
|
||||
KernelCapabilityControl();
|
||||
KernelCapabilityControl(const KernelCapabilityControl& other);
|
||||
|
||||
void operator=(const KernelCapabilityBinary& other);
|
||||
bool operator==(const KernelCapabilityBinary& other) const;
|
||||
bool operator!=(const KernelCapabilityBinary& other) const;
|
||||
void operator=(const KernelCapabilityControl& other);
|
||||
bool operator==(const KernelCapabilityControl& other) const;
|
||||
bool operator!=(const KernelCapabilityControl& other) const;
|
||||
|
||||
// IByteModel
|
||||
void toBytes();
|
||||
|
@ -59,7 +59,7 @@ namespace hac
|
|||
MiscFlagsHandler& getMiscFlags();
|
||||
|
||||
private:
|
||||
const std::string kModuleName = "KC_BINARY";
|
||||
const std::string kModuleName = "KERNEL_CAPABILITY_CONTROL";
|
||||
|
||||
// raw binary
|
||||
fnd::Vec<byte_t> mRawBinary;
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <nn/hac/kc.h>
|
||||
#include <nn/hac/define/kc.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/nca.h>
|
||||
#include <nn/hac/define/nca.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/nca.h>
|
||||
#include <nn/hac/define/nca.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <cstring>
|
||||
#include <nn/hac/nro.h>
|
||||
#include <nn/hac/define/nro.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <cstring>
|
||||
#include <nn/hac/nso.h>
|
||||
#include <nn/hac/define/nso.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
#include <nn/hac/pfs.h>
|
||||
#include <nn/hac/define/pfs.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -9,16 +9,16 @@ namespace nn
|
|||
{
|
||||
namespace hac
|
||||
{
|
||||
class ServiceAccessControlBinary :
|
||||
class ServiceAccessControl :
|
||||
public fnd::IByteModel
|
||||
{
|
||||
public:
|
||||
ServiceAccessControlBinary();
|
||||
ServiceAccessControlBinary(const ServiceAccessControlBinary& other);
|
||||
ServiceAccessControl();
|
||||
ServiceAccessControl(const ServiceAccessControl& other);
|
||||
|
||||
void operator=(const ServiceAccessControlBinary& other);
|
||||
bool operator==(const ServiceAccessControlBinary& other) const;
|
||||
bool operator!=(const ServiceAccessControlBinary& other) const;
|
||||
void operator=(const ServiceAccessControl& other);
|
||||
bool operator==(const ServiceAccessControl& other) const;
|
||||
bool operator!=(const ServiceAccessControl& other) const;
|
||||
|
||||
// IByteModel
|
||||
void toBytes();
|
||||
|
@ -30,7 +30,7 @@ namespace hac
|
|||
const fnd::List<ServiceAccessControlEntry>& getServiceList() const;
|
||||
void addService(const ServiceAccessControlEntry& service);
|
||||
private:
|
||||
const std::string kModuleName = "SERVICE_ACCESS_CONTROL_BINARY";
|
||||
const std::string kModuleName = "SERVICE_ACCESS_CONTROL";
|
||||
|
||||
// raw binary
|
||||
fnd::Vec<byte_t> mRawBinary;
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/xci.h>
|
||||
#include <nn/hac/define/xci.h>
|
||||
#include <fnd/IByteModel.h>
|
||||
#include <fnd/List.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include <nn/hac/xci.h>
|
||||
#include <nn/hac/define/xci.h>
|
||||
|
||||
namespace nn
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <fnd/rsa.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <fnd/rsa.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
58
lib/libhac/include/nn/hac/define/meta.h
Normal file
58
lib/libhac/include/nn/hac/define/meta.h
Normal 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)
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
#include <fnd/aes.h>
|
||||
#include <fnd/sha.h>
|
||||
#include <fnd/rsa.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <fnd/rsa.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <fnd/sha.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <fnd/sha.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -4,7 +4,7 @@
|
|||
#include <fnd/aes.h>
|
||||
#include <fnd/sha.h>
|
||||
#include <fnd/rsa.h>
|
||||
#include <nn/hac/macro.h>
|
||||
#include <nn/hac/define/macro.h>
|
||||
|
||||
namespace nn
|
||||
{
|
|
@ -1,58 +1,80 @@
|
|||
#pragma once
|
||||
#include <fnd/types.h>
|
||||
#include <nn/hac/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)
|
||||
}
|
||||
#pragma once
|
||||
#include <string>
|
||||
#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 hac
|
||||
{
|
||||
class Meta :
|
||||
public fnd::IByteModel
|
||||
{
|
||||
public:
|
||||
Meta();
|
||||
Meta(const Meta& other);
|
||||
|
||||
void operator=(const Meta& other);
|
||||
bool operator==(const Meta& other) const;
|
||||
bool operator!=(const Meta& 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";
|
||||
|
||||
// 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;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@
|
|||
<ClInclude Include="include\nn\hac\delta.h" />
|
||||
<ClInclude Include="include\nn\hac\DeltaMetaExtendedHeader.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\HandleTableSizeHandler.h" />
|
||||
<ClInclude Include="include\nn\hac\hierarchicalintegrity.h" />
|
||||
|
@ -49,7 +49,7 @@
|
|||
<ClInclude Include="include\nn\hac\InteruptEntry.h" />
|
||||
<ClInclude Include="include\nn\hac\InteruptHandler.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\KernelVersionEntry.h" />
|
||||
<ClInclude Include="include\nn\hac\KernelVersionHandler.h" />
|
||||
|
@ -57,7 +57,7 @@
|
|||
<ClInclude Include="include\nn\hac\MemoryMappingHandler.h" />
|
||||
<ClInclude Include="include\nn\hac\MemoryPageEntry.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\MiscFlagsHandler.h" />
|
||||
<ClInclude Include="include\nn\hac\MiscParamsEntry.h" />
|
||||
|
@ -76,7 +76,7 @@
|
|||
<ClInclude Include="include\nn\hac\PfsHeader.h" />
|
||||
<ClInclude Include="include\nn\hac\Result.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\SystemCallEntry.h" />
|
||||
<ClInclude Include="include\nn\hac\SystemCallHandler.h" />
|
||||
|
@ -98,7 +98,7 @@
|
|||
<ClCompile Include="source\ContentMeta.cpp" />
|
||||
<ClCompile Include="source\ContentMetaInfo.cpp" />
|
||||
<ClCompile Include="source\DeltaMetaExtendedHeader.cpp" />
|
||||
<ClCompile Include="source\FileSystemAccessControlBinary.cpp" />
|
||||
<ClCompile Include="source\FileSystemAccessControl.cpp" />
|
||||
<ClCompile Include="source\HandleTableSizeEntry.cpp" />
|
||||
<ClCompile Include="source\HandleTableSizeHandler.cpp" />
|
||||
<ClCompile Include="source\HierarchicalIntegrityHeader.cpp" />
|
||||
|
@ -106,13 +106,13 @@
|
|||
<ClCompile Include="source\IdConverter.cpp" />
|
||||
<ClCompile Include="source\InteruptEntry.cpp" />
|
||||
<ClCompile Include="source\InteruptHandler.cpp" />
|
||||
<ClCompile Include="source\KernelCapabilityBinary.cpp" />
|
||||
<ClCompile Include="source\KernelCapabilityControl.cpp" />
|
||||
<ClCompile Include="source\KernelCapabilityEntry.cpp" />
|
||||
<ClCompile Include="source\KernelVersionEntry.cpp" />
|
||||
<ClCompile Include="source\KernelVersionHandler.cpp" />
|
||||
<ClCompile Include="source\MemoryMappingHandler.cpp" />
|
||||
<ClCompile Include="source\MemoryPageEntry.cpp" />
|
||||
<ClCompile Include="source\MetaBinary.cpp" />
|
||||
<ClCompile Include="source\Meta.cpp" />
|
||||
<ClCompile Include="source\MiscFlagsEntry.cpp" />
|
||||
<ClCompile Include="source\MiscFlagsHandler.cpp" />
|
||||
<ClCompile Include="source\MiscParamsEntry.cpp" />
|
||||
|
@ -124,7 +124,7 @@
|
|||
<ClCompile Include="source\PatchMetaExtendedHeader.cpp" />
|
||||
<ClCompile Include="source\PfsHeader.cpp" />
|
||||
<ClCompile Include="source\Result.cpp" />
|
||||
<ClCompile Include="source\ServiceAccessControlBinary.cpp" />
|
||||
<ClCompile Include="source\ServiceAccessControl.cpp" />
|
||||
<ClCompile Include="source\ServiceAccessControlEntry.cpp" />
|
||||
<ClCompile Include="source\SystemCallEntry.cpp" />
|
||||
<ClCompile Include="source\SystemCallHandler.cpp" />
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<ClInclude Include="include\nn\hac\fac.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\FileSystemAccessControlBinary.h">
|
||||
<ClInclude Include="include\nn\hac\FileSystemAccessControl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\HandleTableSizeEntry.h">
|
||||
|
@ -99,7 +99,7 @@
|
|||
<ClInclude Include="include\nn\hac\kc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\KernelCapabilityBinary.h">
|
||||
<ClInclude Include="include\nn\hac\KernelCapabilityControl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\KernelCapabilityEntry.h">
|
||||
|
@ -123,7 +123,7 @@
|
|||
<ClInclude Include="include\nn\hac\meta.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\MetaBinary.h">
|
||||
<ClInclude Include="include\nn\hac\Meta.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\MiscFlagsEntry.h">
|
||||
|
@ -180,7 +180,7 @@
|
|||
<ClInclude Include="include\nn\hac\romfs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\ServiceAccessControlBinary.h">
|
||||
<ClInclude Include="include\nn\hac\ServiceAccessControl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\nn\hac\ServiceAccessControlEntry.h">
|
||||
|
@ -242,7 +242,7 @@
|
|||
<ClCompile Include="source\DeltaMetaExtendedHeader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\FileSystemAccessControlBinary.cpp">
|
||||
<ClCompile Include="source\FileSystemAccessControl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\HandleTableSizeEntry.cpp">
|
||||
|
@ -263,7 +263,7 @@
|
|||
<ClCompile Include="source\InteruptHandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\KernelCapabilityBinary.cpp">
|
||||
<ClCompile Include="source\KernelCapabilityControl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\KernelCapabilityEntry.cpp">
|
||||
|
@ -299,7 +299,7 @@
|
|||
<ClCompile Include="source\NcaUtils.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\MetaBinary.cpp">
|
||||
<ClCompile Include="source\Meta.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\NroHeader.cpp">
|
||||
|
@ -314,7 +314,7 @@
|
|||
<ClCompile Include="source\PfsHeader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ServiceAccessControlBinary.cpp">
|
||||
<ClCompile Include="source\ServiceAccessControl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\ServiceAccessControlEntry.cpp">
|
||||
|
|
|
@ -142,32 +142,32 @@ void nn::hac::AccessControlInfo::setProgramId(uint64_t 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;
|
||||
}
|
||||
|
||||
void nn::hac::AccessControlInfo::setFileSystemAccessControl(const nn::hac::FileSystemAccessControlBinary& fac)
|
||||
void nn::hac::AccessControlInfo::setFileSystemAccessControl(const nn::hac::FileSystemAccessControl& fac)
|
||||
{
|
||||
mFileSystemAccessControl = fac;
|
||||
}
|
||||
|
||||
const nn::hac::ServiceAccessControlBinary& nn::hac::AccessControlInfo::getServiceAccessControl() const
|
||||
const nn::hac::ServiceAccessControl& nn::hac::AccessControlInfo::getServiceAccessControl() const
|
||||
{
|
||||
return mServiceAccessControl;
|
||||
}
|
||||
|
||||
void nn::hac::AccessControlInfo::setServiceAccessControl(const nn::hac::ServiceAccessControlBinary& sac)
|
||||
void nn::hac::AccessControlInfo::setServiceAccessControl(const nn::hac::ServiceAccessControl& sac)
|
||||
{
|
||||
mServiceAccessControl = sac;
|
||||
}
|
||||
|
||||
const nn::hac::KernelCapabilityBinary& nn::hac::AccessControlInfo::getKernelCapabilities() const
|
||||
const nn::hac::KernelCapabilityControl& nn::hac::AccessControlInfo::getKernelCapabilities() const
|
||||
{
|
||||
return mKernelCapabilities;
|
||||
}
|
||||
|
||||
void nn::hac::AccessControlInfo::setKernelCapabilities(const nn::hac::KernelCapabilityBinary& kc)
|
||||
void nn::hac::AccessControlInfo::setKernelCapabilities(const nn::hac::KernelCapabilityControl& kc)
|
||||
{
|
||||
mKernelCapabilities = kc;
|
||||
}
|
|
@ -220,32 +220,32 @@ void nn::hac::AccessControlInfoDesc::setProgramIdRestrict(const sProgramIdRestri
|
|||
mProgramIdRestrict = pid_restrict;
|
||||
}
|
||||
|
||||
const nn::hac::FileSystemAccessControlBinary& nn::hac::AccessControlInfoDesc::getFileSystemAccessControl() const
|
||||
const nn::hac::FileSystemAccessControl& nn::hac::AccessControlInfoDesc::getFileSystemAccessControl() const
|
||||
{
|
||||
return mFileSystemAccessControl;
|
||||
}
|
||||
|
||||
void nn::hac::AccessControlInfoDesc::setFileSystemAccessControl(const nn::hac::FileSystemAccessControlBinary& fac)
|
||||
void nn::hac::AccessControlInfoDesc::setFileSystemAccessControl(const nn::hac::FileSystemAccessControl& fac)
|
||||
{
|
||||
mFileSystemAccessControl = fac;
|
||||
}
|
||||
|
||||
const nn::hac::ServiceAccessControlBinary& nn::hac::AccessControlInfoDesc::getServiceAccessControl() const
|
||||
const nn::hac::ServiceAccessControl& nn::hac::AccessControlInfoDesc::getServiceAccessControl() const
|
||||
{
|
||||
return mServiceAccessControl;
|
||||
}
|
||||
|
||||
void nn::hac::AccessControlInfoDesc::setServiceAccessControl(const nn::hac::ServiceAccessControlBinary& sac)
|
||||
void nn::hac::AccessControlInfoDesc::setServiceAccessControl(const nn::hac::ServiceAccessControl& sac)
|
||||
{
|
||||
mServiceAccessControl = sac;
|
||||
}
|
||||
|
||||
const nn::hac::KernelCapabilityBinary& nn::hac::AccessControlInfoDesc::getKernelCapabilities() const
|
||||
const nn::hac::KernelCapabilityControl& nn::hac::AccessControlInfoDesc::getKernelCapabilities() const
|
||||
{
|
||||
return mKernelCapabilities;
|
||||
}
|
||||
|
||||
void nn::hac::AccessControlInfoDesc::setKernelCapabilities(const nn::hac::KernelCapabilityBinary& kc)
|
||||
void nn::hac::AccessControlInfoDesc::setKernelCapabilities(const nn::hac::KernelCapabilityControl& kc)
|
||||
{
|
||||
mKernelCapabilities = kc;
|
||||
}
|
|
@ -1,17 +1,17 @@
|
|||
#include <cstring>
|
||||
#include <nn/hac/FileSystemAccessControlBinary.h>
|
||||
#include <nn/hac/FileSystemAccessControl.h>
|
||||
|
||||
nn::hac::FileSystemAccessControlBinary::FileSystemAccessControlBinary()
|
||||
nn::hac::FileSystemAccessControl::FileSystemAccessControl()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
nn::hac::FileSystemAccessControlBinary::FileSystemAccessControlBinary(const FileSystemAccessControlBinary & other)
|
||||
nn::hac::FileSystemAccessControl::FileSystemAccessControl(const FileSystemAccessControl & other)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::operator=(const FileSystemAccessControlBinary & other)
|
||||
void nn::hac::FileSystemAccessControl::operator=(const FileSystemAccessControl & other)
|
||||
{
|
||||
mRawBinary = other.mRawBinary;
|
||||
mVersion = other.mVersion;
|
||||
|
@ -20,7 +20,7 @@ void nn::hac::FileSystemAccessControlBinary::operator=(const FileSystemAccessCon
|
|||
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) \
|
||||
&& (mFsaRights == other.mFsaRights) \
|
||||
|
@ -28,12 +28,12 @@ bool nn::hac::FileSystemAccessControlBinary::operator==(const FileSystemAccessCo
|
|||
&& (mSaveDataOwnerIdList == other.mSaveDataOwnerIdList);
|
||||
}
|
||||
|
||||
bool nn::hac::FileSystemAccessControlBinary::operator!=(const FileSystemAccessControlBinary & other) const
|
||||
bool nn::hac::FileSystemAccessControl::operator!=(const FileSystemAccessControl & other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::toBytes()
|
||||
void nn::hac::FileSystemAccessControl::toBytes()
|
||||
{
|
||||
// determine section layout
|
||||
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
|
||||
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;
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::clear()
|
||||
void nn::hac::FileSystemAccessControl::clear()
|
||||
{
|
||||
mRawBinary.clear();
|
||||
mVersion = 0;
|
||||
|
@ -178,42 +178,42 @@ void nn::hac::FileSystemAccessControlBinary::clear()
|
|||
mSaveDataOwnerIdList.clear();
|
||||
}
|
||||
|
||||
uint32_t nn::hac::FileSystemAccessControlBinary::getFormatVersion() const
|
||||
uint32_t nn::hac::FileSystemAccessControl::getFormatVersion() const
|
||||
{
|
||||
return mVersion;
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::setFormatVersion(uint32_t format_version)
|
||||
void nn::hac::FileSystemAccessControl::setFormatVersion(uint32_t 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;
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::setFsaRightsList(const fnd::List<fac::FsAccessFlag>& list)
|
||||
void nn::hac::FileSystemAccessControl::setFsaRightsList(const fnd::List<fac::FsAccessFlag>& 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;
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::setContentOwnerIdList(const fnd::List<uint64_t>& list)
|
||||
void nn::hac::FileSystemAccessControl::setContentOwnerIdList(const fnd::List<uint64_t>& 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;
|
||||
}
|
||||
|
||||
void nn::hac::FileSystemAccessControlBinary::setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list)
|
||||
void nn::hac::FileSystemAccessControl::setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list)
|
||||
{
|
||||
mSaveDataOwnerIdList = list;
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
void nn::hac::KernelCapabilityBinary::operator=(const KernelCapabilityBinary & other)
|
||||
void nn::hac::KernelCapabilityControl::operator=(const KernelCapabilityControl & other)
|
||||
{
|
||||
clear();
|
||||
mRawBinary = other.mRawBinary;
|
||||
|
@ -22,7 +22,7 @@ void nn::hac::KernelCapabilityBinary::operator=(const KernelCapabilityBinary & o
|
|||
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) \
|
||||
&& (mSystemCalls == other.mSystemCalls) \
|
||||
|
@ -34,12 +34,12 @@ bool nn::hac::KernelCapabilityBinary::operator==(const KernelCapabilityBinary &
|
|||
&& (mMiscFlags == other.mMiscFlags);
|
||||
}
|
||||
|
||||
bool nn::hac::KernelCapabilityBinary::operator!=(const KernelCapabilityBinary & other) const
|
||||
bool nn::hac::KernelCapabilityControl::operator!=(const KernelCapabilityControl & other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
void nn::hac::KernelCapabilityBinary::toBytes()
|
||||
void nn::hac::KernelCapabilityControl::toBytes()
|
||||
{
|
||||
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)
|
||||
{
|
||||
throw fnd::Exception(kModuleName, "KernelCapabilityEntry list must be aligned to 4 bytes");
|
||||
}
|
||||
|
||||
// save copy of KernelCapabilityBinary
|
||||
// save copy of KernelCapabilityControl
|
||||
mRawBinary.alloc(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);
|
||||
}
|
||||
|
||||
const fnd::Vec<byte_t>& nn::hac::KernelCapabilityBinary::getBytes() const
|
||||
const fnd::Vec<byte_t>& nn::hac::KernelCapabilityControl::getBytes() const
|
||||
{
|
||||
return mRawBinary;
|
||||
}
|
||||
|
||||
void nn::hac::KernelCapabilityBinary::clear()
|
||||
void nn::hac::KernelCapabilityControl::clear()
|
||||
{
|
||||
mRawBinary.clear();
|
||||
mThreadInfo.clear();
|
||||
|
@ -150,82 +150,82 @@ void nn::hac::KernelCapabilityBinary::clear()
|
|||
mMiscFlags.clear();
|
||||
}
|
||||
|
||||
const nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityBinary::getThreadInfo() const
|
||||
const nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityControl::getThreadInfo() const
|
||||
{
|
||||
return mThreadInfo;
|
||||
}
|
||||
|
||||
nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityBinary::getThreadInfo()
|
||||
nn::hac::ThreadInfoHandler & nn::hac::KernelCapabilityControl::getThreadInfo()
|
||||
{
|
||||
return mThreadInfo;
|
||||
}
|
||||
|
||||
const nn::hac::SystemCallHandler & nn::hac::KernelCapabilityBinary::getSystemCalls() const
|
||||
const nn::hac::SystemCallHandler & nn::hac::KernelCapabilityControl::getSystemCalls() const
|
||||
{
|
||||
return mSystemCalls;
|
||||
}
|
||||
|
||||
nn::hac::SystemCallHandler & nn::hac::KernelCapabilityBinary::getSystemCalls()
|
||||
nn::hac::SystemCallHandler & nn::hac::KernelCapabilityControl::getSystemCalls()
|
||||
{
|
||||
return mSystemCalls;
|
||||
}
|
||||
|
||||
const nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityBinary::getMemoryMaps() const
|
||||
const nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityControl::getMemoryMaps() const
|
||||
{
|
||||
return mMemoryMap;
|
||||
}
|
||||
|
||||
nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityBinary::getMemoryMaps()
|
||||
nn::hac::MemoryMappingHandler & nn::hac::KernelCapabilityControl::getMemoryMaps()
|
||||
{
|
||||
return mMemoryMap;
|
||||
}
|
||||
|
||||
const nn::hac::InteruptHandler & nn::hac::KernelCapabilityBinary::getInterupts() const
|
||||
const nn::hac::InteruptHandler & nn::hac::KernelCapabilityControl::getInterupts() const
|
||||
{
|
||||
return mInterupts;
|
||||
}
|
||||
|
||||
nn::hac::InteruptHandler & nn::hac::KernelCapabilityBinary::getInterupts()
|
||||
nn::hac::InteruptHandler & nn::hac::KernelCapabilityControl::getInterupts()
|
||||
{
|
||||
return mInterupts;
|
||||
}
|
||||
|
||||
const nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityBinary::getMiscParams() const
|
||||
const nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityControl::getMiscParams() const
|
||||
{
|
||||
return mMiscParams;
|
||||
}
|
||||
|
||||
nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityBinary::getMiscParams()
|
||||
nn::hac::MiscParamsHandler & nn::hac::KernelCapabilityControl::getMiscParams()
|
||||
{
|
||||
return mMiscParams;
|
||||
}
|
||||
|
||||
const nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityBinary::getKernelVersion() const
|
||||
const nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityControl::getKernelVersion() const
|
||||
{
|
||||
return mKernelVersion;
|
||||
}
|
||||
|
||||
nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityBinary::getKernelVersion()
|
||||
nn::hac::KernelVersionHandler & nn::hac::KernelCapabilityControl::getKernelVersion()
|
||||
{
|
||||
return mKernelVersion;
|
||||
}
|
||||
|
||||
const nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityBinary::getHandleTableSize() const
|
||||
const nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityControl::getHandleTableSize() const
|
||||
{
|
||||
return mHandleTableSize;
|
||||
}
|
||||
|
||||
nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityBinary::getHandleTableSize()
|
||||
nn::hac::HandleTableSizeHandler & nn::hac::KernelCapabilityControl::getHandleTableSize()
|
||||
{
|
||||
return mHandleTableSize;
|
||||
}
|
||||
|
||||
const nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityBinary::getMiscFlags() const
|
||||
const nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityControl::getMiscFlags() const
|
||||
{
|
||||
return mMiscFlags;
|
||||
}
|
||||
|
||||
nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityBinary::getMiscFlags()
|
||||
nn::hac::MiscFlagsHandler & nn::hac::KernelCapabilityControl::getMiscFlags()
|
||||
{
|
||||
return mMiscFlags;
|
||||
}
|
|
@ -1,19 +1,19 @@
|
|||
#include <nn/hac/MetaBinary.h>
|
||||
#include <nn/hac/Meta.h>
|
||||
|
||||
#include <fnd/SimpleTextOutput.h>
|
||||
|
||||
nn::hac::MetaBinary::MetaBinary()
|
||||
nn::hac::Meta::Meta()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
nn::hac::MetaBinary::MetaBinary(const MetaBinary & other) :
|
||||
MetaBinary()
|
||||
nn::hac::Meta::Meta(const Meta & other) :
|
||||
Meta()
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::operator=(const MetaBinary & other)
|
||||
void nn::hac::Meta::operator=(const Meta & other)
|
||||
{
|
||||
mRawBinary = other.mRawBinary;
|
||||
mInstructionType = other.mInstructionType;
|
||||
|
@ -28,7 +28,7 @@ void nn::hac::MetaBinary::operator=(const MetaBinary & other)
|
|||
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) \
|
||||
&& (mProcAddressSpaceType == other.mProcAddressSpaceType) \
|
||||
|
@ -42,12 +42,12 @@ bool nn::hac::MetaBinary::operator==(const MetaBinary & other) const
|
|||
&& (mAcid == other.mAcid);
|
||||
}
|
||||
|
||||
bool nn::hac::MetaBinary::operator!=(const MetaBinary & other) const
|
||||
bool nn::hac::Meta::operator!=(const Meta & other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::toBytes()
|
||||
void nn::hac::Meta::toBytes()
|
||||
{
|
||||
if (mAcid.getBytes().size() == 0)
|
||||
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
|
||||
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;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::clear()
|
||||
void nn::hac::Meta::clear()
|
||||
{
|
||||
mRawBinary.clear();
|
||||
mInstructionType = meta::INSTR_64BIT;
|
||||
|
@ -179,32 +179,32 @@ void nn::hac::MetaBinary::clear()
|
|||
mAcid.clear();
|
||||
}
|
||||
|
||||
nn::hac::meta::InstructionType nn::hac::MetaBinary::getInstructionType() const
|
||||
nn::hac::meta::InstructionType nn::hac::Meta::getInstructionType() const
|
||||
{
|
||||
return mInstructionType;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setInstructionType(meta::InstructionType type)
|
||||
void nn::hac::Meta::setInstructionType(meta::InstructionType type)
|
||||
{
|
||||
mInstructionType = type;
|
||||
}
|
||||
|
||||
nn::hac::meta::ProcAddrSpaceType nn::hac::MetaBinary::getProcAddressSpaceType() const
|
||||
nn::hac::meta::ProcAddrSpaceType nn::hac::Meta::getProcAddressSpaceType() const
|
||||
{
|
||||
return mProcAddressSpaceType;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setProcAddressSpaceType(meta::ProcAddrSpaceType type)
|
||||
void nn::hac::Meta::setProcAddressSpaceType(meta::ProcAddrSpaceType type)
|
||||
{
|
||||
mProcAddressSpaceType = type;
|
||||
}
|
||||
|
||||
byte_t nn::hac::MetaBinary::getMainThreadPriority() const
|
||||
byte_t nn::hac::Meta::getMainThreadPriority() const
|
||||
{
|
||||
return mMainThreadPriority;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setMainThreadPriority(byte_t priority)
|
||||
void nn::hac::Meta::setMainThreadPriority(byte_t priority)
|
||||
{
|
||||
if (priority > meta::kMaxPriority)
|
||||
{
|
||||
|
@ -214,42 +214,42 @@ void nn::hac::MetaBinary::setMainThreadPriority(byte_t priority)
|
|||
mMainThreadPriority = priority;
|
||||
}
|
||||
|
||||
byte_t nn::hac::MetaBinary::getMainThreadCpuId() const
|
||||
byte_t nn::hac::Meta::getMainThreadCpuId() const
|
||||
{
|
||||
return mMainThreadCpuId;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setMainThreadCpuId(byte_t core_num)
|
||||
void nn::hac::Meta::setMainThreadCpuId(byte_t core_num)
|
||||
{
|
||||
mMainThreadCpuId = core_num;
|
||||
}
|
||||
|
||||
uint32_t nn::hac::MetaBinary::getVersion() const
|
||||
uint32_t nn::hac::Meta::getVersion() const
|
||||
{
|
||||
return mVersion;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setVersion(uint32_t version)
|
||||
void nn::hac::Meta::setVersion(uint32_t version)
|
||||
{
|
||||
mVersion = version;
|
||||
}
|
||||
|
||||
uint32_t nn::hac::MetaBinary::getMainThreadStackSize() const
|
||||
uint32_t nn::hac::Meta::getMainThreadStackSize() const
|
||||
{
|
||||
return mMainThreadStackSize;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setMainThreadStackSize(uint32_t size)
|
||||
void nn::hac::Meta::setMainThreadStackSize(uint32_t size)
|
||||
{
|
||||
mMainThreadStackSize = size;
|
||||
}
|
||||
|
||||
const std::string & nn::hac::MetaBinary::getName() const
|
||||
const std::string & nn::hac::Meta::getName() const
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -259,12 +259,12 @@ void nn::hac::MetaBinary::setName(const std::string & name)
|
|||
mName = name;
|
||||
}
|
||||
|
||||
const std::string & nn::hac::MetaBinary::getProductCode() const
|
||||
const std::string & nn::hac::Meta::getProductCode() const
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -274,22 +274,22 @@ void nn::hac::MetaBinary::setProductCode(const std::string & 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;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setAci(const AccessControlInfo & aci)
|
||||
void nn::hac::Meta::setAci(const AccessControlInfo & aci)
|
||||
{
|
||||
mAci = aci;
|
||||
}
|
||||
|
||||
const nn::hac::AccessControlInfoDesc & nn::hac::MetaBinary::getAcid() const
|
||||
const nn::hac::AccessControlInfoDesc & nn::hac::Meta::getAcid() const
|
||||
{
|
||||
return mAcid;
|
||||
}
|
||||
|
||||
void nn::hac::MetaBinary::setAcid(const AccessControlInfoDesc & acid)
|
||||
void nn::hac::Meta::setAcid(const AccessControlInfoDesc & acid)
|
||||
{
|
||||
mAcid = acid;
|
||||
}
|
|
@ -1,33 +1,33 @@
|
|||
#include <cstring>
|
||||
#include <nn/hac/ServiceAccessControlBinary.h>
|
||||
#include <nn/hac/ServiceAccessControl.h>
|
||||
|
||||
nn::hac::ServiceAccessControlBinary::ServiceAccessControlBinary()
|
||||
nn::hac::ServiceAccessControl::ServiceAccessControl()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
nn::hac::ServiceAccessControlBinary::ServiceAccessControlBinary(const ServiceAccessControlBinary & other)
|
||||
nn::hac::ServiceAccessControl::ServiceAccessControl(const ServiceAccessControl & other)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
void nn::hac::ServiceAccessControlBinary::operator=(const ServiceAccessControlBinary & other)
|
||||
void nn::hac::ServiceAccessControl::operator=(const ServiceAccessControl & other)
|
||||
{
|
||||
mRawBinary = other.mRawBinary;
|
||||
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);
|
||||
}
|
||||
|
||||
bool nn::hac::ServiceAccessControlBinary::operator!=(const ServiceAccessControlBinary & other) const
|
||||
bool nn::hac::ServiceAccessControl::operator!=(const ServiceAccessControl & other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
void nn::hac::ServiceAccessControlBinary::toBytes()
|
||||
void nn::hac::ServiceAccessControl::toBytes()
|
||||
{
|
||||
size_t totalSize = 0;
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
void nn::hac::ServiceAccessControlBinary::clear()
|
||||
void nn::hac::ServiceAccessControl::clear()
|
||||
{
|
||||
mRawBinary.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;
|
||||
}
|
||||
|
||||
void nn::hac::ServiceAccessControlBinary::addService(const ServiceAccessControlEntry& service)
|
||||
void nn::hac::ServiceAccessControl::addService(const ServiceAccessControlEntry& service)
|
||||
{
|
||||
mServices.addElement(service);
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
#include <fnd/aes.h>
|
||||
#include <fnd/rsa.h>
|
||||
#include <fnd/ecdsa.h>
|
||||
#include <nn/hac/nca.h>
|
||||
#include <nn/hac/define/nca.h>
|
||||
#include <nn/pki/SignedData.h>
|
||||
#include <nn/es/TicketBody_V2.h>
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ void MetaProcess::setVerifyMode(bool verify)
|
|||
mVerify = verify;
|
||||
}
|
||||
|
||||
const nn::hac::MetaBinary& MetaProcess::getMetaBinary() const
|
||||
const nn::hac::Meta& MetaProcess::getMeta() const
|
||||
{
|
||||
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 << " 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;
|
||||
}
|
||||
|
||||
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 << " 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 List:" << std::endl;
|
||||
|
@ -394,7 +394,7 @@ void MetaProcess::displaySac(const nn::hac::ServiceAccessControlBinary& sac)
|
|||
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;
|
||||
if (kern.getThreadInfo().isSet())
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/IFile.h>
|
||||
#include <fnd/SharedPtr.h>
|
||||
#include <nn/hac/MetaBinary.h>
|
||||
#include <nn/hac/Meta.h>
|
||||
#include "KeyConfiguration.h"
|
||||
|
||||
#include "common.h"
|
||||
|
@ -20,7 +20,7 @@ public:
|
|||
void setCliOutputMode(CliOutputMode type);
|
||||
void setVerifyMode(bool verify);
|
||||
|
||||
const nn::hac::MetaBinary& getMetaBinary() const;
|
||||
const nn::hac::Meta& getMeta() const;
|
||||
|
||||
private:
|
||||
const std::string kModuleName = "MetaProcess";
|
||||
|
@ -30,19 +30,19 @@ private:
|
|||
CliOutputMode mCliOutputMode;
|
||||
bool mVerify;
|
||||
|
||||
nn::hac::MetaBinary mMeta;
|
||||
nn::hac::Meta mMeta;
|
||||
|
||||
void importMeta();
|
||||
|
||||
void validateAcidSignature(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 displayAciDescHdr(const nn::hac::AccessControlInfoDesc& aci);
|
||||
void displayFac(const nn::hac::FileSystemAccessControlBinary& fac);
|
||||
void displaySac(const nn::hac::ServiceAccessControlBinary& sac);
|
||||
void displayKernelCap(const nn::hac::KernelCapabilityBinary& kern);
|
||||
void displayFac(const nn::hac::FileSystemAccessControl& fac);
|
||||
void displaySac(const nn::hac::ServiceAccessControl& sac);
|
||||
void displayKernelCap(const nn::hac::KernelCapabilityControl& kern);
|
||||
|
||||
const char* getInstructionTypeStr(nn::hac::meta::InstructionType type) const;
|
||||
const char* getProcAddressSpaceTypeStr(nn::hac::meta::ProcAddrSpaceType type) const;
|
||||
|
|
|
@ -415,7 +415,7 @@ void NcaProcess::validateNcaSignatures()
|
|||
npdm.setCliOutputMode(0);
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/IFile.h>
|
||||
#include <fnd/SharedPtr.h>
|
||||
#include <nn/hac/meta.h>
|
||||
#include <nn/hac/define/meta.h>
|
||||
#include <nn/hac/NroHeader.h>
|
||||
#include "AssetProcess.h"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/IFile.h>
|
||||
#include <fnd/SharedPtr.h>
|
||||
#include <nn/hac/meta.h>
|
||||
#include <nn/hac/define/meta.h>
|
||||
#include <nn/hac/NsoHeader.h>
|
||||
|
||||
#include "common.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/Vec.h>
|
||||
|
||||
#include <nn/hac/meta.h>
|
||||
#include <nn/hac/define/meta.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "SdkApiString.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <fnd/SharedPtr.h>
|
||||
#include <fnd/Vec.h>
|
||||
#include <fnd/List.h>
|
||||
#include <nn/hac/romfs.h>
|
||||
#include <nn/hac/define/romfs.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
|
|
@ -15,15 +15,15 @@
|
|||
#include <fnd/ResourceFileReader.h>
|
||||
#include <nn/hac/NcaUtils.h>
|
||||
#include <nn/hac/AesKeygen.h>
|
||||
#include <nn/hac/xci.h>
|
||||
#include <nn/hac/pfs.h>
|
||||
#include <nn/hac/nca.h>
|
||||
#include <nn/hac/meta.h>
|
||||
#include <nn/hac/romfs.h>
|
||||
#include <nn/hac/cnmt.h>
|
||||
#include <nn/hac/nacp.h>
|
||||
#include <nn/hac/nso.h>
|
||||
#include <nn/hac/nro.h>
|
||||
#include <nn/hac/define/xci.h>
|
||||
#include <nn/hac/define/pfs.h>
|
||||
#include <nn/hac/define/nca.h>
|
||||
#include <nn/hac/define/meta.h>
|
||||
#include <nn/hac/define/romfs.h>
|
||||
#include <nn/hac/define/cnmt.h>
|
||||
#include <nn/hac/define/nacp.h>
|
||||
#include <nn/hac/define/nso.h>
|
||||
#include <nn/hac/define/nro.h>
|
||||
#include <nn/hac/aset.h>
|
||||
#include <nn/pki/SignedData.h>
|
||||
#include <nn/pki/CertificateBody.h>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <fnd/List.h>
|
||||
#include <nn/pki/SignedData.h>
|
||||
#include <nn/pki/CertificateBody.h>
|
||||
#include <nn/hac/meta.h>
|
||||
#include <nn/hac/define/meta.h>
|
||||
#include "common.h"
|
||||
#include "KeyConfiguration.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <fnd/types.h>
|
||||
#include <fnd/aes.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 kNcaKeakNum = nn::hac::nca::kKeyAreaEncryptionKeyNum;
|
||||
|
|
Loading…
Reference in a new issue