Major update

Changed titlekey dump methodology to no longer need reboot.
Added SD seed dumping.
Reorganized and clarified UI text.
Swapped C++-style I/O for C-style.
Tightened up dependencies.
This commit is contained in:
shchmue
2018-12-28 16:06:18 -05:00
parent 41c2604d9a
commit 922cf3f4c4
25 changed files with 23552 additions and 372 deletions

View File

@ -17,12 +17,12 @@
#include "Key.hpp"
#include <algorithm>
#include <iomanip>
#include <vector>
#include <mbedtls/aes.h>
#include <mbedtls/cmac.h>
#include "Common.hpp"
#include "xxhash64.h"
size_t Key::saved_key_count = 0;
@ -68,19 +68,15 @@ Key::Key() :
{
}
void Key::save_key(std::ofstream &file) {
void Key::save_key(FILE *file) {
if (!found())
return;
// format: <keyname> = <hex key> for hactool and similar tools
char key_chars[3] = "00";
file.write(name.c_str(), name.size());
file.write(" = ", 3);
for (u8 c : key) {
sprintf(key_chars, "%02x", c);
file.write(key_chars, 2);
}
file.write("\n", 1);
fprintf(file, "%s = ", name.c_str());
for (auto n : key)
fprintf(file, "%02x", n);
fprintf(file, "\n");
saved_key_count++;
}