diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp index 140cadf..a7e66c0 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp @@ -228,7 +228,7 @@ nn::Result ReadSerialNumber(u8* serial) size_t readSize; common::SdReaderWriter sdReader; - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = 1024; void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); if(buf != NULL) { @@ -263,7 +263,7 @@ nn::Result EqualsDeviceIdFileandDeviceId(common::HardwareStateManager& manager) bit32 sdDeviceId; common::SdReaderWriter sdReader; size_t totalSize; - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = 1024; void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); if (buf != NULL) { @@ -311,7 +311,7 @@ nn::Result EqualsRegionDataandRegion() nn::cfg::CTR::CfgRegionCode sdRegion; common::SdReaderWriter sdReader; size_t readSize; - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = 1024; void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); if (buf != NULL) { @@ -385,7 +385,7 @@ nn::Result ImportCountryLanguageData() if (common::ExistsCountryLanguageFile()) { - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = 1024; void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); if (buf != NULL) { @@ -479,7 +479,7 @@ nn::Result ImportMcuRtc(common::HardwareStateManager& manager) { if (common::CheckFileExists(common::MCU_RTC_PATHNAME)) { - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = 1024; NN_LOG("AllocatableSize = %d\n", bufSize); void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); @@ -624,7 +624,7 @@ nn::Result ImportIvs() nn::Result result = nn::ResultSuccess(); nn::fs::FileOutputStream fos; - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize() / 2; + size_t bufSize = 1024; void* enc = common::HeapManager::GetHeap()->Allocate(bufSize); if (enc != NULL) { @@ -744,7 +744,7 @@ nn::Result ImportNorData() nn::cfg::nor::CTR::Initialize(); - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize() / 2; NN_LOG("AllocatableSize = %d\n", bufSize); void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); @@ -819,7 +819,7 @@ nn::Result ReadVersionData() nn::Result result = nn::ResultSuccess(); std::memset(&s_SDVersionData, 0, sizeof(common::VerDef)); - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize() / 2; NN_LOG("AllocatableSize = %d\n", bufSize); void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); @@ -1057,7 +1057,7 @@ bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup) common::ConfigFileLoader configfileLoader; common::SdMountManager::Mount(); - size_t size = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t size = 10240; void* heapAddr = common::HeapManager::GetHeap()->Allocate(size); if(heapAddr != NULL) @@ -1631,7 +1631,7 @@ nn::Result ImportCalData(common::CfgCalData *data) common::SdMountManager::Mount(); - size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize() / 2; void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); if (buf != NULL) {