- implemented frontend
- namespaced Core
- imported qdevicewatcher
- fixed bug in logging (more like in misc)
This commit is contained in:
zhupengfei
2019-08-28 19:16:05 +08:00
parent fd5106759a
commit 7df0b63a1e
22 changed files with 351 additions and 166 deletions
+4
View File
@@ -6,6 +6,8 @@
#include "common/assert.h"
#include "core/data_container.h"
namespace Core {
constexpr u32 MakeMagic(char a, char b, char c, char d) {
return a | b << 8 | c << 16 | d << 24;
}
@@ -150,3 +152,5 @@ std::vector<std::vector<u8>> DataContainer::GetIVFCLevel4Data() const {
return {GetPartitionData(0), GetPartitionData(1)};
}
}
} // namespace Core
+4
View File
@@ -10,6 +10,8 @@
#include "common/common_types.h"
#include "common/swap.h"
namespace Core {
#pragma pack(push, 1)
struct DataDescriptor {
u64_le offset;
@@ -127,3 +129,5 @@ private:
std::vector<DataDescriptor> partition_descriptors;
std::vector<DataDescriptor> partitions;
};
} // namespace Core
+4
View File
@@ -15,6 +15,8 @@
#include "core/decryptor.h"
#include "core/key/key.h"
namespace Core {
SDMCDecryptor::SDMCDecryptor(const std::string& root_folder_) : root_folder(root_folder_) {
ASSERT_MSG(Key::IsNormalKeyAvailable(Key::SDKey),
"SD Key must be available in order to decrypt");
@@ -89,3 +91,5 @@ std::vector<u8> SDMCDecryptor::DecryptFile(const std::string& source) const {
aes.ProcessData(data.data(), encrypted_data.data(), encrypted_data.size());
return data;
}
} // namespace Core
+4
View File
@@ -8,6 +8,8 @@
#include <vector>
#include "common/common_types.h"
namespace Core {
class SDMCDecryptor {
public:
/**
@@ -35,3 +37,5 @@ public:
private:
std::string root_folder;
};
} // namespace Core
+6 -2
View File
@@ -11,6 +11,8 @@
#include "core/inner_fat.h"
#include "core/key/key.h"
namespace Core {
SDMCImporter::SDMCImporter(const Config& config_) : config(config_) {
is_good = Init();
}
@@ -305,7 +307,7 @@ std::vector<Config> LoadPresetConfig(std::string mount_point) {
nullptr, mount_point + "Nintendo 3DS/",
[&id_regex, &ProcessDirectory](u64* /*num_entries_out*/, const std::string& directory,
const std::string& virtual_name) {
if (!FileUtil::IsDirectory(directory + virtual_name)) {
if (!FileUtil::IsDirectory(directory + virtual_name + "/")) {
return true;
}
@@ -313,8 +315,10 @@ std::vector<Config> LoadPresetConfig(std::string mount_point) {
return true;
}
return ProcessDirectory(directory + virtual_name);
return ProcessDirectory(directory + virtual_name + "/");
});
return out;
}
} // namespace Core
+4
View File
@@ -9,6 +9,8 @@
#include <vector>
#include "common/common_types.h"
namespace Core {
class SDMCDecryptor;
/**
@@ -99,3 +101,5 @@ private:
* @return a list of preset config available. can be empty
*/
std::vector<Config> LoadPresetConfig(std::string mount_point);
} // namespace Core
+4
View File
@@ -9,6 +9,8 @@
#include "core/decryptor.h"
#include "core/inner_fat.h"
namespace Core {
constexpr u32 MakeMagic(char a, char b, char c, char d) {
return a | b << 8 | c << 16 | d << 24;
}
@@ -334,3 +336,5 @@ ArchiveFormatInfo SDExtdata::GetFormatInfo() const {
return format_info;
}
} // namespace Core
+4
View File
@@ -4,6 +4,8 @@
#pragma once
namespace Core {
#include <array>
#include <type_traits>
#include <vector>
@@ -194,3 +196,5 @@ private:
std::string data_path;
const SDMCDecryptor& decryptor;
};
} // namespace Core
+2 -2
View File
@@ -6,7 +6,7 @@
#include <functional>
#include "core/key/arithmetic128.h"
namespace Key {
namespace Core::Key {
AESKey Lrot128(const AESKey& in, u32 rot) {
AESKey out;
@@ -56,4 +56,4 @@ AESKey Xor128(const AESKey& a, const AESKey& b) {
return out;
}
} // namespace Key
} // namespace Core::Key
+2 -2
View File
@@ -7,11 +7,11 @@
#include "common/common_types.h"
#include "core/key/key.h"
namespace Key {
namespace Core::Key {
AESKey Lrot128(const AESKey& in, u32 rot);
AESKey Add128(const AESKey& a, const AESKey& b);
AESKey Add128(const AESKey& a, u64 b);
AESKey Xor128(const AESKey& a, const AESKey& b);
} // namespace Key
} // namespace Core::Key
+2 -2
View File
@@ -11,7 +11,7 @@
#include "core/key/arithmetic128.h"
#include "core/key/key.h"
namespace Key {
namespace Core::Key {
namespace {
@@ -216,4 +216,4 @@ void SelectCommonKeyIndex(u8 index) {
key_slots[KeySlotID::TicketCommonKey].SetKeyY(common_key_y_slots.at(index));
}
} // namespace Key
} // namespace Core::Key
+2 -2
View File
@@ -9,7 +9,7 @@
#include <string>
#include "common/common_types.h"
namespace Key {
namespace Core::Key {
enum KeySlotID : std::size_t {
@@ -69,4 +69,4 @@ AESKey GetNormalKey(std::size_t slot_id);
void SelectCommonKeyIndex(u8 index);
} // namespace Key
} // namespace Core::Key