10static void _printf2(
const char *format, ...);
15static void _printf2(
const char *format, ...){
21void store_kbit(
void *buffer,
const void *kbit)
29 if (((header->
flags) & 1) != 0)
30 offset += ((
unsigned char *)buffer)[offset] + 1;
31 if (((header->
flags) & 0xF000) == 0)
34 kbit_offset = (u8 *)buffer + offset;
35 memcpy((
void *)kbit_offset, kbit, 16);
36 _printf2(
"kbit_offset: %p\n", kbit_offset);
40void store_kc(
void *buffer,
const void *kc)
48 if (((header->
flags) & 1) != 0)
49 offset += ((
unsigned char *)buffer)[offset] + 1;
50 if (((header->
flags) & 0xF000) == 0)
53 kc_offset = (u8 *)buffer + offset + 0x10;
54 memcpy((
void *)kc_offset, kc, 16);
55 _printf2(
"kc_offset: %p\n", kc_offset);
59void get_Kbit(
const void *buffer,
void *Kbit)
67 if (((header->
flags) & 1) != 0)
68 offset += ((
unsigned char *)buffer)[offset] + 1;
69 if (((header->
flags) & 0xF000) == 0)
72 kbit_offset = (u8 *)buffer + offset;
73 memcpy(Kbit, (
void *)kbit_offset, 16);
74 _printf2(
"kbit_offset: %p\n", kbit_offset);
78void get_Kc(
const void *buffer,
void *Kc)
86 if (((header->
flags) & 1) != 0)
87 offset += ((
unsigned char *)buffer)[offset] + 1;
88 if (((header->
flags) & 0xF000) == 0)
91 kc_offset = (u8 *)buffer + offset + 0x10;
92 memcpy(Kc, (
void *)kc_offset, 16);
93 _printf2(
"kc_offset: %p\n", kc_offset);
97void get_icvps2(
const void *buffer,
void *icvps2)
101 pICVPS2 = (u8 *)buffer + ((
SecrKELFHeader_t *)buffer)->KELF_header_size - 8;
102 memcpy(icvps2, (
void *)pICVPS2, 8);
103 _printf2(
"icvps2_offset %p\n", pICVPS2);
107void store_icvps2(
void *buffer,
const void *icvps2)
111 pICVPS2 = (u8 *)buffer + ((
SecrKELFHeader_t *)buffer)->KELF_header_size - 8;
112 memcpy((
void *)pICVPS2, icvps2, 8);
113 _printf2(
"icvps2_offset %p\n", pICVPS2);
struct KELF_Header SecrKELFHeader_t
struct SecrBitBlockData SecrBitBlockData_t