-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppleEffaceableStorage.h
40 lines (34 loc) · 1023 Bytes
/
AppleEffaceableStorage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
AppleEffaceableStorage
0 : getCapacity
1 : getBytes (kernel debug)
2 : setBytes (kernel debug)
3 : isFormatted
4 : format
5 : getLocker
6 : setLocker
7 : effaceLocker
8 : lockerSpace
*/
#define kAppleEffaceableStorageGetBytes 1
#define kAppleEffaceableStorageGetLocker 5
#define LOCKER_DKEY 0x446B6579
#define LOCKER_EMF 0x454D4621
#define LOCKER_BAG1 0x42414731
#define LOCKER_LWVM 0x4C77564d
struct EffaceableLocker
{
unsigned short magic; //0x4c6B = "kL"
unsigned short len;
unsigned int tag; //BAG1, EMF, Dkey, DONE
unsigned char data[1];
};
struct BAG1Locker
{
unsigned int magic;//'BAG1';
unsigned char iv[16];
unsigned char key[32];
};
int AppleEffaceableStorage__getLocker(uint32_t lockerId, uint8_t* buffer, size_t len);
int AppleEffaceableStorage__getBytes(uint8_t* buffer, size_t len);
int AppleEffaceableStorage__getLockerFromBytes(uint32_t tag, uint8_t* lockers, size_t lockers_len, uint8_t* buffer, size_t len);