diff --git a/arm9/src/nand/nandio.c b/arm9/src/nand/nandio.c index f457f1d..494e061 100644 --- a/arm9/src/nand/nandio.c +++ b/arm9/src/nand/nandio.c @@ -69,8 +69,11 @@ void getConsoleID(u8 *consoleID) u8 key_x[16];////key3_x - contains a DSi console id (which just happens to be the LFCS on 3ds) u8 empty_buff[8] = {0}; - - memcpy(key, fifo, 16); //receive the goods from arm7 + //receive the goods from arm7 + for(size_t i = 0; i < 16; ++i) + { + key[i] = fifo[i]; + } if(memcmp(key + 8, empty_buff, 8) == 0) { @@ -204,7 +207,7 @@ bool nandio_write_nocash_footer(NocashFooter* footer) // len is guaranteed <= CRYPT_BUF_LEN static bool write_sectors(sec_t start, sec_t len, const void *buffer) { - static u8 writeCopy[SECTOR_SIZE*16]; + static u8 writeCopy[SECTOR_SIZE*CRYPT_BUF_LEN]; memcpy(writeCopy, buffer, len * SECTOR_SIZE); dsi_nand_crypt(crypt_buf, writeCopy, start * SECTOR_SIZE / AES_BLOCK_SIZE, len * SECTOR_SIZE / AES_BLOCK_SIZE); diff --git a/arm9/src/nand/twltool/dsi.c b/arm9/src/nand/twltool/dsi.c index 1f1091c..78d0d26 100644 --- a/arm9/src/nand/twltool/dsi.c +++ b/arm9/src/nand/twltool/dsi.c @@ -53,7 +53,7 @@ void dsi_set_ctr(dsi_context* ctx, const unsigned char ctr[16]) ctx->ctr[i] = ctr[15-i]; } -void dsi_init_ctr(dsi_context* ctx, const unsigned char key[16], const unsigned char ctr[12]) +void dsi_init_ctr(dsi_context* ctx, const unsigned char key[16], const unsigned char ctr[16]) { dsi_set_key(ctx, key); dsi_set_ctr(ctx, ctr); diff --git a/arm9/src/nand/twltool/dsi.h b/arm9/src/nand/twltool/dsi.h index f170509..10e3075 100644 --- a/arm9/src/nand/twltool/dsi.h +++ b/arm9/src/nand/twltool/dsi.h @@ -33,7 +33,7 @@ void dsi_add_ctr(dsi_context* ctx, unsigned int carry); void dsi_set_ctr(dsi_context* ctx, const unsigned char ctr[16]); -void dsi_init_ctr(dsi_context* ctx, const unsigned char key[16], const unsigned char ctr[12]); +void dsi_init_ctr(dsi_context* ctx, const unsigned char key[16], const unsigned char ctr[16]); void dsi_crypt_ctr(dsi_context* ctx, const void* in, void* out, unsigned int len);