diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | source/KeyCollection.cpp | 1 | ||||
-rw-r--r-- | source/KeyLocation.cpp | 15 |
4 files changed, 20 insertions, 2 deletions
@@ -32,7 +32,7 @@ include $(DEVKITPRO)/libnx/switch_rules | |||
32 | #--------------------------------------------------------------------------------- | 32 | #--------------------------------------------------------------------------------- |
33 | APP_TITLE := Lockpick | 33 | APP_TITLE := Lockpick |
34 | APP_AUTHOR := shchmue | 34 | APP_AUTHOR := shchmue |
35 | APP_VERSION := 1.2.3 | 35 | APP_VERSION := 1.2.4 |
36 | 36 | ||
37 | TARGET := $(subst $e ,_,$(notdir $(APP_TITLE))) | 37 | TARGET := $(subst $e ,_,$(notdir $(APP_TITLE))) |
38 | BUILD := build | 38 | BUILD := 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 | ||
394 | void KeyCollection::derive_keys() { | 394 | void 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); |