@@ -47,6 +47,7 @@ char *GetFileAttribs(FSEntry_t entry){
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns 1 if a file exists, 0 if it does not
|
||||||
bool FileExists(const char* path){
|
bool FileExists(const char* path){
|
||||||
FRESULT fr;
|
FRESULT fr;
|
||||||
FILINFO fno;
|
FILINFO fno;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ void FileExplorer(char *path){
|
|||||||
res = 0;
|
res = 0;
|
||||||
|
|
||||||
res = newMenu(&entries, res, 60, 42, ENABLEB | ENABLEPAGECOUNT, (int)fileVec.count);
|
res = newMenu(&entries, res, 60, 42, ENABLEB | ENABLEPAGECOUNT, (int)fileVec.count);
|
||||||
|
vecFree(entries);
|
||||||
|
|
||||||
char *oldPath = storedPath;
|
char *oldPath = storedPath;
|
||||||
|
|
||||||
@@ -125,6 +126,7 @@ void FileExplorer(char *path){
|
|||||||
else if (res < ARR_LEN(topEntries)) {
|
else if (res < ARR_LEN(topEntries)) {
|
||||||
if (!strcmp(storedPath, path)){
|
if (!strcmp(storedPath, path)){
|
||||||
clearFileVector(&fileVec);
|
clearFileVector(&fileVec);
|
||||||
|
free(storedPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "../../utils/vector.h"
|
#include "../../utils/vector.h"
|
||||||
|
#include "../../gfx/menu.h"
|
||||||
|
#include "../fstypes.h"
|
||||||
|
|
||||||
void FileExplorer(char *path);
|
void FileExplorer(char *path);
|
||||||
|
MenuEntry_t MakeMenuOutFSEntry(FSEntry_t entry);
|
||||||
@@ -50,10 +50,21 @@ static const pkg1_id_t _pkg1_ids[] = {
|
|||||||
{ NULL } //End.
|
{ NULL } //End.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define KB_FIRMWARE_VERSION_MAX 11
|
||||||
|
|
||||||
const pkg1_id_t *pkg1_identify(u8 *pkg1)
|
const pkg1_id_t *pkg1_identify(u8 *pkg1)
|
||||||
{
|
{
|
||||||
for (u32 i = 0; _pkg1_ids[i].id; i++)
|
for (u32 i = 0; _pkg1_ids[i].id; i++)
|
||||||
if (!memcmp(pkg1 + 0x10, _pkg1_ids[i].id, 8))
|
if (!memcmp(pkg1 + 0x10, _pkg1_ids[i].id, 8))
|
||||||
return &_pkg1_ids[i];
|
return &_pkg1_ids[i];
|
||||||
|
|
||||||
|
char build_date[15];
|
||||||
|
memcpy(build_date, (char *)(pkg1 + 0x10), 14);
|
||||||
|
build_date[14] = 0;
|
||||||
|
|
||||||
|
if (*(pkg1 + 0xE) != KB_FIRMWARE_VERSION_MAX + 1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return &_pkg1_ids[ARRAY_SIZE(_pkg1_ids)-1];
|
||||||
|
}
|
||||||
|
|||||||
@@ -259,9 +259,9 @@ static ALWAYS_INLINE u8 *_read_pkg1(const pkg1_id_t **pkg1_id) {
|
|||||||
*pkg1_id = pkg1_identify(pkg1 + pk1_offset);
|
*pkg1_id = pkg1_identify(pkg1 + pk1_offset);
|
||||||
if (!*pkg1_id) {
|
if (!*pkg1_id) {
|
||||||
DPRINTF("Unknown pkg1 version.\n Make sure you have the latest Lockpick_RCM.\n If a new firmware version just came out,\n Lockpick_RCM must be updated.\n Check Github for new release.");
|
DPRINTF("Unknown pkg1 version.\n Make sure you have the latest Lockpick_RCM.\n If a new firmware version just came out,\n Lockpick_RCM must be updated.\n Check Github for new release.");
|
||||||
//gfx_hexdump(0, pkg1, 0x20);
|
//gfx_hexdump(0, pkg1 + pk1_offset, 0x20);
|
||||||
char pkg1txt[16] = {0};
|
char pkg1txt[16] = {0};
|
||||||
memcpy(pkg1txt, pkg1 + pk1_offset + 0x10, 15);
|
memcpy(pkg1txt, pkg1 + pk1_offset + 0x10, 14);
|
||||||
gfx_printf("Unknown pkg1 version\nMake sure you have the latest version of TegraExplorer\n\nPKG1: '%s'\n", pkg1txt);
|
gfx_printf("Unknown pkg1 version\nMake sure you have the latest version of TegraExplorer\n\nPKG1: '%s'\n", pkg1txt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -272,9 +272,6 @@ static ALWAYS_INLINE u8 *_read_pkg1(const pkg1_id_t **pkg1_id) {
|
|||||||
key_derivation_ctx_t __attribute__((aligned(4))) dumpedKeys = {0};
|
key_derivation_ctx_t __attribute__((aligned(4))) dumpedKeys = {0};
|
||||||
|
|
||||||
int DumpKeys(){
|
int DumpKeys(){
|
||||||
if (h_cfg.t210b01) // i'm not even attempting to dump on mariko
|
|
||||||
return 2;
|
|
||||||
|
|
||||||
const pkg1_id_t *pkg1_id;
|
const pkg1_id_t *pkg1_id;
|
||||||
u8 *pkg1 = _read_pkg1(&pkg1_id);
|
u8 *pkg1 = _read_pkg1(&pkg1_id);
|
||||||
if (!pkg1) {
|
if (!pkg1) {
|
||||||
@@ -284,6 +281,11 @@ int DumpKeys(){
|
|||||||
TConf.pkg1ID = pkg1_id->id;
|
TConf.pkg1ID = pkg1_id->id;
|
||||||
TConf.pkg1ver = (u8)pkg1_id->kb;
|
TConf.pkg1ver = (u8)pkg1_id->kb;
|
||||||
|
|
||||||
|
if (h_cfg.t210b01) {// i'm not even attempting to dump on mariko
|
||||||
|
free(pkg1);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
bool res = true;
|
bool res = true;
|
||||||
|
|
||||||
tsec_ctxt_t tsec_ctxt;
|
tsec_ctxt_t tsec_ctxt;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include <soc/bpmp.h>
|
#include <soc/bpmp.h>
|
||||||
#include <soc/hw_init.h>
|
#include <soc/hw_init.h>
|
||||||
#include "storage/emummc.h"
|
#include "storage/emummc.h"
|
||||||
#include "storage/emmc.h"
|
#include <storage/emmc.h>
|
||||||
#include <storage/sd.h>
|
#include <storage/sd.h>
|
||||||
#include <storage/sdmmc.h>
|
#include <storage/sdmmc.h>
|
||||||
#include <utils/btn.h>
|
#include <utils/btn.h>
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ void DumpSysFw(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern sdmmc_storage_t sd_storage;
|
extern sdmmc_storage_t sd_storage;
|
||||||
extern bool is_sd_inited;
|
|
||||||
|
|
||||||
MenuEntry_t FatAndEmu[] = {
|
MenuEntry_t FatAndEmu[] = {
|
||||||
{.optionUnion = COLORTORGB(COLOR_ORANGE), .name = "Back to main menu"},
|
{.optionUnion = COLORTORGB(COLOR_ORANGE), .name = "Back to main menu"},
|
||||||
@@ -135,7 +134,7 @@ void FormatSD(){
|
|||||||
bool emummc = 0;
|
bool emummc = 0;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (!is_sd_inited || sd_get_card_removed())
|
if (!sd_get_card_initialized() || sd_get_card_removed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gfx_printf("\nDo you want to partition for an emummc?\n");
|
gfx_printf("\nDo you want to partition for an emummc?\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user