From 664006329180065b5621e707c362e14019b5f891 Mon Sep 17 00:00:00 2001 From: wwylele Date: Wed, 26 Apr 2017 08:53:59 +0300 Subject: [PATCH] dump shared font archive --- source/main.cpp | 2 - source/utils/savedatacheck/savedatacheck.cpp | 5 +- source/utils/shared_font/shared_font.cpp | 62 -------------------- source/utils/shared_font/shared_font.h | 11 ---- 4 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 source/utils/shared_font/shared_font.cpp delete mode 100644 source/utils/shared_font/shared_font.h diff --git a/source/main.cpp b/source/main.cpp index 62d9026..9034b9b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -6,12 +6,10 @@ #include #include <3ds.h> -#include "utils/shared_font/shared_font.h" #include "utils/savedatacheck/savedatacheck.h" static unsigned int util_counter = 0; static void (*utils[]) (void) = { - SharedFont::Dump, SaveDataCheck::Dump, }; diff --git a/source/utils/savedatacheck/savedatacheck.cpp b/source/utils/savedatacheck/savedatacheck.cpp index eb4d4bf..b8da594 100644 --- a/source/utils/savedatacheck/savedatacheck.cpp +++ b/source/utils/savedatacheck/savedatacheck.cpp @@ -9,7 +9,6 @@ #include <3ds.h> #include "fs_common.h" -#include "utils/shared_font/shared_font.h" #define TITLE_PATH "/3dsutils/nand/00000000000000000000000000000000/title/" @@ -75,6 +74,10 @@ void Dump() { // savedatacheck/0004009b00010402.bin u64 binary_lowpath_0004009b00010402[] = { 0x0004009b00010402, 0x00000001ffffff00 }; DumpSharedRomFS((u32*)binary_lowpath_0004009b00010402); + + // savedatacheck/0004009b00014002.bin + u64 binary_lowpath_0004009b00014002[] = { 0x0004009b00014002, 0x00000001ffffff00 }; + DumpSharedRomFS((u32*)binary_lowpath_0004009b00014002); } } // namespace diff --git a/source/utils/shared_font/shared_font.cpp b/source/utils/shared_font/shared_font.cpp deleted file mode 100644 index 881c731..0000000 --- a/source/utils/shared_font/shared_font.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -#include - -#include <3ds.h> - -#include "fs_common.h" -#include "utils/shared_font/shared_font.h" - -#define SYSDATA_PATH "/3dsutils/sysdata/" - -namespace SharedFont { - -static const u32 SHARED_FONT_SIZE = 0x300000; - -void Dump() { - if (!CreateFullPath(SYSDATA_PATH)) { - printf("Creating path (%s) failed! Aborting!\n", SYSDATA_PATH); - return; - } - std::string path = SYSDATA_PATH "/shared_font.bin"; - SanitizeSeparators(&path); - - printf("Dumping shared system font (%s)... ", path.c_str()); - - // Connect to APT service... - - Handle apt_handle; - srvGetServiceHandle(&apt_handle, "APT:U"); - u32* cmdbuf = getThreadCommandBuffer(); - - // Call APT::GetSharedFont function to load font into memory... - - cmdbuf[0] = 0x00440000; - svcSendSyncRequest(apt_handle); - - Handle mem_handle = cmdbuf[4]; - void* shared_font_addr = reinterpret_cast(cmdbuf[2]); - - // Close APT handle... - - svcCloseHandle(apt_handle); - - // Map shared font memory... - - svcMapMemoryBlock(mem_handle, 0, MEMPERM_READ, MEMPERM_DONTCARE); - - // Dump shared font to SDMC... - - FILE* out_file = fopen(path.c_str(), "wb"); - size_t bytes_written = fwrite(shared_font_addr, 1, SHARED_FONT_SIZE, out_file); - fclose(out_file); - - if (bytes_written == SHARED_FONT_SIZE) - printf("Done!\n"); - else - printf("Failed!\n"); -} - -} // namespace diff --git a/source/utils/shared_font/shared_font.h b/source/utils/shared_font/shared_font.h deleted file mode 100644 index a733d22..0000000 --- a/source/utils/shared_font/shared_font.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -#pragma once - -namespace SharedFont { - -void Dump(); - -}