2016-03-03 13:27:51 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2016-04-04 22:45:49 +02:00
|
|
|
#define NAND_SYSNAND (1<<0)
|
|
|
|
#define NAND_EMUNAND (1<<1)
|
|
|
|
#define NAND_IMGNAND (1<<2)
|
2016-12-02 14:08:30 +01:00
|
|
|
#define NAND_ZERONAND (1<<3)
|
|
|
|
#define NAND_TYPE_O3DS (1<<4)
|
|
|
|
#define NAND_TYPE_N3DS (1<<5)
|
|
|
|
#define NAND_TYPE_NO3DS (1<<6)
|
2016-03-15 16:25:27 +01:00
|
|
|
|
2016-03-03 13:27:51 +01:00
|
|
|
bool InitNandCrypto(void);
|
2016-03-22 19:24:21 +01:00
|
|
|
bool CheckSlot0x05Crypto(void);
|
2016-05-15 18:16:45 +02:00
|
|
|
bool CheckSector0x96Crypto(void);
|
2016-11-15 23:12:14 +01:00
|
|
|
bool CheckA9lh(void);
|
2016-03-03 13:27:51 +01:00
|
|
|
|
2016-03-22 19:24:21 +01:00
|
|
|
void CryptNand(u8* buffer, u32 sector, u32 count, u32 keyslot);
|
2016-05-15 18:16:45 +02:00
|
|
|
void CryptSector0x96(u8* buffer, bool encrypt);
|
2016-12-02 14:08:30 +01:00
|
|
|
int ReadNandBytes(u8* buffer, u32 offset, u32 count, u32 keyslot, u32 nand_src);
|
|
|
|
int WriteNandBytes(const u8* buffer, u32 offset, u32 count, u32 keyslot, u32 nand_dst);
|
2016-04-04 22:45:49 +02:00
|
|
|
int ReadNandSectors(u8* buffer, u32 sector, u32 count, u32 keyslot, u32 src);
|
|
|
|
int WriteNandSectors(const u8* buffer, u32 sector, u32 count, u32 keyslot, u32 dest);
|
2016-03-03 13:27:51 +01:00
|
|
|
|
2016-04-04 22:45:49 +02:00
|
|
|
u64 GetNandSizeSectors(u32 src);
|
2016-04-09 21:50:50 +02:00
|
|
|
u32 CheckNandType(u32 src);
|
2016-03-15 16:25:27 +01:00
|
|
|
|
2016-03-16 18:46:05 +01:00
|
|
|
bool InitEmuNandBase(void);
|