Skip to content

Commit

Permalink
v1.6 (and like always, tranfer unmerged PRs)
Browse files Browse the repository at this point in the history
  • Loading branch information
CTCaer committed May 24, 2018
1 parent d8f9b64 commit 1c43391
Show file tree
Hide file tree
Showing 7 changed files with 2,291 additions and 8 deletions.
2,256 changes: 2,256 additions & 0 deletions ipl/ctc_logo2.h

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions ipl/gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,16 @@ void gfx_line(gfx_ctxt_t *ctxt, int x0, int y0, int x1, int y1, u32 color)
if (e2 < dy) { err += dx; y0 += sy; }
}
}

void gfx_set_logo(gfx_ctxt_t *ctxt, const u8 *buf)
{
u32 pos = 0;
for (u32 y = 1180; y < 1256; y++)
{
for (u32 x = 538; x < 696; x++)
{
ctxt->fb[x + y*ctxt->stride] = (0xFF << 24) | buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16);
pos+=3;
}
}
}
1 change: 1 addition & 0 deletions ipl/gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ void gfx_hexdump(gfx_con_t *con, u32 base, const u8 *buf, u32 len);

void gfx_set_pixel(gfx_ctxt_t *ctxt, u32 x, u32 y, u32 color);
void gfx_line(gfx_ctxt_t *ctxt, int x0, int y0, int x1, int y1, u32 color);
void gfx_set_logo(gfx_ctxt_t *ctxt, const u8 *buf);

#endif
21 changes: 15 additions & 6 deletions ipl/hos.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,21 @@ DPRINTF("decrypted and unpacked pkg1\n");

se_aes_key_clear(8);
se_aes_key_clear(11);
//se_aes_key_clear(13);
//se_key_acc_ctrl(10, 0xFF);
se_key_acc_ctrl(12, 0xFF);
//se_key_acc_ctrl(13, 0xFF);
//se_key_acc_ctrl(14, 0xFF);
se_key_acc_ctrl(15, 0xFF);

switch (ctxt.pkg1_id->kb) {
case KB_FIRMWARE_VERSION_100_200:
case KB_FIRMWARE_VERSION_300:
case KB_FIRMWARE_VERSION_301:
se_key_acc_ctrl(12, 0xFF);
se_key_acc_ctrl(13, 0xFF);
break;
default:
case KB_FIRMWARE_VERSION_400:
case KB_FIRMWARE_VERSION_500:
se_key_acc_ctrl(12, 0xFF);
se_key_acc_ctrl(15, 0xFF);
break;
}

//Clear 'BootConfig'.
memset((void *)0x4003D000, 0, 0x3000);
Expand Down
2 changes: 1 addition & 1 deletion ipl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ ment_t ment_top[] = {
};
menu_t menu_top = {
ment_top,
"hekate - ipl", 0, 0
"hekate - ipl (CTCaer mod v1.6)", 0, 0
};

extern void pivot_stack(u32 stack_top);
Expand Down
3 changes: 2 additions & 1 deletion ipl/pkg1.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ PATCHSET_DEF(_secmon_2_patchset,

PATCHSET_DEF(_secmon_3_patchset,
//Patch package2 decryption and signature/hash checks.
{ 0xAC8 + 0xAB4, _NOP() },
{ 0xAC8 + 0xA30, _NOP() }, //Header signature.
{ 0xAC8 + 0xAC0, _NOP() }, //Version.
{ 0xAC8 + 0xADC, _NOP() } //Sections SHA2.
Expand Down Expand Up @@ -78,7 +79,7 @@ PATCHSET_DEF(_secmon_6_patchset,
static const pkg1_id_t _pkg1_ids[] = {
{ "20161121183008", 0, 0x1900, 0x3FE0, { 2, 1, 0 }, 0x40014020, _secmon_1_patchset }, //1.0.0
{ "20170210155124", 0, 0x1900, 0x3FE0, { 0, 1, 2 }, 0x4002D000, _secmon_2_patchset }, //2.0.0
{ "20170519101410", 1, 0x1A00, 0x3FE0, { 0, 1, 2 }, 0x4002D000, NULL }, //3.0.0
{ "20170519101410", 1, 0x1A00, 0x3FE0, { 0, 1, 2 }, 0x4002D000, _secmon_3_patchset }, //3.0.0
{ "20170710161758", 2, 0x1A00, 0x3FE0, { 0, 1, 2 }, 0x4002D000, NULL }, //3.0.1
{ "20170921172629", 3, 0x1800, 0x3FE0, { 1, 2, 0 }, 0x4002B000, _secmon_5_patchset }, //4.0.0
{ "20180220163747", 4, 0x1900, 0x3FE0, { 1, 2, 0 }, 0x4002B000, _secmon_6_patchset }, //5.0.0
Expand Down
3 changes: 3 additions & 0 deletions ipl/tui.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "tui.h"
#include "btn.h"
#include "ctc_logo2.h"

void tui_pbar(gfx_con_t *con, int x, int y, u32 val)
{
Expand Down Expand Up @@ -44,6 +45,7 @@ void *tui_do_menu(gfx_con_t *con, menu_t *menu)
int prev_idx = 0;

gfx_clear(con->gfx_ctxt, 0xFF1B1B1B);
gfx_set_logo(con->gfx_ctxt, Kc_HEKATE_LOGO);

while (1)
{
Expand Down Expand Up @@ -125,6 +127,7 @@ void *tui_do_menu(gfx_con_t *con, menu_t *menu)
break;
}
gfx_clear(con->gfx_ctxt, 0xFF1B1B1B);
gfx_set_logo(con->gfx_ctxt, Kc_HEKATE_LOGO);
}
}

Expand Down

0 comments on commit 1c43391

Please sign in to comment.