aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshchmue <shchmue@gmail.com>2019-06-16 13:09:14 -0400
committershchmue <shchmue@gmail.com>2019-06-16 13:09:14 -0400
commit31a882496f1c86a0b0c8f6fe68ac5fd091449ccc (patch)
tree17cd730736d197c0426060fc12ba9bf61292845d
parent90563f6e6360ed4853263706ed0842b94e5e2212 (diff)
v1.2.4: Support emunand FS memory layoutv1.2.4
-rw-r--r--Makefile2
-rw-r--r--changelog.md4
-rw-r--r--source/KeyCollection.cpp1
-rw-r--r--source/KeyLocation.cpp15
4 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 47e5323..4fd0cc9 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ include $(DEVKITPRO)/libnx/switch_rules
32#--------------------------------------------------------------------------------- 32#---------------------------------------------------------------------------------
33APP_TITLE := Lockpick 33APP_TITLE := Lockpick
34APP_AUTHOR := shchmue 34APP_AUTHOR := shchmue
35APP_VERSION := 1.2.3 35APP_VERSION := 1.2.4
36 36
37TARGET := $(subst $e ,_,$(notdir $(APP_TITLE))) 37TARGET := $(subst $e ,_,$(notdir $(APP_TITLE)))
38BUILD := build 38BUILD := build
diff --git a/changelog.md b/changelog.md
index adc96b4..2f9040b 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,8 @@
1# Changelog 1# Changelog
2## Version 1.2.4
3* Support new emunand FS memory layout
4* No longer save header_key if empty
5
2## Version 1.2.3 6## Version 1.2.3
3* Remove mbedtls dependency in favor of new libnx crypto library 7* Remove mbedtls dependency in favor of new libnx crypto library
4* Remove libnx 1.6.0 support since crypto requires later commit 8* Remove libnx 1.6.0 support since crypto requires later commit
diff --git a/source/KeyCollection.cpp b/source/KeyCollection.cpp
index 8c23f9a..b86856a 100644
--- a/source/KeyCollection.cpp
+++ b/source/KeyCollection.cpp
@@ -392,7 +392,6 @@ void KeyCollection::get_memory_keys() {
392} 392}
393 393
394void KeyCollection::derive_keys() { 394void KeyCollection::derive_keys() {
395 header_key = {"header_key", 0x20, {}};
396 if (header_kek_source.found() && header_key_source.found()) { 395 if (header_kek_source.found() && header_key_source.found()) {
397 u8 tempheaderkek[0x10], tempheaderkey[0x20]; 396 u8 tempheaderkek[0x10], tempheaderkey[0x20];
398 splCryptoInitialize(); 397 splCryptoInitialize();
diff --git a/source/KeyLocation.cpp b/source/KeyLocation.cpp
index ca4a513..d53c9dd 100644
--- a/source/KeyLocation.cpp
+++ b/source/KeyLocation.cpp
@@ -62,7 +62,22 @@ void KeyLocation::get_from_memory(u64 tid, u8 seg_mask) {
62 62
63 u32 page_info; 63 u32 page_info;
64 u64 addr = 0; 64 u64 addr = 0;
65 u64 last_text_addr = 0;
65 66
67 // locate "real" .text segment as Atmosphere emuNAND has two
68 for (;;) {
69 svcQueryDebugProcessMemory(&mem_info, &page_info, debug_handle, addr);
70 if ((mem_info.perm & Perm_X) &&
71 ((mem_info.type & 0xff) >= MemType_CodeStatic) &&
72 ((mem_info.type & 0xff) < MemType_Heap))
73 {
74 last_text_addr = mem_info.addr;
75 }
76 addr = mem_info.addr + mem_info.size;
77 if (addr == 0) break;
78 }
79
80 addr = last_text_addr;
66 for (u8 segment = 1; segment < BIT(3); ) 81 for (u8 segment = 1; segment < BIT(3); )
67 { 82 {
68 svcQueryDebugProcessMemory(&mem_info, &page_info, debug_handle, addr); 83 svcQueryDebugProcessMemory(&mem_info, &page_info, debug_handle, addr);