Initial commit

This commit is contained in:
zhupengfei
2019-08-24 23:30:22 +08:00
commit 4f5a3effd8
38 changed files with 4939 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2019 threeSD Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <string>
#include <vector>
#include "common/common_types.h"
class SDMCDecryptor {
public:
/**
* Initializes the decryptor.
* @param root_folder Path to the "Nintendo 3DS/<ID0>/<ID1>" folder.
*/
explicit SDMCDecryptor(const std::string& root_folder);
~SDMCDecryptor();
/**
* Decrypts a file from the SD card and writes it into another file.
* @param source Path to the file relative to the root folder, starting with "/".
* @param destination Path to the destination file.
* @return true on success, false otherwise
*/
bool DecryptAndWriteFile(const std::string& source, const std::string& destination) const;
/**
* Decrypts a file and reads it into a vector.
* @param source Path to the file relative to the root folder, starting with "/".
*/
std::vector<u8> DecryptFile(const std::string& source) const;
private:
std::string root_folder;
};