Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
3b797318f5 | |||
4a320447b3 |
4
Makefile
4
Makefile
@ -9,6 +9,8 @@ IPL_LOAD_ADDR := 0x40003000
|
||||
TARGET := Lockpick_RCM
|
||||
LPVERSION_MAJOR := 1
|
||||
LPVERSION_MINOR := 1
|
||||
LPVERSION_BUGFX := 1
|
||||
|
||||
BUILD := build
|
||||
OUTPUT := output
|
||||
SOURCEDIR = source
|
||||
@ -53,7 +55,7 @@ OBJS += $(addprefix $(BUILD)/$(TARGET)/, \
|
||||
)
|
||||
|
||||
CUSTOMDEFINES := -DIPL_LOAD_ADDR=$(IPL_LOAD_ADDR)
|
||||
CUSTOMDEFINES += -DLP_VER_MJ=$(LPVERSION_MAJOR) -DLP_VER_MN=$(LPVERSION_MINOR)
|
||||
CUSTOMDEFINES += -DLP_VER_MJ=$(LPVERSION_MAJOR) -DLP_VER_MN=$(LPVERSION_MINOR) -DLP_VER_BF=$(LPVERSION_BUGFX)
|
||||
|
||||
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb-interwork
|
||||
CFLAGS = $(ARCH) -O2 -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 -Wall $(CUSTOMDEFINES)
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "../hos/sept.h"
|
||||
#include "../libs/fatfs/ff.h"
|
||||
#include "../mem/heap.h"
|
||||
#include "../mem/mc.h"
|
||||
#include "../mem/sdram.h"
|
||||
#include "../sec/se.h"
|
||||
#include "../sec/se_t210.h"
|
||||
@ -230,8 +231,8 @@ void dump_keys() {
|
||||
gfx_clear_partial_grey(0x1B, 0, 1280);
|
||||
gfx_con_setpos(0, 0);
|
||||
|
||||
gfx_printf("[%kLo%kck%kpi%kck%k-R%kCM%k v%d.%d%k]\n\n",
|
||||
colors[0], colors[1], colors[2], colors[3], colors[4], colors[5], 0xFFFF00FF, LP_VER_MJ, LP_VER_MN, 0xFFCCCCCC);
|
||||
gfx_printf("[%kLo%kck%kpi%kck%k-R%kCM%k v%d.%d.%d%k]\n\n",
|
||||
colors[0], colors[1], colors[2], colors[3], colors[4], colors[5], 0xFFFF00FF, LP_VER_MJ, LP_VER_MN, LP_VER_BF, 0xFFCCCCCC);
|
||||
|
||||
u32 start_time = get_tmr_ms(),
|
||||
end_time,
|
||||
@ -314,16 +315,20 @@ get_tsec: ;
|
||||
|
||||
int res = 0;
|
||||
|
||||
mc_disable_ahb_redirect();
|
||||
|
||||
while (tsec_query(tsec_keys, pkg1_id->kb, &tsec_ctxt) < 0) {
|
||||
memset(tsec_keys, 0x00, 0x20);
|
||||
retries++;
|
||||
if (retries > 3) {
|
||||
if (retries > 15) {
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(pkg1);
|
||||
|
||||
mc_enable_ahb_redirect();
|
||||
|
||||
if (res < 0) {
|
||||
EPRINTFARGS("ERROR %x dumping TSEC.\n", res);
|
||||
goto out_wait;
|
||||
|
@ -187,10 +187,10 @@ int tsec_query(u8 *tsec_keys, u8 kb, tsec_ctxt_t *tsec_ctxt)
|
||||
{
|
||||
smmu_flush_all();
|
||||
|
||||
if (k == se[SE_KEYTABLE_DATA0_REG_OFFSET / 4])
|
||||
continue;
|
||||
k = se[SE_KEYTABLE_DATA0_REG_OFFSET / 4];
|
||||
key[kidx++] = k;
|
||||
if (k != se[SE_KEYTABLE_DATA0_REG_OFFSET / 4]) {
|
||||
k = se[SE_KEYTABLE_DATA0_REG_OFFSET / 4];
|
||||
key[kidx++] = k;
|
||||
}
|
||||
|
||||
// Failsafe.
|
||||
if ((u32)get_tmr_us() - start > 125000)
|
||||
|
Reference in New Issue
Block a user