NANDImporter: Add support for dumps that don't include keys

This adds support for NAND images that only include the NAND
(i.e. without the OTP/SEEPROM dump appended at the end of the file).
This commit is contained in:
Léo Lam
2017-10-26 21:22:16 +02:00
parent 5d449c00e6
commit 96d7c39891
4 changed files with 56 additions and 20 deletions

View File

@ -18,7 +18,11 @@ public:
NANDImporter();
~NANDImporter();
void ImportNANDBin(const std::string& path_to_bin, std::function<void()> update_callback);
// Extract a NAND image to the configured NAND root.
// If the associated OTP/SEEPROM dump (keys.bin) is not included in the image,
// get_otp_dump_path will be called to get a path to it.
void ImportNANDBin(const std::string& path_to_bin, std::function<void()> update_callback,
std::function<std::string()> get_otp_dump_path);
bool ExtractCertificates(const std::string& nand_root);
private:
@ -38,7 +42,7 @@ private:
};
#pragma pack(pop)
bool ReadNANDBin(const std::string& path_to_bin);
bool ReadNANDBin(const std::string& path_to_bin, std::function<std::string()> get_otp_dump_path);
void FindSuperblock();
std::string GetPath(const NANDFSTEntry& entry, const std::string& parent_path);
std::string FormatDebugString(const NANDFSTEntry& entry);