mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-07-04 00:22:16 +02:00
Compare commits
6 Commits
f4a966eb4c
...
c3dc418a28
Author | SHA1 | Date | |
---|---|---|---|
|
c3dc418a28 | ||
|
ea17b60da6 | ||
|
05852b0ffd | ||
|
450218773f | ||
|
f6abe32331 | ||
|
390356cd9e |
@ -113,7 +113,7 @@ namespace ams::fssystem {
|
|||||||
AMS_ASSERT(m_header == nullptr);
|
AMS_ASSERT(m_header == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeBuffer(NodeBuffer &&rhs) : m_allocator(rhs.m_allocator), m_header(rhs.m_allocator) {
|
NodeBuffer(NodeBuffer &&rhs) : m_allocator(rhs.m_allocator), m_header(rhs.m_header) {
|
||||||
rhs.m_allocator = nullptr;
|
rhs.m_allocator = nullptr;
|
||||||
rhs.m_header = nullptr;
|
rhs.m_header = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -492,7 +492,7 @@ namespace ams::fssystem {
|
|||||||
AMS_ASSERT(offset >= 0);
|
AMS_ASSERT(offset >= 0);
|
||||||
AMS_ASSERT(this->IsInitialized());
|
AMS_ASSERT(this->IsInitialized());
|
||||||
|
|
||||||
/* Succeed immediately, if we hvae nothing to read. */
|
/* Succeed immediately, if we have nothing to read. */
|
||||||
R_SUCCEED_IF(size == 0);
|
R_SUCCEED_IF(size == 0);
|
||||||
|
|
||||||
/* Declare read lambda. */
|
/* Declare read lambda. */
|
||||||
@ -734,7 +734,7 @@ namespace ams::fssystem {
|
|||||||
}
|
}
|
||||||
required_access_physical_size += physical_size + gap_from_prev;
|
required_access_physical_size += physical_size + gap_from_prev;
|
||||||
|
|
||||||
/* Create an entry. to access the data storage. */
|
/* Create an entry to access the data storage. */
|
||||||
entries[entry_count++] = {
|
entries[entry_count++] = {
|
||||||
.compression_type = entry.compression_type,
|
.compression_type = entry.compression_type,
|
||||||
.gap_from_prev = static_cast<u32>(gap_from_prev),
|
.gap_from_prev = static_cast<u32>(gap_from_prev),
|
||||||
@ -758,7 +758,7 @@ namespace ams::fssystem {
|
|||||||
.virtual_size = static_cast<u32>(read_size),
|
.virtual_size = static_cast<u32>(read_size),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
/* We have no entries, we we can just perform the read. */
|
/* We have no entries, so we can just perform the read. */
|
||||||
R_TRY(read_func(static_cast<size_t>(read_size), util::MakeIFunction([&] (void *dst, size_t dst_size) -> Result {
|
R_TRY(read_func(static_cast<size_t>(read_size), util::MakeIFunction([&] (void *dst, size_t dst_size) -> Result {
|
||||||
/* Check the space we should zero is correct. */
|
/* Check the space we should zero is correct. */
|
||||||
AMS_ASSERT(dst_size == static_cast<size_t>(read_size));
|
AMS_ASSERT(dst_size == static_cast<size_t>(read_size));
|
||||||
|
@ -29,7 +29,7 @@ namespace ams::fssystem {
|
|||||||
public:
|
public:
|
||||||
ZeroStorage() { /* ... */ }
|
ZeroStorage() { /* ... */ }
|
||||||
virtual ~ZeroStorage() { /* ... */ }
|
virtual ~ZeroStorage() { /* ... */ }
|
||||||
|
public:
|
||||||
virtual Result Read(s64 offset, void *buffer, size_t size) override {
|
virtual Result Read(s64 offset, void *buffer, size_t size) override {
|
||||||
AMS_ASSERT(offset >= 0);
|
AMS_ASSERT(offset >= 0);
|
||||||
AMS_ASSERT(buffer != nullptr || size == 0);
|
AMS_ASSERT(buffer != nullptr || size == 0);
|
||||||
|
@ -79,6 +79,7 @@ namespace ams::hos {
|
|||||||
Version_16_0_1 = ::ams::TargetFirmware_16_0_1,
|
Version_16_0_1 = ::ams::TargetFirmware_16_0_1,
|
||||||
Version_16_0_2 = ::ams::TargetFirmware_16_0_2,
|
Version_16_0_2 = ::ams::TargetFirmware_16_0_2,
|
||||||
Version_16_0_3 = ::ams::TargetFirmware_16_0_3,
|
Version_16_0_3 = ::ams::TargetFirmware_16_0_3,
|
||||||
|
Version_16_1_0 = ::ams::TargetFirmware_16_1_0,
|
||||||
|
|
||||||
Version_Current = ::ams::TargetFirmware_Current,
|
Version_Current = ::ams::TargetFirmware_Current,
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ namespace ams::fssystem {
|
|||||||
|
|
||||||
auto cur_entry = *visitor.Get<Entry>();
|
auto cur_entry = *visitor.Get<Entry>();
|
||||||
while (cur_entry.GetOffset() < end_offset) {
|
while (cur_entry.GetOffset() < end_offset) {
|
||||||
/* Try to write the entry to the out list */
|
/* Try to write the entry to the out list. */
|
||||||
if (entry_count != 0) {
|
if (entry_count != 0) {
|
||||||
if (count >= entry_count) {
|
if (count >= entry_count) {
|
||||||
break;
|
break;
|
||||||
|
@ -191,7 +191,7 @@ namespace ams::fssystem {
|
|||||||
m_offset_cache.offsets.end_offset = end_offset;
|
m_offset_cache.offsets.end_offset = end_offset;
|
||||||
m_offset_cache.is_initialized = true;
|
m_offset_cache.is_initialized = true;
|
||||||
|
|
||||||
/* Cancel guard. */
|
/* We succeeded. */
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ namespace ams::fssystem {
|
|||||||
|
|
||||||
entry_index = 0;
|
entry_index = 0;
|
||||||
} else {
|
} else {
|
||||||
m_entry_index = 1;
|
m_entry_index = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the new entry. */
|
/* Read the new entry. */
|
||||||
|
@ -78,7 +78,7 @@ namespace ams::fssystem {
|
|||||||
|
|
||||||
auto cur_entry = *visitor.Get<Entry>();
|
auto cur_entry = *visitor.Get<Entry>();
|
||||||
while (cur_entry.GetVirtualOffset() < end_offset) {
|
while (cur_entry.GetVirtualOffset() < end_offset) {
|
||||||
/* Try to write the entry to the out list */
|
/* Try to write the entry to the out list. */
|
||||||
if (entry_count != 0) {
|
if (entry_count != 0) {
|
||||||
if (count >= entry_count) {
|
if (count >= entry_count) {
|
||||||
break;
|
break;
|
||||||
|
@ -256,7 +256,7 @@ namespace ams::fssystem {
|
|||||||
|
|
||||||
/* Process indirect layer. */
|
/* Process indirect layer. */
|
||||||
if (patch_info.HasIndirectTable()) {
|
if (patch_info.HasIndirectTable()) {
|
||||||
/* Create the indirect meta storage */
|
/* Create the indirect meta storage. */
|
||||||
std::shared_ptr<fs::IStorage> indirect_storage_meta_storage = patch_meta_indirect_meta_storage;
|
std::shared_ptr<fs::IStorage> indirect_storage_meta_storage = patch_meta_indirect_meta_storage;
|
||||||
if (indirect_storage_meta_storage == nullptr) {
|
if (indirect_storage_meta_storage == nullptr) {
|
||||||
/* If we don't have a meta storage, we must not have a patch meta hash layer. */
|
/* If we don't have a meta storage, we must not have a patch meta hash layer. */
|
||||||
|
@ -143,7 +143,7 @@ namespace ams::fssystem {
|
|||||||
/* Check if we have a rights id. */
|
/* Check if we have a rights id. */
|
||||||
constexpr const u8 ZeroRightsId[NcaHeader::RightsIdSize] = {};
|
constexpr const u8 ZeroRightsId[NcaHeader::RightsIdSize] = {};
|
||||||
if (crypto::IsSameBytes(ZeroRightsId, m_header.rights_id, NcaHeader::RightsIdSize)) {
|
if (crypto::IsSameBytes(ZeroRightsId, m_header.rights_id, NcaHeader::RightsIdSize)) {
|
||||||
/* If we do, then we don't have an external key, so we need to generate decryption keys if software keys are available. */
|
/* If we don't, then we don't have an external key, so we need to generate decryption keys if software keys are available. */
|
||||||
if (crypto_cfg.is_available_sw_key) {
|
if (crypto_cfg.is_available_sw_key) {
|
||||||
crypto_cfg.generate_key(m_decryption_keys[NcaHeader::DecryptionKey_AesCtr], crypto::AesDecryptor128::KeySize, m_header.encrypted_key_area + NcaHeader::DecryptionKey_AesCtr * crypto::AesDecryptor128::KeySize, crypto::AesDecryptor128::KeySize, GetKeyTypeValue(m_header.key_index, m_header.GetProperKeyGeneration()));
|
crypto_cfg.generate_key(m_decryption_keys[NcaHeader::DecryptionKey_AesCtr], crypto::AesDecryptor128::KeySize, m_header.encrypted_key_area + NcaHeader::DecryptionKey_AesCtr * crypto::AesDecryptor128::KeySize, crypto::AesDecryptor128::KeySize, GetKeyTypeValue(m_header.key_index, m_header.GetProperKeyGeneration()));
|
||||||
|
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <stratosphere.hpp>
|
#include <stratosphere.hpp>
|
||||||
|
#if defined(ATMOSPHERE_OS_HORIZON)
|
||||||
#include "mitm_pm.os.horizon.h"
|
#include "mitm_pm.os.horizon.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ams::mitm::pm {
|
namespace ams::mitm::pm {
|
||||||
|
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
|
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
|
||||||
#define ATMOSPHERE_RELEASE_VERSION_MINOR 5
|
#define ATMOSPHERE_RELEASE_VERSION_MINOR 5
|
||||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 4
|
#define ATMOSPHERE_RELEASE_VERSION_MICRO 5
|
||||||
|
|
||||||
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
|
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
|
||||||
|
|
||||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 16
|
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 16
|
||||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0
|
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 1
|
||||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 3
|
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0
|
||||||
|
@ -77,8 +77,9 @@
|
|||||||
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_1 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 1)
|
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_1 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 1)
|
||||||
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_2 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 2)
|
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_2 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 2)
|
||||||
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_3 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 3)
|
#define ATMOSPHERE_TARGET_FIRMWARE_16_0_3 ATMOSPHERE_TARGET_FIRMWARE(16, 0, 3)
|
||||||
|
#define ATMOSPHERE_TARGET_FIRMWARE_16_1_0 ATMOSPHERE_TARGET_FIRMWARE(16, 1, 0)
|
||||||
|
|
||||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_16_0_3
|
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_16_1_0
|
||||||
|
|
||||||
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
|
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
|
||||||
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
|
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
|
||||||
@ -148,6 +149,7 @@ namespace ams {
|
|||||||
TargetFirmware_16_0_1 = ATMOSPHERE_TARGET_FIRMWARE_16_0_1,
|
TargetFirmware_16_0_1 = ATMOSPHERE_TARGET_FIRMWARE_16_0_1,
|
||||||
TargetFirmware_16_0_2 = ATMOSPHERE_TARGET_FIRMWARE_16_0_2,
|
TargetFirmware_16_0_2 = ATMOSPHERE_TARGET_FIRMWARE_16_0_2,
|
||||||
TargetFirmware_16_0_3 = ATMOSPHERE_TARGET_FIRMWARE_16_0_3,
|
TargetFirmware_16_0_3 = ATMOSPHERE_TARGET_FIRMWARE_16_0_3,
|
||||||
|
TargetFirmware_16_1_0 = ATMOSPHERE_TARGET_FIRMWARE_16_1_0,
|
||||||
|
|
||||||
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,
|
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user