mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-21 23:48:22 +08:00
Switch to C++11 for Kaitai-generated parsers
This commit is contained in:
parent
255742f371
commit
75bf036137
@ -541,7 +541,7 @@ USTATUS FitParser::parseFitEntryBootGuardKeyManifest(const UByteArray & keyManif
|
|||||||
else {
|
else {
|
||||||
kmInfo += UString("KM Hashes:\n");
|
kmInfo += UString("KM Hashes:\n");
|
||||||
for (UINT16 i = 0; i < parsed.num_km_hashes(); i++) {
|
for (UINT16 i = 0; i < parsed.num_km_hashes(); i++) {
|
||||||
intel_keym_v2_t::km_hash_t* current_km_hash = parsed.km_hashes()->at(i);
|
const auto & current_km_hash = parsed.km_hashes()->at(i);
|
||||||
|
|
||||||
// Add KM hash
|
// Add KM hash
|
||||||
kmInfo += usprintf("UsageFlags: %016" PRIX64 "h, ", current_km_hash->usage_flags()) + hashTypeToUString(current_km_hash->hash_algorithm_id()) + ": ";
|
kmInfo += usprintf("UsageFlags: %016" PRIX64 "h, ", current_km_hash->usage_flags()) + hashTypeToUString(current_km_hash->hash_algorithm_id()) + ": ";
|
||||||
@ -660,9 +660,8 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
parsed.nem_data_size());
|
parsed.nem_data_size());
|
||||||
|
|
||||||
bpInfo += UString("Boot Policy Elements:\n");
|
bpInfo += UString("Boot Policy Elements:\n");
|
||||||
const std::vector<intel_acbp_v1_t::acbp_element_t*>* elements = parsed.elements();
|
for (const auto & element : *parsed.elements()) {
|
||||||
for (intel_acbp_v1_t::acbp_element_t* element : *elements) {
|
const auto & element_header = element->header();
|
||||||
const intel_acbp_v1_t::common_header_t* element_header = element->header();
|
|
||||||
|
|
||||||
UINT64 structure_id = (UINT64) element_header->structure_id();
|
UINT64 structure_id = (UINT64) element_header->structure_id();
|
||||||
const char* structure_id_bytes = (const char*)&structure_id;
|
const char* structure_id_bytes = (const char*)&structure_id;
|
||||||
@ -742,7 +741,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
else {
|
else {
|
||||||
bpInfo += UString("IBB Segments:\n");
|
bpInfo += UString("IBB Segments:\n");
|
||||||
for (UINT8 i = 0; i < ibbs_body->num_ibb_segments(); i++) {
|
for (UINT8 i = 0; i < ibbs_body->num_ibb_segments(); i++) {
|
||||||
const intel_acbp_v1_t::ibb_segment_t* current_segment = ibbs_body->ibb_segments()->at(i);
|
const auto & current_segment = ibbs_body->ibb_segments()->at(i);
|
||||||
|
|
||||||
bpInfo += usprintf("Flags: %04Xh, Address: %08Xh, Size: %08Xh\n",
|
bpInfo += usprintf("Flags: %04Xh, Address: %08Xh, Size: %08Xh\n",
|
||||||
current_segment->flags(),
|
current_segment->flags(),
|
||||||
@ -780,7 +779,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
// v1 entries
|
// v1 entries
|
||||||
if (pmda_body->_is_null_entries_v1() == false) {
|
if (pmda_body->_is_null_entries_v1() == false) {
|
||||||
for (UINT32 i = 0; i < pmda_body->num_entries(); i++) {
|
for (UINT32 i = 0; i < pmda_body->num_entries(); i++) {
|
||||||
const intel_acbp_v1_t::pmda_entry_v1_t* current_element = pmda_body->entries_v1()->at(i);
|
const auto & current_element = pmda_body->entries_v1()->at(i);
|
||||||
|
|
||||||
// Add element
|
// Add element
|
||||||
bpInfo += usprintf("Address: %08Xh, Size: %08Xh\n",
|
bpInfo += usprintf("Address: %08Xh, Size: %08Xh\n",
|
||||||
@ -809,7 +808,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
// v2 entries
|
// v2 entries
|
||||||
else if (pmda_body->_is_null_entries_v2() == false) {
|
else if (pmda_body->_is_null_entries_v2() == false) {
|
||||||
for (UINT32 i = 0; i < pmda_body->num_entries(); i++) {
|
for (UINT32 i = 0; i < pmda_body->num_entries(); i++) {
|
||||||
const intel_acbp_v1_t::pmda_entry_v2_t* current_element = pmda_body->entries_v2()->at(i);
|
const auto & current_element = pmda_body->entries_v2()->at(i);
|
||||||
|
|
||||||
// Add element
|
// Add element
|
||||||
bpInfo += usprintf("Address: %08Xh, Size: %08Xh\n",
|
bpInfo += usprintf("Address: %08Xh, Size: %08Xh\n",
|
||||||
@ -930,8 +929,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
parsed.nem_data_size());
|
parsed.nem_data_size());
|
||||||
|
|
||||||
bpInfo += UString("Boot Policy Elements:\n");
|
bpInfo += UString("Boot Policy Elements:\n");
|
||||||
const std::vector<intel_acbp_v2_t::acbp_element_t*>* elements = parsed.elements();
|
for (const auto & element : *parsed.elements()) {
|
||||||
for (intel_acbp_v2_t::acbp_element_t* element : *elements) {
|
|
||||||
const intel_acbp_v2_t::header_t* element_header = element->header();
|
const intel_acbp_v2_t::header_t* element_header = element->header();
|
||||||
|
|
||||||
UINT64 structure_id = element_header->structure_id();
|
UINT64 structure_id = element_header->structure_id();
|
||||||
@ -1041,7 +1039,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
else {
|
else {
|
||||||
bpInfo += UString("IBB Hashes:\n");
|
bpInfo += UString("IBB Hashes:\n");
|
||||||
for (UINT16 i = 0; i < ibbs_body->num_ibb_digests(); i++) {
|
for (UINT16 i = 0; i < ibbs_body->num_ibb_digests(); i++) {
|
||||||
const intel_acbp_v2_t::hash_t* current_hash = ibbs_body->ibb_digests()->at(i);
|
const auto & current_hash = ibbs_body->ibb_digests()->at(i);
|
||||||
bpInfo += hashTypeToUString(current_hash->hash_algorithm_id()) + ": ";
|
bpInfo += hashTypeToUString(current_hash->hash_algorithm_id()) + ": ";
|
||||||
for (UINT16 j = 0; j < current_hash->len_hash(); j++) {
|
for (UINT16 j = 0; j < current_hash->len_hash(); j++) {
|
||||||
bpInfo += usprintf("%02X", (UINT8)current_hash->hash().data()[j]);
|
bpInfo += usprintf("%02X", (UINT8)current_hash->hash().data()[j]);
|
||||||
@ -1058,7 +1056,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
else {
|
else {
|
||||||
bpInfo += UString("IBB Segments:\n");
|
bpInfo += UString("IBB Segments:\n");
|
||||||
for (UINT8 i = 0; i < ibbs_body->num_ibb_segments(); i++) {
|
for (UINT8 i = 0; i < ibbs_body->num_ibb_segments(); i++) {
|
||||||
const intel_acbp_v2_t::ibb_segment_t* current_segment = ibbs_body->ibb_segments()->at(i);
|
const auto & current_segment = ibbs_body->ibb_segments()->at(i);
|
||||||
|
|
||||||
bpInfo += usprintf("Flags: %04Xh, Address: %08Xh, Size: %08Xh\n",
|
bpInfo += usprintf("Flags: %04Xh, Address: %08Xh, Size: %08Xh\n",
|
||||||
current_segment->flags(),
|
current_segment->flags(),
|
||||||
@ -1095,7 +1093,7 @@ USTATUS FitParser::parseFitEntryBootGuardBootPolicy(const UByteArray & bootPolic
|
|||||||
else {
|
else {
|
||||||
bpInfo += UString("PMDA Entries:\n");
|
bpInfo += UString("PMDA Entries:\n");
|
||||||
for (UINT32 i = 0; i < pmda_body->num_entries(); i++) {
|
for (UINT32 i = 0; i < pmda_body->num_entries(); i++) {
|
||||||
const intel_acbp_v2_t::pmda_entry_v3_t* current_entry = pmda_body->entries()->at(i);
|
const auto & current_entry = pmda_body->entries()->at(i);
|
||||||
|
|
||||||
UINT64 entry_id = current_entry->entry_id();
|
UINT64 entry_id = current_entry->entry_id();
|
||||||
const char* entry_id_bytes = (const char*)&entry_id;
|
const char* entry_id_bytes = (const char*)&entry_id;
|
||||||
|
@ -6,24 +6,18 @@
|
|||||||
ami_nvar_t::ami_nvar_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
ami_nvar_t::ami_nvar_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = this; (void)p__root;
|
m__root = this; (void)p__root;
|
||||||
m_entries = 0;
|
m_entries = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::_read() {
|
void ami_nvar_t::_read() {
|
||||||
m_entries = new std::vector<nvar_entry_t*>();
|
m_entries = std::unique_ptr<std::vector<std::unique_ptr<nvar_entry_t>>>(new std::vector<std::unique_ptr<nvar_entry_t>>());
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
nvar_entry_t* _;
|
nvar_entry_t* _;
|
||||||
do {
|
do {
|
||||||
_ = new nvar_entry_t(m__io, this, m__root);
|
_ = new nvar_entry_t(m__io, this, m__root);
|
||||||
m_entries->push_back(_);
|
m_entries->push_back(std::move(std::unique_ptr<nvar_entry_t>(_)));
|
||||||
i++;
|
i++;
|
||||||
} while (!( ((_->signature_first() != 78) || (_io()->is_eof())) ));
|
} while (!( ((_->signature_first() != 78) || (_io()->is_eof())) ));
|
||||||
}
|
}
|
||||||
@ -34,24 +28,12 @@ ami_nvar_t::~ami_nvar_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::_clean_up() {
|
void ami_nvar_t::_clean_up() {
|
||||||
if (m_entries) {
|
|
||||||
for (std::vector<nvar_entry_t*>::iterator it = m_entries->begin(); it != m_entries->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_entries; m_entries = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ami_nvar_t::nvar_attributes_t::nvar_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
ami_nvar_t::nvar_attributes_t::nvar_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::nvar_attributes_t::_read() {
|
void ami_nvar_t::nvar_attributes_t::_read() {
|
||||||
@ -75,18 +57,12 @@ void ami_nvar_t::nvar_attributes_t::_clean_up() {
|
|||||||
ami_nvar_t::ucs2_string_t::ucs2_string_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
ami_nvar_t::ucs2_string_t::ucs2_string_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_ucs2_chars = 0;
|
m_ucs2_chars = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::ucs2_string_t::_read() {
|
void ami_nvar_t::ucs2_string_t::_read() {
|
||||||
m_ucs2_chars = new std::vector<uint16_t>();
|
m_ucs2_chars = std::unique_ptr<std::vector<uint16_t>>(new std::vector<uint16_t>());
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
uint16_t _;
|
uint16_t _;
|
||||||
@ -103,21 +79,12 @@ ami_nvar_t::ucs2_string_t::~ucs2_string_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::ucs2_string_t::_clean_up() {
|
void ami_nvar_t::ucs2_string_t::_clean_up() {
|
||||||
if (m_ucs2_chars) {
|
|
||||||
delete m_ucs2_chars; m_ucs2_chars = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ami_nvar_t::nvar_extended_attributes_t::nvar_extended_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
ami_nvar_t::nvar_extended_attributes_t::nvar_extended_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::nvar_extended_attributes_t::_read() {
|
void ami_nvar_t::nvar_extended_attributes_t::_read() {
|
||||||
@ -138,18 +105,12 @@ void ami_nvar_t::nvar_extended_attributes_t::_clean_up() {
|
|||||||
ami_nvar_t::nvar_entry_t::nvar_entry_t(kaitai::kstream* p__io, ami_nvar_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
ami_nvar_t::nvar_entry_t::nvar_entry_t(kaitai::kstream* p__io, ami_nvar_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_attributes = 0;
|
m_attributes = nullptr;
|
||||||
m_body = 0;
|
m_body = nullptr;
|
||||||
m__io__raw_body = 0;
|
m__io__raw_body = nullptr;
|
||||||
f_offset = false;
|
f_offset = false;
|
||||||
f_end_offset = false;
|
f_end_offset = false;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::nvar_entry_t::_read() {
|
void ami_nvar_t::nvar_entry_t::_read() {
|
||||||
@ -187,14 +148,14 @@ void ami_nvar_t::nvar_entry_t::_read() {
|
|||||||
n_attributes = true;
|
n_attributes = true;
|
||||||
if (signature_first() == 78) {
|
if (signature_first() == 78) {
|
||||||
n_attributes = false;
|
n_attributes = false;
|
||||||
m_attributes = new nvar_attributes_t(m__io, this, m__root);
|
m_attributes = std::unique_ptr<nvar_attributes_t>(new nvar_attributes_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_body = true;
|
n_body = true;
|
||||||
if (signature_first() == 78) {
|
if (signature_first() == 78) {
|
||||||
n_body = false;
|
n_body = false;
|
||||||
m__raw_body = m__io->read_bytes((size() - ((4 + 2) + 4)));
|
m__raw_body = m__io->read_bytes((size() - ((4 + 2) + 4)));
|
||||||
m__io__raw_body = new kaitai::kstream(m__raw_body);
|
m__io__raw_body = std::unique_ptr<kaitai::kstream>(new kaitai::kstream(m__raw_body));
|
||||||
m_body = new nvar_entry_body_t(m__io__raw_body, this, m__root);
|
m_body = std::unique_ptr<nvar_entry_body_t>(new nvar_entry_body_t(m__io__raw_body.get(), this, m__root));
|
||||||
}
|
}
|
||||||
n_invoke_end_offset = true;
|
n_invoke_end_offset = true;
|
||||||
if ( ((signature_first() == 78) && (end_offset() >= 0)) ) {
|
if ( ((signature_first() == 78) && (end_offset() >= 0)) ) {
|
||||||
@ -217,17 +178,8 @@ void ami_nvar_t::nvar_entry_t::_clean_up() {
|
|||||||
if (!n_next) {
|
if (!n_next) {
|
||||||
}
|
}
|
||||||
if (!n_attributes) {
|
if (!n_attributes) {
|
||||||
if (m_attributes) {
|
|
||||||
delete m_attributes; m_attributes = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_body) {
|
if (!n_body) {
|
||||||
if (m__io__raw_body) {
|
|
||||||
delete m__io__raw_body; m__io__raw_body = 0;
|
|
||||||
}
|
|
||||||
if (m_body) {
|
|
||||||
delete m_body; m_body = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_invoke_end_offset) {
|
if (!n_invoke_end_offset) {
|
||||||
}
|
}
|
||||||
@ -236,7 +188,7 @@ void ami_nvar_t::nvar_entry_t::_clean_up() {
|
|||||||
int32_t ami_nvar_t::nvar_entry_t::offset() {
|
int32_t ami_nvar_t::nvar_entry_t::offset() {
|
||||||
if (f_offset)
|
if (f_offset)
|
||||||
return m_offset;
|
return m_offset;
|
||||||
m_offset = _io()->pos();
|
m_offset = (int32_t)_io()->pos();
|
||||||
f_offset = true;
|
f_offset = true;
|
||||||
return m_offset;
|
return m_offset;
|
||||||
}
|
}
|
||||||
@ -244,7 +196,7 @@ int32_t ami_nvar_t::nvar_entry_t::offset() {
|
|||||||
int32_t ami_nvar_t::nvar_entry_t::end_offset() {
|
int32_t ami_nvar_t::nvar_entry_t::end_offset() {
|
||||||
if (f_end_offset)
|
if (f_end_offset)
|
||||||
return m_end_offset;
|
return m_end_offset;
|
||||||
m_end_offset = _io()->pos();
|
m_end_offset = (int32_t)_io()->pos();
|
||||||
f_end_offset = true;
|
f_end_offset = true;
|
||||||
return m_end_offset;
|
return m_end_offset;
|
||||||
}
|
}
|
||||||
@ -252,8 +204,8 @@ int32_t ami_nvar_t::nvar_entry_t::end_offset() {
|
|||||||
ami_nvar_t::nvar_entry_body_t::nvar_entry_body_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
ami_nvar_t::nvar_entry_body_t::nvar_entry_body_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent, ami_nvar_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_ucs2_name = 0;
|
m_ucs2_name = nullptr;
|
||||||
m_extended_header_attributes = 0;
|
m_extended_header_attributes = nullptr;
|
||||||
f_extended_header_attributes = false;
|
f_extended_header_attributes = false;
|
||||||
f_data_start_offset = false;
|
f_data_start_offset = false;
|
||||||
f_extended_header_size_field = false;
|
f_extended_header_size_field = false;
|
||||||
@ -263,13 +215,7 @@ ami_nvar_t::nvar_entry_body_t::nvar_entry_body_t(kaitai::kstream* p__io, ami_nva
|
|||||||
f_data_end_offset = false;
|
f_data_end_offset = false;
|
||||||
f_extended_header_size = false;
|
f_extended_header_size = false;
|
||||||
f_extended_header_hash = false;
|
f_extended_header_hash = false;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_nvar_t::nvar_entry_body_t::_read() {
|
void ami_nvar_t::nvar_entry_body_t::_read() {
|
||||||
@ -291,7 +237,7 @@ void ami_nvar_t::nvar_entry_body_t::_read() {
|
|||||||
n_ucs2_name = true;
|
n_ucs2_name = true;
|
||||||
if ( ((!(_parent()->attributes()->ascii_name())) && (!(_parent()->attributes()->data_only())) && (_parent()->attributes()->valid())) ) {
|
if ( ((!(_parent()->attributes()->ascii_name())) && (!(_parent()->attributes()->data_only())) && (_parent()->attributes()->valid())) ) {
|
||||||
n_ucs2_name = false;
|
n_ucs2_name = false;
|
||||||
m_ucs2_name = new ucs2_string_t(m__io, this, m__root);
|
m_ucs2_name = std::unique_ptr<ucs2_string_t>(new ucs2_string_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_invoke_data_start = true;
|
n_invoke_data_start = true;
|
||||||
if (data_start_offset() >= 0) {
|
if (data_start_offset() >= 0) {
|
||||||
@ -313,16 +259,10 @@ void ami_nvar_t::nvar_entry_body_t::_clean_up() {
|
|||||||
if (!n_ascii_name) {
|
if (!n_ascii_name) {
|
||||||
}
|
}
|
||||||
if (!n_ucs2_name) {
|
if (!n_ucs2_name) {
|
||||||
if (m_ucs2_name) {
|
|
||||||
delete m_ucs2_name; m_ucs2_name = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_invoke_data_start) {
|
if (!n_invoke_data_start) {
|
||||||
}
|
}
|
||||||
if (f_extended_header_attributes && !n_extended_header_attributes) {
|
if (f_extended_header_attributes && !n_extended_header_attributes) {
|
||||||
if (m_extended_header_attributes) {
|
|
||||||
delete m_extended_header_attributes; m_extended_header_attributes = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (f_extended_header_size_field && !n_extended_header_size_field) {
|
if (f_extended_header_size_field && !n_extended_header_size_field) {
|
||||||
}
|
}
|
||||||
@ -336,23 +276,23 @@ void ami_nvar_t::nvar_entry_body_t::_clean_up() {
|
|||||||
|
|
||||||
ami_nvar_t::nvar_extended_attributes_t* ami_nvar_t::nvar_entry_body_t::extended_header_attributes() {
|
ami_nvar_t::nvar_extended_attributes_t* ami_nvar_t::nvar_entry_body_t::extended_header_attributes() {
|
||||||
if (f_extended_header_attributes)
|
if (f_extended_header_attributes)
|
||||||
return m_extended_header_attributes;
|
return m_extended_header_attributes.get();
|
||||||
n_extended_header_attributes = true;
|
n_extended_header_attributes = true;
|
||||||
if ( ((_parent()->attributes()->valid()) && (_parent()->attributes()->extended_header()) && (extended_header_size() >= (1 + 2))) ) {
|
if ( ((_parent()->attributes()->valid()) && (_parent()->attributes()->extended_header()) && (extended_header_size() >= (1 + 2))) ) {
|
||||||
n_extended_header_attributes = false;
|
n_extended_header_attributes = false;
|
||||||
std::streampos _pos = m__io->pos();
|
std::streampos _pos = m__io->pos();
|
||||||
m__io->seek((_io()->pos() - extended_header_size()));
|
m__io->seek((_io()->pos() - extended_header_size()));
|
||||||
m_extended_header_attributes = new nvar_extended_attributes_t(m__io, this, m__root);
|
m_extended_header_attributes = std::unique_ptr<nvar_extended_attributes_t>(new nvar_extended_attributes_t(m__io, this, m__root));
|
||||||
m__io->seek(_pos);
|
m__io->seek(_pos);
|
||||||
f_extended_header_attributes = true;
|
f_extended_header_attributes = true;
|
||||||
}
|
}
|
||||||
return m_extended_header_attributes;
|
return m_extended_header_attributes.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ami_nvar_t::nvar_entry_body_t::data_start_offset() {
|
int32_t ami_nvar_t::nvar_entry_body_t::data_start_offset() {
|
||||||
if (f_data_start_offset)
|
if (f_data_start_offset)
|
||||||
return m_data_start_offset;
|
return m_data_start_offset;
|
||||||
m_data_start_offset = _io()->pos();
|
m_data_start_offset = (int32_t)_io()->pos();
|
||||||
f_data_start_offset = true;
|
f_data_start_offset = true;
|
||||||
return m_data_start_offset;
|
return m_data_start_offset;
|
||||||
}
|
}
|
||||||
@ -413,7 +353,7 @@ uint8_t ami_nvar_t::nvar_entry_body_t::extended_header_checksum() {
|
|||||||
int32_t ami_nvar_t::nvar_entry_body_t::data_end_offset() {
|
int32_t ami_nvar_t::nvar_entry_body_t::data_end_offset() {
|
||||||
if (f_data_end_offset)
|
if (f_data_end_offset)
|
||||||
return m_data_end_offset;
|
return m_data_end_offset;
|
||||||
m_data_end_offset = _io()->pos();
|
m_data_end_offset = (int32_t)_io()->pos();
|
||||||
f_data_end_offset = true;
|
f_data_end_offset = true;
|
||||||
return m_data_end_offset;
|
return m_data_end_offset;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef AMI_NVAR_H_
|
#pragma once
|
||||||
#define AMI_NVAR_H_
|
|
||||||
|
|
||||||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||||
|
|
||||||
#include "../kaitai/kaitaistruct.h"
|
#include "../kaitai/kaitaistruct.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if KAITAI_STRUCT_VERSION < 9000L
|
#if KAITAI_STRUCT_VERSION < 9000L
|
||||||
@ -20,7 +20,7 @@ public:
|
|||||||
class nvar_entry_t;
|
class nvar_entry_t;
|
||||||
class nvar_entry_body_t;
|
class nvar_entry_body_t;
|
||||||
|
|
||||||
ami_nvar_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, ami_nvar_t* p__root = 0);
|
ami_nvar_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, ami_nvar_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
nvar_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent = 0, ami_nvar_t* p__root = 0);
|
nvar_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent = nullptr, ami_nvar_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ucs2_string_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent = 0, ami_nvar_t* p__root = 0);
|
ucs2_string_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent = nullptr, ami_nvar_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -81,12 +81,12 @@ public:
|
|||||||
~ucs2_string_t();
|
~ucs2_string_t();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<uint16_t>* m_ucs2_chars;
|
std::unique_ptr<std::vector<uint16_t>> m_ucs2_chars;
|
||||||
ami_nvar_t* m__root;
|
ami_nvar_t* m__root;
|
||||||
ami_nvar_t::nvar_entry_body_t* m__parent;
|
ami_nvar_t::nvar_entry_body_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::vector<uint16_t>* ucs2_chars() const { return m_ucs2_chars; }
|
std::vector<uint16_t>* ucs2_chars() const { return m_ucs2_chars.get(); }
|
||||||
ami_nvar_t* _root() const { return m__root; }
|
ami_nvar_t* _root() const { return m__root; }
|
||||||
ami_nvar_t::nvar_entry_body_t* _parent() const { return m__parent; }
|
ami_nvar_t::nvar_entry_body_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -95,7 +95,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
nvar_extended_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent = 0, ami_nvar_t* p__root = 0);
|
nvar_extended_attributes_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_body_t* p__parent = nullptr, ami_nvar_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -127,7 +127,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
nvar_entry_t(kaitai::kstream* p__io, ami_nvar_t* p__parent = 0, ami_nvar_t* p__root = 0);
|
nvar_entry_t(kaitai::kstream* p__io, ami_nvar_t* p__parent = nullptr, ami_nvar_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -180,14 +180,14 @@ public:
|
|||||||
bool _is_null_next() { next(); return n_next; };
|
bool _is_null_next() { next(); return n_next; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nvar_attributes_t* m_attributes;
|
std::unique_ptr<nvar_attributes_t> m_attributes;
|
||||||
bool n_attributes;
|
bool n_attributes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _is_null_attributes() { attributes(); return n_attributes; };
|
bool _is_null_attributes() { attributes(); return n_attributes; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nvar_entry_body_t* m_body;
|
std::unique_ptr<nvar_entry_body_t> m_body;
|
||||||
bool n_body;
|
bool n_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -210,7 +210,7 @@ public:
|
|||||||
bool _is_null__raw_body() { _raw_body(); return n__raw_body; };
|
bool _is_null__raw_body() { _raw_body(); return n__raw_body; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kaitai::kstream* m__io__raw_body;
|
std::unique_ptr<kaitai::kstream> m__io__raw_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::string invoke_offset() const { return m_invoke_offset; }
|
std::string invoke_offset() const { return m_invoke_offset; }
|
||||||
@ -218,20 +218,20 @@ public:
|
|||||||
std::string signature_rest() const { return m_signature_rest; }
|
std::string signature_rest() const { return m_signature_rest; }
|
||||||
uint16_t size() const { return m_size; }
|
uint16_t size() const { return m_size; }
|
||||||
uint64_t next() const { return m_next; }
|
uint64_t next() const { return m_next; }
|
||||||
nvar_attributes_t* attributes() const { return m_attributes; }
|
nvar_attributes_t* attributes() const { return m_attributes.get(); }
|
||||||
nvar_entry_body_t* body() const { return m_body; }
|
nvar_entry_body_t* body() const { return m_body.get(); }
|
||||||
std::string invoke_end_offset() const { return m_invoke_end_offset; }
|
std::string invoke_end_offset() const { return m_invoke_end_offset; }
|
||||||
ami_nvar_t* _root() const { return m__root; }
|
ami_nvar_t* _root() const { return m__root; }
|
||||||
ami_nvar_t* _parent() const { return m__parent; }
|
ami_nvar_t* _parent() const { return m__parent; }
|
||||||
std::string _raw_body() const { return m__raw_body; }
|
std::string _raw_body() const { return m__raw_body; }
|
||||||
kaitai::kstream* _io__raw_body() const { return m__io__raw_body; }
|
kaitai::kstream* _io__raw_body() const { return m__io__raw_body.get(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class nvar_entry_body_t : public kaitai::kstruct {
|
class nvar_entry_body_t : public kaitai::kstruct {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
nvar_entry_body_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent = 0, ami_nvar_t* p__root = 0);
|
nvar_entry_body_t(kaitai::kstream* p__io, ami_nvar_t::nvar_entry_t* p__parent = nullptr, ami_nvar_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -242,7 +242,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool f_extended_header_attributes;
|
bool f_extended_header_attributes;
|
||||||
nvar_extended_attributes_t* m_extended_header_attributes;
|
std::unique_ptr<nvar_extended_attributes_t> m_extended_header_attributes;
|
||||||
bool n_extended_header_attributes;
|
bool n_extended_header_attributes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -355,7 +355,7 @@ public:
|
|||||||
bool _is_null_ascii_name() { ascii_name(); return n_ascii_name; };
|
bool _is_null_ascii_name() { ascii_name(); return n_ascii_name; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ucs2_string_t* m_ucs2_name;
|
std::unique_ptr<ucs2_string_t> m_ucs2_name;
|
||||||
bool n_ucs2_name;
|
bool n_ucs2_name;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -377,7 +377,7 @@ public:
|
|||||||
uint8_t guid_index() const { return m_guid_index; }
|
uint8_t guid_index() const { return m_guid_index; }
|
||||||
std::string guid() const { return m_guid; }
|
std::string guid() const { return m_guid; }
|
||||||
std::string ascii_name() const { return m_ascii_name; }
|
std::string ascii_name() const { return m_ascii_name; }
|
||||||
ucs2_string_t* ucs2_name() const { return m_ucs2_name; }
|
ucs2_string_t* ucs2_name() const { return m_ucs2_name.get(); }
|
||||||
std::string invoke_data_start() const { return m_invoke_data_start; }
|
std::string invoke_data_start() const { return m_invoke_data_start; }
|
||||||
std::string data() const { return m_data; }
|
std::string data() const { return m_data; }
|
||||||
ami_nvar_t* _root() const { return m__root; }
|
ami_nvar_t* _root() const { return m__root; }
|
||||||
@ -385,14 +385,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<nvar_entry_t*>* m_entries;
|
std::unique_ptr<std::vector<std::unique_ptr<nvar_entry_t>>> m_entries;
|
||||||
ami_nvar_t* m__root;
|
ami_nvar_t* m__root;
|
||||||
kaitai::kstruct* m__parent;
|
kaitai::kstruct* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::vector<nvar_entry_t*>* entries() const { return m_entries; }
|
std::vector<std::unique_ptr<nvar_entry_t>>* entries() const { return m_entries.get(); }
|
||||||
ami_nvar_t* _root() const { return m__root; }
|
ami_nvar_t* _root() const { return m__root; }
|
||||||
kaitai::kstruct* _parent() const { return m__parent; }
|
kaitai::kstruct* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AMI_NVAR_H_
|
|
||||||
|
@ -6,14 +6,8 @@
|
|||||||
intel_acbp_v1_t::intel_acbp_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::intel_acbp_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = this; (void)p__root;
|
m__root = this; (void)p__root;
|
||||||
m_elements = 0;
|
m_elements = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::_read() {
|
void intel_acbp_v1_t::_read() {
|
||||||
@ -34,13 +28,13 @@ void intel_acbp_v1_t::_read() {
|
|||||||
m_acm_svn = m__io->read_u1();
|
m_acm_svn = m__io->read_u1();
|
||||||
m_reserved1 = m__io->read_u1();
|
m_reserved1 = m__io->read_u1();
|
||||||
m_nem_data_size = m__io->read_u2le();
|
m_nem_data_size = m__io->read_u2le();
|
||||||
m_elements = new std::vector<acbp_element_t*>();
|
m_elements = std::unique_ptr<std::vector<std::unique_ptr<acbp_element_t>>>(new std::vector<std::unique_ptr<acbp_element_t>>());
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
acbp_element_t* _;
|
acbp_element_t* _;
|
||||||
do {
|
do {
|
||||||
_ = new acbp_element_t(m__io, this, m__root);
|
_ = new acbp_element_t(m__io, this, m__root);
|
||||||
m_elements->push_back(_);
|
m_elements->push_back(std::move(std::unique_ptr<acbp_element_t>(_)));
|
||||||
i++;
|
i++;
|
||||||
} while (!( ((_->header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_PMSG) || (_io()->is_eof())) ));
|
} while (!( ((_->header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_PMSG) || (_io()->is_eof())) ));
|
||||||
}
|
}
|
||||||
@ -51,34 +45,22 @@ intel_acbp_v1_t::~intel_acbp_v1_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::_clean_up() {
|
void intel_acbp_v1_t::_clean_up() {
|
||||||
if (m_elements) {
|
|
||||||
for (std::vector<acbp_element_t*>::iterator it = m_elements->begin(); it != m_elements->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_elements; m_elements = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v1_t::pmsg_body_t::pmsg_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::pmsg_body_t::pmsg_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_public_key = 0;
|
m_public_key = nullptr;
|
||||||
m_signature = 0;
|
m_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::pmsg_body_t::_read() {
|
void intel_acbp_v1_t::pmsg_body_t::_read() {
|
||||||
m_version = m__io->read_u1();
|
m_version = m__io->read_u1();
|
||||||
m_key_id = m__io->read_u2le();
|
m_key_id = m__io->read_u2le();
|
||||||
m_public_key = new public_key_t(m__io, this, m__root);
|
m_public_key = std::unique_ptr<public_key_t>(new public_key_t(m__io, this, m__root));
|
||||||
m_sig_scheme = m__io->read_u2le();
|
m_sig_scheme = m__io->read_u2le();
|
||||||
m_signature = new signature_t(m__io, this, m__root);
|
m_signature = std::unique_ptr<signature_t>(new signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v1_t::pmsg_body_t::~pmsg_body_t() {
|
intel_acbp_v1_t::pmsg_body_t::~pmsg_body_t() {
|
||||||
@ -86,46 +68,34 @@ intel_acbp_v1_t::pmsg_body_t::~pmsg_body_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::pmsg_body_t::_clean_up() {
|
void intel_acbp_v1_t::pmsg_body_t::_clean_up() {
|
||||||
if (m_public_key) {
|
|
||||||
delete m_public_key; m_public_key = 0;
|
|
||||||
}
|
|
||||||
if (m_signature) {
|
|
||||||
delete m_signature; m_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v1_t::acbp_element_t::acbp_element_t(kaitai::kstream* p__io, intel_acbp_v1_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::acbp_element_t::acbp_element_t(kaitai::kstream* p__io, intel_acbp_v1_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_header = 0;
|
m_header = nullptr;
|
||||||
m_ibbs_body = 0;
|
m_ibbs_body = nullptr;
|
||||||
m_pmda_body = 0;
|
m_pmda_body = nullptr;
|
||||||
m_pmsg_body = 0;
|
m_pmsg_body = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::acbp_element_t::_read() {
|
void intel_acbp_v1_t::acbp_element_t::_read() {
|
||||||
m_header = new common_header_t(m__io, this, m__root);
|
m_header = std::unique_ptr<common_header_t>(new common_header_t(m__io, this, m__root));
|
||||||
n_ibbs_body = true;
|
n_ibbs_body = true;
|
||||||
if (header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_IBBS) {
|
if (header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_IBBS) {
|
||||||
n_ibbs_body = false;
|
n_ibbs_body = false;
|
||||||
m_ibbs_body = new ibbs_body_t(m__io, this, m__root);
|
m_ibbs_body = std::unique_ptr<ibbs_body_t>(new ibbs_body_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_pmda_body = true;
|
n_pmda_body = true;
|
||||||
if (header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_PMDA) {
|
if (header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_PMDA) {
|
||||||
n_pmda_body = false;
|
n_pmda_body = false;
|
||||||
m_pmda_body = new pmda_body_t(m__io, this, m__root);
|
m_pmda_body = std::unique_ptr<pmda_body_t>(new pmda_body_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_pmsg_body = true;
|
n_pmsg_body = true;
|
||||||
if (header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_PMSG) {
|
if (header()->structure_id() == intel_acbp_v1_t::STRUCTURE_IDS_PMSG) {
|
||||||
n_pmsg_body = false;
|
n_pmsg_body = false;
|
||||||
m_pmsg_body = new pmsg_body_t(m__io, this, m__root);
|
m_pmsg_body = std::unique_ptr<pmsg_body_t>(new pmsg_body_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_invalid_body = true;
|
n_invalid_body = true;
|
||||||
if ( ((header()->structure_id() != intel_acbp_v1_t::STRUCTURE_IDS_PMSG) && (header()->structure_id() != intel_acbp_v1_t::STRUCTURE_IDS_PMDA) && (header()->structure_id() != intel_acbp_v1_t::STRUCTURE_IDS_IBBS)) ) {
|
if ( ((header()->structure_id() != intel_acbp_v1_t::STRUCTURE_IDS_PMSG) && (header()->structure_id() != intel_acbp_v1_t::STRUCTURE_IDS_PMDA) && (header()->structure_id() != intel_acbp_v1_t::STRUCTURE_IDS_IBBS)) ) {
|
||||||
@ -145,23 +115,11 @@ intel_acbp_v1_t::acbp_element_t::~acbp_element_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::acbp_element_t::_clean_up() {
|
void intel_acbp_v1_t::acbp_element_t::_clean_up() {
|
||||||
if (m_header) {
|
|
||||||
delete m_header; m_header = 0;
|
|
||||||
}
|
|
||||||
if (!n_ibbs_body) {
|
if (!n_ibbs_body) {
|
||||||
if (m_ibbs_body) {
|
|
||||||
delete m_ibbs_body; m_ibbs_body = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_pmda_body) {
|
if (!n_pmda_body) {
|
||||||
if (m_pmda_body) {
|
|
||||||
delete m_pmda_body; m_pmda_body = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_pmsg_body) {
|
if (!n_pmsg_body) {
|
||||||
if (m_pmsg_body) {
|
|
||||||
delete m_pmsg_body; m_pmsg_body = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_invalid_body) {
|
if (!n_invalid_body) {
|
||||||
}
|
}
|
||||||
@ -170,13 +128,7 @@ void intel_acbp_v1_t::acbp_element_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::common_header_t::common_header_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::common_header_t::common_header_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::common_header_t::_read() {
|
void intel_acbp_v1_t::common_header_t::_read() {
|
||||||
@ -194,13 +146,7 @@ void intel_acbp_v1_t::common_header_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::signature_t::signature_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::signature_t::signature_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::signature_t::_read() {
|
void intel_acbp_v1_t::signature_t::_read() {
|
||||||
@ -220,13 +166,7 @@ void intel_acbp_v1_t::signature_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::pmda_entry_v1_t::pmda_entry_v1_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::pmda_entry_v1_t::pmda_entry_v1_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::pmda_entry_v1_t::_read() {
|
void intel_acbp_v1_t::pmda_entry_v1_t::_read() {
|
||||||
@ -245,13 +185,7 @@ void intel_acbp_v1_t::pmda_entry_v1_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::ibb_segment_t::ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v1_t::ibbs_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::ibb_segment_t::ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v1_t::ibbs_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::ibb_segment_t::_read() {
|
void intel_acbp_v1_t::ibb_segment_t::_read() {
|
||||||
@ -271,13 +205,7 @@ void intel_acbp_v1_t::ibb_segment_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::public_key_t::_read() {
|
void intel_acbp_v1_t::public_key_t::_read() {
|
||||||
@ -297,13 +225,7 @@ void intel_acbp_v1_t::public_key_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::hash_t::hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::hash_t::hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::hash_t::_read() {
|
void intel_acbp_v1_t::hash_t::_read() {
|
||||||
@ -322,20 +244,14 @@ void intel_acbp_v1_t::hash_t::_clean_up() {
|
|||||||
intel_acbp_v1_t::pmda_entry_v2_t::pmda_entry_v2_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::pmda_entry_v2_t::pmda_entry_v2_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_hash = 0;
|
m_hash = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::pmda_entry_v2_t::_read() {
|
void intel_acbp_v1_t::pmda_entry_v2_t::_read() {
|
||||||
m_base = m__io->read_u4le();
|
m_base = m__io->read_u4le();
|
||||||
m_size = m__io->read_u4le();
|
m_size = m__io->read_u4le();
|
||||||
m_hash = new hash_t(m__io, this, m__root);
|
m_hash = std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v1_t::pmda_entry_v2_t::~pmda_entry_v2_t() {
|
intel_acbp_v1_t::pmda_entry_v2_t::~pmda_entry_v2_t() {
|
||||||
@ -343,32 +259,23 @@ intel_acbp_v1_t::pmda_entry_v2_t::~pmda_entry_v2_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::pmda_entry_v2_t::_clean_up() {
|
void intel_acbp_v1_t::pmda_entry_v2_t::_clean_up() {
|
||||||
if (m_hash) {
|
|
||||||
delete m_hash; m_hash = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v1_t::ibbs_body_t::ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::ibbs_body_t::ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_reserved = 0;
|
m_reserved = nullptr;
|
||||||
m_post_ibb_hash = 0;
|
m_post_ibb_hash = nullptr;
|
||||||
m_ibb_hash = 0;
|
m_ibb_hash = nullptr;
|
||||||
m_ibb_segments = 0;
|
m_ibb_segments = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::ibbs_body_t::_read() {
|
void intel_acbp_v1_t::ibbs_body_t::_read() {
|
||||||
m_reserved = new std::vector<uint8_t>();
|
m_reserved = std::unique_ptr<std::vector<uint8_t>>(new std::vector<uint8_t>());
|
||||||
const int l_reserved = 3;
|
const int l_reserved = 3;
|
||||||
for (int i = 0; i < l_reserved; i++) {
|
for (int i = 0; i < l_reserved; i++) {
|
||||||
m_reserved->push_back(m__io->read_u1());
|
m_reserved->push_back(std::move(m__io->read_u1()));
|
||||||
}
|
}
|
||||||
m_flags = m__io->read_u4le();
|
m_flags = m__io->read_u4le();
|
||||||
m_mch_bar = m__io->read_u8le();
|
m_mch_bar = m__io->read_u8le();
|
||||||
@ -377,14 +284,14 @@ void intel_acbp_v1_t::ibbs_body_t::_read() {
|
|||||||
m_dma_protection_limit0 = m__io->read_u4le();
|
m_dma_protection_limit0 = m__io->read_u4le();
|
||||||
m_dma_protection_base1 = m__io->read_u8le();
|
m_dma_protection_base1 = m__io->read_u8le();
|
||||||
m_dma_protection_limit1 = m__io->read_u8le();
|
m_dma_protection_limit1 = m__io->read_u8le();
|
||||||
m_post_ibb_hash = new hash_t(m__io, this, m__root);
|
m_post_ibb_hash = std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root));
|
||||||
m_ibb_entry_point = m__io->read_u4le();
|
m_ibb_entry_point = m__io->read_u4le();
|
||||||
m_ibb_hash = new hash_t(m__io, this, m__root);
|
m_ibb_hash = std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root));
|
||||||
m_num_ibb_segments = m__io->read_u1();
|
m_num_ibb_segments = m__io->read_u1();
|
||||||
m_ibb_segments = new std::vector<ibb_segment_t*>();
|
m_ibb_segments = std::unique_ptr<std::vector<std::unique_ptr<ibb_segment_t>>>(new std::vector<std::unique_ptr<ibb_segment_t>>());
|
||||||
const int l_ibb_segments = num_ibb_segments();
|
const int l_ibb_segments = num_ibb_segments();
|
||||||
for (int i = 0; i < l_ibb_segments; i++) {
|
for (int i = 0; i < l_ibb_segments; i++) {
|
||||||
m_ibb_segments->push_back(new ibb_segment_t(m__io, this, m__root));
|
m_ibb_segments->push_back(std::move(std::unique_ptr<ibb_segment_t>(new ibb_segment_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,35 +300,14 @@ intel_acbp_v1_t::ibbs_body_t::~ibbs_body_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::ibbs_body_t::_clean_up() {
|
void intel_acbp_v1_t::ibbs_body_t::_clean_up() {
|
||||||
if (m_reserved) {
|
|
||||||
delete m_reserved; m_reserved = 0;
|
|
||||||
}
|
|
||||||
if (m_post_ibb_hash) {
|
|
||||||
delete m_post_ibb_hash; m_post_ibb_hash = 0;
|
|
||||||
}
|
|
||||||
if (m_ibb_hash) {
|
|
||||||
delete m_ibb_hash; m_ibb_hash = 0;
|
|
||||||
}
|
|
||||||
if (m_ibb_segments) {
|
|
||||||
for (std::vector<ibb_segment_t*>::iterator it = m_ibb_segments->begin(); it != m_ibb_segments->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_ibb_segments; m_ibb_segments = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v1_t::pmda_body_t::pmda_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v1_t::pmda_body_t::pmda_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent, intel_acbp_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_entries_v1 = 0;
|
m_entries_v1 = nullptr;
|
||||||
m_entries_v2 = 0;
|
m_entries_v2 = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v1_t::pmda_body_t::_read() {
|
void intel_acbp_v1_t::pmda_body_t::_read() {
|
||||||
@ -431,19 +317,19 @@ void intel_acbp_v1_t::pmda_body_t::_read() {
|
|||||||
n_entries_v1 = true;
|
n_entries_v1 = true;
|
||||||
if (version() == 1) {
|
if (version() == 1) {
|
||||||
n_entries_v1 = false;
|
n_entries_v1 = false;
|
||||||
m_entries_v1 = new std::vector<pmda_entry_v1_t*>();
|
m_entries_v1 = std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v1_t>>>(new std::vector<std::unique_ptr<pmda_entry_v1_t>>());
|
||||||
const int l_entries_v1 = num_entries();
|
const int l_entries_v1 = num_entries();
|
||||||
for (int i = 0; i < l_entries_v1; i++) {
|
for (int i = 0; i < l_entries_v1; i++) {
|
||||||
m_entries_v1->push_back(new pmda_entry_v1_t(m__io, this, m__root));
|
m_entries_v1->push_back(std::move(std::unique_ptr<pmda_entry_v1_t>(new pmda_entry_v1_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
n_entries_v2 = true;
|
n_entries_v2 = true;
|
||||||
if (version() == 2) {
|
if (version() == 2) {
|
||||||
n_entries_v2 = false;
|
n_entries_v2 = false;
|
||||||
m_entries_v2 = new std::vector<pmda_entry_v2_t*>();
|
m_entries_v2 = std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v2_t>>>(new std::vector<std::unique_ptr<pmda_entry_v2_t>>());
|
||||||
const int l_entries_v2 = num_entries();
|
const int l_entries_v2 = num_entries();
|
||||||
for (int i = 0; i < l_entries_v2; i++) {
|
for (int i = 0; i < l_entries_v2; i++) {
|
||||||
m_entries_v2->push_back(new pmda_entry_v2_t(m__io, this, m__root));
|
m_entries_v2->push_back(std::move(std::unique_ptr<pmda_entry_v2_t>(new pmda_entry_v2_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -454,19 +340,7 @@ intel_acbp_v1_t::pmda_body_t::~pmda_body_t() {
|
|||||||
|
|
||||||
void intel_acbp_v1_t::pmda_body_t::_clean_up() {
|
void intel_acbp_v1_t::pmda_body_t::_clean_up() {
|
||||||
if (!n_entries_v1) {
|
if (!n_entries_v1) {
|
||||||
if (m_entries_v1) {
|
|
||||||
for (std::vector<pmda_entry_v1_t*>::iterator it = m_entries_v1->begin(); it != m_entries_v1->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_entries_v1; m_entries_v1 = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_entries_v2) {
|
if (!n_entries_v2) {
|
||||||
if (m_entries_v2) {
|
|
||||||
for (std::vector<pmda_entry_v2_t*>::iterator it = m_entries_v2->begin(); it != m_entries_v2->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_entries_v2; m_entries_v2 = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef INTEL_ACBP_V1_H_
|
#pragma once
|
||||||
#define INTEL_ACBP_V1_H_
|
|
||||||
|
|
||||||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||||
|
|
||||||
#include "../kaitai/kaitaistruct.h"
|
#include "../kaitai/kaitaistruct.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if KAITAI_STRUCT_VERSION < 9000L
|
#if KAITAI_STRUCT_VERSION < 9000L
|
||||||
@ -38,7 +38,7 @@ public:
|
|||||||
STRUCTURE_IDS_IBBS = 6872303100435717983LL
|
STRUCTURE_IDS_IBBS = 6872303100435717983LL
|
||||||
};
|
};
|
||||||
|
|
||||||
intel_acbp_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
intel_acbp_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -51,7 +51,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pmsg_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
pmsg_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -63,18 +63,18 @@ public:
|
|||||||
private:
|
private:
|
||||||
uint8_t m_version;
|
uint8_t m_version;
|
||||||
uint16_t m_key_id;
|
uint16_t m_key_id;
|
||||||
public_key_t* m_public_key;
|
std::unique_ptr<public_key_t> m_public_key;
|
||||||
uint16_t m_sig_scheme;
|
uint16_t m_sig_scheme;
|
||||||
signature_t* m_signature;
|
std::unique_ptr<signature_t> m_signature;
|
||||||
intel_acbp_v1_t* m__root;
|
intel_acbp_v1_t* m__root;
|
||||||
intel_acbp_v1_t::acbp_element_t* m__parent;
|
intel_acbp_v1_t::acbp_element_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint8_t version() const { return m_version; }
|
uint8_t version() const { return m_version; }
|
||||||
uint16_t key_id() const { return m_key_id; }
|
uint16_t key_id() const { return m_key_id; }
|
||||||
public_key_t* public_key() const { return m_public_key; }
|
public_key_t* public_key() const { return m_public_key.get(); }
|
||||||
uint16_t sig_scheme() const { return m_sig_scheme; }
|
uint16_t sig_scheme() const { return m_sig_scheme; }
|
||||||
signature_t* signature() const { return m_signature; }
|
signature_t* signature() const { return m_signature.get(); }
|
||||||
intel_acbp_v1_t* _root() const { return m__root; }
|
intel_acbp_v1_t* _root() const { return m__root; }
|
||||||
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
|
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
acbp_element_t(kaitai::kstream* p__io, intel_acbp_v1_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
acbp_element_t(kaitai::kstream* p__io, intel_acbp_v1_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -93,22 +93,22 @@ public:
|
|||||||
~acbp_element_t();
|
~acbp_element_t();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
common_header_t* m_header;
|
std::unique_ptr<common_header_t> m_header;
|
||||||
ibbs_body_t* m_ibbs_body;
|
std::unique_ptr<ibbs_body_t> m_ibbs_body;
|
||||||
bool n_ibbs_body;
|
bool n_ibbs_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _is_null_ibbs_body() { ibbs_body(); return n_ibbs_body; };
|
bool _is_null_ibbs_body() { ibbs_body(); return n_ibbs_body; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
pmda_body_t* m_pmda_body;
|
std::unique_ptr<pmda_body_t> m_pmda_body;
|
||||||
bool n_pmda_body;
|
bool n_pmda_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _is_null_pmda_body() { pmda_body(); return n_pmda_body; };
|
bool _is_null_pmda_body() { pmda_body(); return n_pmda_body; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
pmsg_body_t* m_pmsg_body;
|
std::unique_ptr<pmsg_body_t> m_pmsg_body;
|
||||||
bool n_pmsg_body;
|
bool n_pmsg_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -126,10 +126,10 @@ public:
|
|||||||
intel_acbp_v1_t* m__parent;
|
intel_acbp_v1_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
common_header_t* header() const { return m_header; }
|
common_header_t* header() const { return m_header.get(); }
|
||||||
ibbs_body_t* ibbs_body() const { return m_ibbs_body; }
|
ibbs_body_t* ibbs_body() const { return m_ibbs_body.get(); }
|
||||||
pmda_body_t* pmda_body() const { return m_pmda_body; }
|
pmda_body_t* pmda_body() const { return m_pmda_body.get(); }
|
||||||
pmsg_body_t* pmsg_body() const { return m_pmsg_body; }
|
pmsg_body_t* pmsg_body() const { return m_pmsg_body.get(); }
|
||||||
std::string invalid_body() const { return m_invalid_body; }
|
std::string invalid_body() const { return m_invalid_body; }
|
||||||
intel_acbp_v1_t* _root() const { return m__root; }
|
intel_acbp_v1_t* _root() const { return m__root; }
|
||||||
intel_acbp_v1_t* _parent() const { return m__parent; }
|
intel_acbp_v1_t* _parent() const { return m__parent; }
|
||||||
@ -139,7 +139,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
common_header_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
common_header_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -165,7 +165,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
signature_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
signature_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -195,7 +195,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pmda_entry_v1_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
pmda_entry_v1_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -223,7 +223,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v1_t::ibbs_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v1_t::ibbs_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -253,7 +253,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
public_key_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
public_key_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -283,7 +283,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -311,7 +311,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pmda_entry_v2_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
pmda_entry_v2_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -323,14 +323,14 @@ public:
|
|||||||
private:
|
private:
|
||||||
uint32_t m_base;
|
uint32_t m_base;
|
||||||
uint32_t m_size;
|
uint32_t m_size;
|
||||||
hash_t* m_hash;
|
std::unique_ptr<hash_t> m_hash;
|
||||||
intel_acbp_v1_t* m__root;
|
intel_acbp_v1_t* m__root;
|
||||||
intel_acbp_v1_t::pmda_body_t* m__parent;
|
intel_acbp_v1_t::pmda_body_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint32_t base() const { return m_base; }
|
uint32_t base() const { return m_base; }
|
||||||
uint32_t size() const { return m_size; }
|
uint32_t size() const { return m_size; }
|
||||||
hash_t* hash() const { return m_hash; }
|
hash_t* hash() const { return m_hash.get(); }
|
||||||
intel_acbp_v1_t* _root() const { return m__root; }
|
intel_acbp_v1_t* _root() const { return m__root; }
|
||||||
intel_acbp_v1_t::pmda_body_t* _parent() const { return m__parent; }
|
intel_acbp_v1_t::pmda_body_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -339,7 +339,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -349,7 +349,7 @@ public:
|
|||||||
~ibbs_body_t();
|
~ibbs_body_t();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<uint8_t>* m_reserved;
|
std::unique_ptr<std::vector<uint8_t>> m_reserved;
|
||||||
uint32_t m_flags;
|
uint32_t m_flags;
|
||||||
uint64_t m_mch_bar;
|
uint64_t m_mch_bar;
|
||||||
uint64_t m_vtd_bar;
|
uint64_t m_vtd_bar;
|
||||||
@ -357,16 +357,16 @@ public:
|
|||||||
uint32_t m_dma_protection_limit0;
|
uint32_t m_dma_protection_limit0;
|
||||||
uint64_t m_dma_protection_base1;
|
uint64_t m_dma_protection_base1;
|
||||||
uint64_t m_dma_protection_limit1;
|
uint64_t m_dma_protection_limit1;
|
||||||
hash_t* m_post_ibb_hash;
|
std::unique_ptr<hash_t> m_post_ibb_hash;
|
||||||
uint32_t m_ibb_entry_point;
|
uint32_t m_ibb_entry_point;
|
||||||
hash_t* m_ibb_hash;
|
std::unique_ptr<hash_t> m_ibb_hash;
|
||||||
uint8_t m_num_ibb_segments;
|
uint8_t m_num_ibb_segments;
|
||||||
std::vector<ibb_segment_t*>* m_ibb_segments;
|
std::unique_ptr<std::vector<std::unique_ptr<ibb_segment_t>>> m_ibb_segments;
|
||||||
intel_acbp_v1_t* m__root;
|
intel_acbp_v1_t* m__root;
|
||||||
intel_acbp_v1_t::acbp_element_t* m__parent;
|
intel_acbp_v1_t::acbp_element_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::vector<uint8_t>* reserved() const { return m_reserved; }
|
std::vector<uint8_t>* reserved() const { return m_reserved.get(); }
|
||||||
uint32_t flags() const { return m_flags; }
|
uint32_t flags() const { return m_flags; }
|
||||||
uint64_t mch_bar() const { return m_mch_bar; }
|
uint64_t mch_bar() const { return m_mch_bar; }
|
||||||
uint64_t vtd_bar() const { return m_vtd_bar; }
|
uint64_t vtd_bar() const { return m_vtd_bar; }
|
||||||
@ -374,11 +374,11 @@ public:
|
|||||||
uint32_t dma_protection_limit0() const { return m_dma_protection_limit0; }
|
uint32_t dma_protection_limit0() const { return m_dma_protection_limit0; }
|
||||||
uint64_t dma_protection_base1() const { return m_dma_protection_base1; }
|
uint64_t dma_protection_base1() const { return m_dma_protection_base1; }
|
||||||
uint64_t dma_protection_limit1() const { return m_dma_protection_limit1; }
|
uint64_t dma_protection_limit1() const { return m_dma_protection_limit1; }
|
||||||
hash_t* post_ibb_hash() const { return m_post_ibb_hash; }
|
hash_t* post_ibb_hash() const { return m_post_ibb_hash.get(); }
|
||||||
uint32_t ibb_entry_point() const { return m_ibb_entry_point; }
|
uint32_t ibb_entry_point() const { return m_ibb_entry_point; }
|
||||||
hash_t* ibb_hash() const { return m_ibb_hash; }
|
hash_t* ibb_hash() const { return m_ibb_hash.get(); }
|
||||||
uint8_t num_ibb_segments() const { return m_num_ibb_segments; }
|
uint8_t num_ibb_segments() const { return m_num_ibb_segments; }
|
||||||
std::vector<ibb_segment_t*>* ibb_segments() const { return m_ibb_segments; }
|
std::vector<std::unique_ptr<ibb_segment_t>>* ibb_segments() const { return m_ibb_segments.get(); }
|
||||||
intel_acbp_v1_t* _root() const { return m__root; }
|
intel_acbp_v1_t* _root() const { return m__root; }
|
||||||
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
|
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -387,7 +387,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pmda_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
|
pmda_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -400,14 +400,14 @@ public:
|
|||||||
uint16_t m_total_size;
|
uint16_t m_total_size;
|
||||||
uint32_t m_version;
|
uint32_t m_version;
|
||||||
uint32_t m_num_entries;
|
uint32_t m_num_entries;
|
||||||
std::vector<pmda_entry_v1_t*>* m_entries_v1;
|
std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v1_t>>> m_entries_v1;
|
||||||
bool n_entries_v1;
|
bool n_entries_v1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _is_null_entries_v1() { entries_v1(); return n_entries_v1; };
|
bool _is_null_entries_v1() { entries_v1(); return n_entries_v1; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<pmda_entry_v2_t*>* m_entries_v2;
|
std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v2_t>>> m_entries_v2;
|
||||||
bool n_entries_v2;
|
bool n_entries_v2;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -421,8 +421,8 @@ public:
|
|||||||
uint16_t total_size() const { return m_total_size; }
|
uint16_t total_size() const { return m_total_size; }
|
||||||
uint32_t version() const { return m_version; }
|
uint32_t version() const { return m_version; }
|
||||||
uint32_t num_entries() const { return m_num_entries; }
|
uint32_t num_entries() const { return m_num_entries; }
|
||||||
std::vector<pmda_entry_v1_t*>* entries_v1() const { return m_entries_v1; }
|
std::vector<std::unique_ptr<pmda_entry_v1_t>>* entries_v1() const { return m_entries_v1.get(); }
|
||||||
std::vector<pmda_entry_v2_t*>* entries_v2() const { return m_entries_v2; }
|
std::vector<std::unique_ptr<pmda_entry_v2_t>>* entries_v2() const { return m_entries_v2.get(); }
|
||||||
intel_acbp_v1_t* _root() const { return m__root; }
|
intel_acbp_v1_t* _root() const { return m__root; }
|
||||||
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
|
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -436,7 +436,7 @@ private:
|
|||||||
uint8_t m_acm_svn;
|
uint8_t m_acm_svn;
|
||||||
uint8_t m_reserved1;
|
uint8_t m_reserved1;
|
||||||
uint16_t m_nem_data_size;
|
uint16_t m_nem_data_size;
|
||||||
std::vector<acbp_element_t*>* m_elements;
|
std::unique_ptr<std::vector<std::unique_ptr<acbp_element_t>>> m_elements;
|
||||||
intel_acbp_v1_t* m__root;
|
intel_acbp_v1_t* m__root;
|
||||||
kaitai::kstruct* m__parent;
|
kaitai::kstruct* m__parent;
|
||||||
|
|
||||||
@ -449,9 +449,7 @@ public:
|
|||||||
uint8_t acm_svn() const { return m_acm_svn; }
|
uint8_t acm_svn() const { return m_acm_svn; }
|
||||||
uint8_t reserved1() const { return m_reserved1; }
|
uint8_t reserved1() const { return m_reserved1; }
|
||||||
uint16_t nem_data_size() const { return m_nem_data_size; }
|
uint16_t nem_data_size() const { return m_nem_data_size; }
|
||||||
std::vector<acbp_element_t*>* elements() const { return m_elements; }
|
std::vector<std::unique_ptr<acbp_element_t>>* elements() const { return m_elements.get(); }
|
||||||
intel_acbp_v1_t* _root() const { return m__root; }
|
intel_acbp_v1_t* _root() const { return m__root; }
|
||||||
kaitai::kstruct* _parent() const { return m__parent; }
|
kaitai::kstruct* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTEL_ACBP_V1_H_
|
|
||||||
|
@ -6,15 +6,9 @@
|
|||||||
intel_acbp_v2_t::intel_acbp_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::intel_acbp_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = this; (void)p__root;
|
m__root = this; (void)p__root;
|
||||||
m_elements = 0;
|
m_elements = nullptr;
|
||||||
m_key_signature = 0;
|
m_key_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::_read() {
|
void intel_acbp_v2_t::_read() {
|
||||||
@ -40,17 +34,17 @@ void intel_acbp_v2_t::_read() {
|
|||||||
m_acm_svn = m__io->read_u1();
|
m_acm_svn = m__io->read_u1();
|
||||||
m_reserved = m__io->read_u1();
|
m_reserved = m__io->read_u1();
|
||||||
m_nem_data_size = m__io->read_u2le();
|
m_nem_data_size = m__io->read_u2le();
|
||||||
m_elements = new std::vector<acbp_element_t*>();
|
m_elements = std::unique_ptr<std::vector<std::unique_ptr<acbp_element_t>>>(new std::vector<std::unique_ptr<acbp_element_t>>());
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
acbp_element_t* _;
|
acbp_element_t* _;
|
||||||
do {
|
do {
|
||||||
_ = new acbp_element_t(m__io, this, m__root);
|
_ = new acbp_element_t(m__io, this, m__root);
|
||||||
m_elements->push_back(_);
|
m_elements->push_back(std::move(std::unique_ptr<acbp_element_t>(_)));
|
||||||
i++;
|
i++;
|
||||||
} while (!( ((_->header()->total_size() == 0) || (_->header()->structure_id() == intel_acbp_v2_t::STRUCTURE_IDS_PMSG)) ));
|
} while (!( ((_->header()->total_size() == 0) || (_->header()->structure_id() == intel_acbp_v2_t::STRUCTURE_IDS_PMSG)) ));
|
||||||
}
|
}
|
||||||
m_key_signature = new key_signature_t(m__io, this, m__root);
|
m_key_signature = std::unique_ptr<key_signature_t>(new key_signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::~intel_acbp_v2_t() {
|
intel_acbp_v2_t::~intel_acbp_v2_t() {
|
||||||
@ -58,43 +52,28 @@ intel_acbp_v2_t::~intel_acbp_v2_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::_clean_up() {
|
void intel_acbp_v2_t::_clean_up() {
|
||||||
if (m_elements) {
|
|
||||||
for (std::vector<acbp_element_t*>::iterator it = m_elements->begin(); it != m_elements->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_elements; m_elements = 0;
|
|
||||||
}
|
|
||||||
if (m_key_signature) {
|
|
||||||
delete m_key_signature; m_key_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::acbp_element_t::acbp_element_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::acbp_element_t::acbp_element_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_header = 0;
|
m_header = nullptr;
|
||||||
m_ibbs_body = 0;
|
m_ibbs_body = nullptr;
|
||||||
m_pmda_body = 0;
|
m_pmda_body = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::acbp_element_t::_read() {
|
void intel_acbp_v2_t::acbp_element_t::_read() {
|
||||||
m_header = new header_t(m__io, this, m__root);
|
m_header = std::unique_ptr<header_t>(new header_t(m__io, this, m__root));
|
||||||
n_ibbs_body = true;
|
n_ibbs_body = true;
|
||||||
if ( ((header()->structure_id() == intel_acbp_v2_t::STRUCTURE_IDS_IBBS) && (header()->total_size() >= 12)) ) {
|
if ( ((header()->structure_id() == intel_acbp_v2_t::STRUCTURE_IDS_IBBS) && (header()->total_size() >= 12)) ) {
|
||||||
n_ibbs_body = false;
|
n_ibbs_body = false;
|
||||||
m_ibbs_body = new ibbs_body_t(m__io, this, m__root);
|
m_ibbs_body = std::unique_ptr<ibbs_body_t>(new ibbs_body_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_pmda_body = true;
|
n_pmda_body = true;
|
||||||
if ( ((header()->structure_id() == intel_acbp_v2_t::STRUCTURE_IDS_PMDA) && (header()->total_size() >= 12)) ) {
|
if ( ((header()->structure_id() == intel_acbp_v2_t::STRUCTURE_IDS_PMDA) && (header()->total_size() >= 12)) ) {
|
||||||
n_pmda_body = false;
|
n_pmda_body = false;
|
||||||
m_pmda_body = new pmda_body_t(m__io, this, m__root);
|
m_pmda_body = std::unique_ptr<pmda_body_t>(new pmda_body_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
n_generic_body = true;
|
n_generic_body = true;
|
||||||
if ( ((header()->structure_id() != intel_acbp_v2_t::STRUCTURE_IDS_IBBS) && (header()->structure_id() != intel_acbp_v2_t::STRUCTURE_IDS_PMDA) && (header()->total_size() >= 12)) ) {
|
if ( ((header()->structure_id() != intel_acbp_v2_t::STRUCTURE_IDS_IBBS) && (header()->structure_id() != intel_acbp_v2_t::STRUCTURE_IDS_PMDA) && (header()->total_size() >= 12)) ) {
|
||||||
@ -108,18 +87,9 @@ intel_acbp_v2_t::acbp_element_t::~acbp_element_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::acbp_element_t::_clean_up() {
|
void intel_acbp_v2_t::acbp_element_t::_clean_up() {
|
||||||
if (m_header) {
|
|
||||||
delete m_header; m_header = 0;
|
|
||||||
}
|
|
||||||
if (!n_ibbs_body) {
|
if (!n_ibbs_body) {
|
||||||
if (m_ibbs_body) {
|
|
||||||
delete m_ibbs_body; m_ibbs_body = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_pmda_body) {
|
if (!n_pmda_body) {
|
||||||
if (m_pmda_body) {
|
|
||||||
delete m_pmda_body; m_pmda_body = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!n_generic_body) {
|
if (!n_generic_body) {
|
||||||
}
|
}
|
||||||
@ -128,23 +98,17 @@ void intel_acbp_v2_t::acbp_element_t::_clean_up() {
|
|||||||
intel_acbp_v2_t::key_signature_t::key_signature_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::key_signature_t::key_signature_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_public_key = 0;
|
m_public_key = nullptr;
|
||||||
m_signature = 0;
|
m_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::key_signature_t::_read() {
|
void intel_acbp_v2_t::key_signature_t::_read() {
|
||||||
m_version = m__io->read_u1();
|
m_version = m__io->read_u1();
|
||||||
m_key_id = m__io->read_u2le();
|
m_key_id = m__io->read_u2le();
|
||||||
m_public_key = new public_key_t(m__io, this, m__root);
|
m_public_key = std::unique_ptr<public_key_t>(new public_key_t(m__io, this, m__root));
|
||||||
m_sig_scheme = m__io->read_u2le();
|
m_sig_scheme = m__io->read_u2le();
|
||||||
m_signature = new signature_t(m__io, this, m__root);
|
m_signature = std::unique_ptr<signature_t>(new signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::key_signature_t::~key_signature_t() {
|
intel_acbp_v2_t::key_signature_t::~key_signature_t() {
|
||||||
@ -152,24 +116,12 @@ intel_acbp_v2_t::key_signature_t::~key_signature_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::key_signature_t::_clean_up() {
|
void intel_acbp_v2_t::key_signature_t::_clean_up() {
|
||||||
if (m_public_key) {
|
|
||||||
delete m_public_key; m_public_key = 0;
|
|
||||||
}
|
|
||||||
if (m_signature) {
|
|
||||||
delete m_signature; m_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::signature_t::signature_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::signature_t::signature_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::signature_t::_read() {
|
void intel_acbp_v2_t::signature_t::_read() {
|
||||||
@ -189,13 +141,7 @@ void intel_acbp_v2_t::signature_t::_clean_up() {
|
|||||||
intel_acbp_v2_t::ibb_segment_t::ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v2_t::ibbs_body_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::ibb_segment_t::ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v2_t::ibbs_body_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::ibb_segment_t::_read() {
|
void intel_acbp_v2_t::ibb_segment_t::_read() {
|
||||||
@ -215,13 +161,7 @@ void intel_acbp_v2_t::ibb_segment_t::_clean_up() {
|
|||||||
intel_acbp_v2_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::public_key_t::_read() {
|
void intel_acbp_v2_t::public_key_t::_read() {
|
||||||
@ -241,13 +181,7 @@ void intel_acbp_v2_t::public_key_t::_clean_up() {
|
|||||||
intel_acbp_v2_t::hash_t::hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::hash_t::hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::hash_t::_read() {
|
void intel_acbp_v2_t::hash_t::_read() {
|
||||||
@ -266,13 +200,7 @@ void intel_acbp_v2_t::hash_t::_clean_up() {
|
|||||||
intel_acbp_v2_t::header_t::header_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::header_t::header_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::header_t::_read() {
|
void intel_acbp_v2_t::header_t::_read() {
|
||||||
@ -292,14 +220,8 @@ void intel_acbp_v2_t::header_t::_clean_up() {
|
|||||||
intel_acbp_v2_t::pmda_entry_v3_t::pmda_entry_v3_t(kaitai::kstream* p__io, intel_acbp_v2_t::pmda_body_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::pmda_entry_v3_t::pmda_entry_v3_t(kaitai::kstream* p__io, intel_acbp_v2_t::pmda_body_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_hash = 0;
|
m_hash = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::pmda_entry_v3_t::_read() {
|
void intel_acbp_v2_t::pmda_entry_v3_t::_read() {
|
||||||
@ -308,7 +230,7 @@ void intel_acbp_v2_t::pmda_entry_v3_t::_read() {
|
|||||||
m_size = m__io->read_u4le();
|
m_size = m__io->read_u4le();
|
||||||
m_total_entry_size = m__io->read_u2le();
|
m_total_entry_size = m__io->read_u2le();
|
||||||
m_version = m__io->read_u2le();
|
m_version = m__io->read_u2le();
|
||||||
m_hash = new hash_t(m__io, this, m__root);
|
m_hash = std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::pmda_entry_v3_t::~pmda_entry_v3_t() {
|
intel_acbp_v2_t::pmda_entry_v3_t::~pmda_entry_v3_t() {
|
||||||
@ -316,26 +238,17 @@ intel_acbp_v2_t::pmda_entry_v3_t::~pmda_entry_v3_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::pmda_entry_v3_t::_clean_up() {
|
void intel_acbp_v2_t::pmda_entry_v3_t::_clean_up() {
|
||||||
if (m_hash) {
|
|
||||||
delete m_hash; m_hash = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::ibbs_body_t::ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::ibbs_body_t::ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_post_ibb_digest = 0;
|
m_post_ibb_digest = nullptr;
|
||||||
m_ibb_digests = 0;
|
m_ibb_digests = nullptr;
|
||||||
m_obb_digest = 0;
|
m_obb_digest = nullptr;
|
||||||
m_reserved2 = 0;
|
m_reserved2 = nullptr;
|
||||||
m_ibb_segments = 0;
|
m_ibb_segments = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::ibbs_body_t::_read() {
|
void intel_acbp_v2_t::ibbs_body_t::_read() {
|
||||||
@ -350,26 +263,26 @@ void intel_acbp_v2_t::ibbs_body_t::_read() {
|
|||||||
m_dma_protection_limit0 = m__io->read_u4le();
|
m_dma_protection_limit0 = m__io->read_u4le();
|
||||||
m_dma_protection_base1 = m__io->read_u8le();
|
m_dma_protection_base1 = m__io->read_u8le();
|
||||||
m_dma_protection_limit1 = m__io->read_u8le();
|
m_dma_protection_limit1 = m__io->read_u8le();
|
||||||
m_post_ibb_digest = new hash_t(m__io, this, m__root);
|
m_post_ibb_digest = std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root));
|
||||||
m_ibb_entry_point = m__io->read_u4le();
|
m_ibb_entry_point = m__io->read_u4le();
|
||||||
m_ibb_digests_size = m__io->read_u2le();
|
m_ibb_digests_size = m__io->read_u2le();
|
||||||
m_num_ibb_digests = m__io->read_u2le();
|
m_num_ibb_digests = m__io->read_u2le();
|
||||||
m_ibb_digests = new std::vector<hash_t*>();
|
m_ibb_digests = std::unique_ptr<std::vector<std::unique_ptr<hash_t>>>(new std::vector<std::unique_ptr<hash_t>>());
|
||||||
const int l_ibb_digests = num_ibb_digests();
|
const int l_ibb_digests = num_ibb_digests();
|
||||||
for (int i = 0; i < l_ibb_digests; i++) {
|
for (int i = 0; i < l_ibb_digests; i++) {
|
||||||
m_ibb_digests->push_back(new hash_t(m__io, this, m__root));
|
m_ibb_digests->push_back(std::move(std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
m_obb_digest = new hash_t(m__io, this, m__root);
|
m_obb_digest = std::unique_ptr<hash_t>(new hash_t(m__io, this, m__root));
|
||||||
m_reserved2 = new std::vector<uint8_t>();
|
m_reserved2 = std::unique_ptr<std::vector<uint8_t>>(new std::vector<uint8_t>());
|
||||||
const int l_reserved2 = 3;
|
const int l_reserved2 = 3;
|
||||||
for (int i = 0; i < l_reserved2; i++) {
|
for (int i = 0; i < l_reserved2; i++) {
|
||||||
m_reserved2->push_back(m__io->read_u1());
|
m_reserved2->push_back(std::move(m__io->read_u1()));
|
||||||
}
|
}
|
||||||
m_num_ibb_segments = m__io->read_u1();
|
m_num_ibb_segments = m__io->read_u1();
|
||||||
m_ibb_segments = new std::vector<ibb_segment_t*>();
|
m_ibb_segments = std::unique_ptr<std::vector<std::unique_ptr<ibb_segment_t>>>(new std::vector<std::unique_ptr<ibb_segment_t>>());
|
||||||
const int l_ibb_segments = num_ibb_segments();
|
const int l_ibb_segments = num_ibb_segments();
|
||||||
for (int i = 0; i < l_ibb_segments; i++) {
|
for (int i = 0; i < l_ibb_segments; i++) {
|
||||||
m_ibb_segments->push_back(new ibb_segment_t(m__io, this, m__root));
|
m_ibb_segments->push_back(std::move(std::unique_ptr<ibb_segment_t>(new ibb_segment_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,40 +291,13 @@ intel_acbp_v2_t::ibbs_body_t::~ibbs_body_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::ibbs_body_t::_clean_up() {
|
void intel_acbp_v2_t::ibbs_body_t::_clean_up() {
|
||||||
if (m_post_ibb_digest) {
|
|
||||||
delete m_post_ibb_digest; m_post_ibb_digest = 0;
|
|
||||||
}
|
|
||||||
if (m_ibb_digests) {
|
|
||||||
for (std::vector<hash_t*>::iterator it = m_ibb_digests->begin(); it != m_ibb_digests->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_ibb_digests; m_ibb_digests = 0;
|
|
||||||
}
|
|
||||||
if (m_obb_digest) {
|
|
||||||
delete m_obb_digest; m_obb_digest = 0;
|
|
||||||
}
|
|
||||||
if (m_reserved2) {
|
|
||||||
delete m_reserved2; m_reserved2 = 0;
|
|
||||||
}
|
|
||||||
if (m_ibb_segments) {
|
|
||||||
for (std::vector<ibb_segment_t*>::iterator it = m_ibb_segments->begin(); it != m_ibb_segments->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_ibb_segments; m_ibb_segments = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acbp_v2_t::pmda_body_t::pmda_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acbp_v2_t::pmda_body_t::pmda_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent, intel_acbp_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_entries = 0;
|
m_entries = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::pmda_body_t::_read() {
|
void intel_acbp_v2_t::pmda_body_t::_read() {
|
||||||
@ -422,10 +308,10 @@ void intel_acbp_v2_t::pmda_body_t::_read() {
|
|||||||
throw kaitai::validation_not_equal_error<uint32_t>(3, version(), _io(), std::string("/types/pmda_body/seq/2"));
|
throw kaitai::validation_not_equal_error<uint32_t>(3, version(), _io(), std::string("/types/pmda_body/seq/2"));
|
||||||
}
|
}
|
||||||
m_num_entries = m__io->read_u4le();
|
m_num_entries = m__io->read_u4le();
|
||||||
m_entries = new std::vector<pmda_entry_v3_t*>();
|
m_entries = std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v3_t>>>(new std::vector<std::unique_ptr<pmda_entry_v3_t>>());
|
||||||
const int l_entries = num_entries();
|
const int l_entries = num_entries();
|
||||||
for (int i = 0; i < l_entries; i++) {
|
for (int i = 0; i < l_entries; i++) {
|
||||||
m_entries->push_back(new pmda_entry_v3_t(m__io, this, m__root));
|
m_entries->push_back(std::move(std::unique_ptr<pmda_entry_v3_t>(new pmda_entry_v3_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,10 +320,4 @@ intel_acbp_v2_t::pmda_body_t::~pmda_body_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acbp_v2_t::pmda_body_t::_clean_up() {
|
void intel_acbp_v2_t::pmda_body_t::_clean_up() {
|
||||||
if (m_entries) {
|
|
||||||
for (std::vector<pmda_entry_v3_t*>::iterator it = m_entries->begin(); it != m_entries->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_entries; m_entries = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef INTEL_ACBP_V2_H_
|
#pragma once
|
||||||
#define INTEL_ACBP_V2_H_
|
|
||||||
|
|
||||||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||||
|
|
||||||
#include "../kaitai/kaitaistruct.h"
|
#include "../kaitai/kaitaistruct.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if KAITAI_STRUCT_VERSION < 9000L
|
#if KAITAI_STRUCT_VERSION < 9000L
|
||||||
@ -40,7 +40,7 @@ public:
|
|||||||
STRUCTURE_IDS_TXTS = 6872303178114948959LL
|
STRUCTURE_IDS_TXTS = 6872303178114948959LL
|
||||||
};
|
};
|
||||||
|
|
||||||
intel_acbp_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
intel_acbp_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -53,7 +53,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
acbp_element_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
acbp_element_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -63,15 +63,15 @@ public:
|
|||||||
~acbp_element_t();
|
~acbp_element_t();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
header_t* m_header;
|
std::unique_ptr<header_t> m_header;
|
||||||
ibbs_body_t* m_ibbs_body;
|
std::unique_ptr<ibbs_body_t> m_ibbs_body;
|
||||||
bool n_ibbs_body;
|
bool n_ibbs_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _is_null_ibbs_body() { ibbs_body(); return n_ibbs_body; };
|
bool _is_null_ibbs_body() { ibbs_body(); return n_ibbs_body; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
pmda_body_t* m_pmda_body;
|
std::unique_ptr<pmda_body_t> m_pmda_body;
|
||||||
bool n_pmda_body;
|
bool n_pmda_body;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -89,9 +89,9 @@ public:
|
|||||||
intel_acbp_v2_t* m__parent;
|
intel_acbp_v2_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
header_t* header() const { return m_header; }
|
header_t* header() const { return m_header.get(); }
|
||||||
ibbs_body_t* ibbs_body() const { return m_ibbs_body; }
|
ibbs_body_t* ibbs_body() const { return m_ibbs_body.get(); }
|
||||||
pmda_body_t* pmda_body() const { return m_pmda_body; }
|
pmda_body_t* pmda_body() const { return m_pmda_body.get(); }
|
||||||
std::string generic_body() const { return m_generic_body; }
|
std::string generic_body() const { return m_generic_body; }
|
||||||
intel_acbp_v2_t* _root() const { return m__root; }
|
intel_acbp_v2_t* _root() const { return m__root; }
|
||||||
intel_acbp_v2_t* _parent() const { return m__parent; }
|
intel_acbp_v2_t* _parent() const { return m__parent; }
|
||||||
@ -101,7 +101,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
key_signature_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
key_signature_t(kaitai::kstream* p__io, intel_acbp_v2_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -113,18 +113,18 @@ public:
|
|||||||
private:
|
private:
|
||||||
uint8_t m_version;
|
uint8_t m_version;
|
||||||
uint16_t m_key_id;
|
uint16_t m_key_id;
|
||||||
public_key_t* m_public_key;
|
std::unique_ptr<public_key_t> m_public_key;
|
||||||
uint16_t m_sig_scheme;
|
uint16_t m_sig_scheme;
|
||||||
signature_t* m_signature;
|
std::unique_ptr<signature_t> m_signature;
|
||||||
intel_acbp_v2_t* m__root;
|
intel_acbp_v2_t* m__root;
|
||||||
intel_acbp_v2_t* m__parent;
|
intel_acbp_v2_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint8_t version() const { return m_version; }
|
uint8_t version() const { return m_version; }
|
||||||
uint16_t key_id() const { return m_key_id; }
|
uint16_t key_id() const { return m_key_id; }
|
||||||
public_key_t* public_key() const { return m_public_key; }
|
public_key_t* public_key() const { return m_public_key.get(); }
|
||||||
uint16_t sig_scheme() const { return m_sig_scheme; }
|
uint16_t sig_scheme() const { return m_sig_scheme; }
|
||||||
signature_t* signature() const { return m_signature; }
|
signature_t* signature() const { return m_signature.get(); }
|
||||||
intel_acbp_v2_t* _root() const { return m__root; }
|
intel_acbp_v2_t* _root() const { return m__root; }
|
||||||
intel_acbp_v2_t* _parent() const { return m__parent; }
|
intel_acbp_v2_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -133,7 +133,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
signature_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
signature_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -163,7 +163,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v2_t::ibbs_body_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v2_t::ibbs_body_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
public_key_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
public_key_t(kaitai::kstream* p__io, intel_acbp_v2_t::key_signature_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -223,7 +223,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -251,7 +251,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
header_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
header_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -281,7 +281,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pmda_entry_v3_t(kaitai::kstream* p__io, intel_acbp_v2_t::pmda_body_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
pmda_entry_v3_t(kaitai::kstream* p__io, intel_acbp_v2_t::pmda_body_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -296,7 +296,7 @@ public:
|
|||||||
uint32_t m_size;
|
uint32_t m_size;
|
||||||
uint16_t m_total_entry_size;
|
uint16_t m_total_entry_size;
|
||||||
uint16_t m_version;
|
uint16_t m_version;
|
||||||
hash_t* m_hash;
|
std::unique_ptr<hash_t> m_hash;
|
||||||
intel_acbp_v2_t* m__root;
|
intel_acbp_v2_t* m__root;
|
||||||
intel_acbp_v2_t::pmda_body_t* m__parent;
|
intel_acbp_v2_t::pmda_body_t* m__parent;
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ public:
|
|||||||
uint32_t size() const { return m_size; }
|
uint32_t size() const { return m_size; }
|
||||||
uint16_t total_entry_size() const { return m_total_entry_size; }
|
uint16_t total_entry_size() const { return m_total_entry_size; }
|
||||||
uint16_t version() const { return m_version; }
|
uint16_t version() const { return m_version; }
|
||||||
hash_t* hash() const { return m_hash; }
|
hash_t* hash() const { return m_hash.get(); }
|
||||||
intel_acbp_v2_t* _root() const { return m__root; }
|
intel_acbp_v2_t* _root() const { return m__root; }
|
||||||
intel_acbp_v2_t::pmda_body_t* _parent() const { return m__parent; }
|
intel_acbp_v2_t::pmda_body_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -315,7 +315,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -336,15 +336,15 @@ public:
|
|||||||
uint32_t m_dma_protection_limit0;
|
uint32_t m_dma_protection_limit0;
|
||||||
uint64_t m_dma_protection_base1;
|
uint64_t m_dma_protection_base1;
|
||||||
uint64_t m_dma_protection_limit1;
|
uint64_t m_dma_protection_limit1;
|
||||||
hash_t* m_post_ibb_digest;
|
std::unique_ptr<hash_t> m_post_ibb_digest;
|
||||||
uint32_t m_ibb_entry_point;
|
uint32_t m_ibb_entry_point;
|
||||||
uint16_t m_ibb_digests_size;
|
uint16_t m_ibb_digests_size;
|
||||||
uint16_t m_num_ibb_digests;
|
uint16_t m_num_ibb_digests;
|
||||||
std::vector<hash_t*>* m_ibb_digests;
|
std::unique_ptr<std::vector<std::unique_ptr<hash_t>>> m_ibb_digests;
|
||||||
hash_t* m_obb_digest;
|
std::unique_ptr<hash_t> m_obb_digest;
|
||||||
std::vector<uint8_t>* m_reserved2;
|
std::unique_ptr<std::vector<uint8_t>> m_reserved2;
|
||||||
uint8_t m_num_ibb_segments;
|
uint8_t m_num_ibb_segments;
|
||||||
std::vector<ibb_segment_t*>* m_ibb_segments;
|
std::unique_ptr<std::vector<std::unique_ptr<ibb_segment_t>>> m_ibb_segments;
|
||||||
intel_acbp_v2_t* m__root;
|
intel_acbp_v2_t* m__root;
|
||||||
intel_acbp_v2_t::acbp_element_t* m__parent;
|
intel_acbp_v2_t::acbp_element_t* m__parent;
|
||||||
|
|
||||||
@ -360,15 +360,15 @@ public:
|
|||||||
uint32_t dma_protection_limit0() const { return m_dma_protection_limit0; }
|
uint32_t dma_protection_limit0() const { return m_dma_protection_limit0; }
|
||||||
uint64_t dma_protection_base1() const { return m_dma_protection_base1; }
|
uint64_t dma_protection_base1() const { return m_dma_protection_base1; }
|
||||||
uint64_t dma_protection_limit1() const { return m_dma_protection_limit1; }
|
uint64_t dma_protection_limit1() const { return m_dma_protection_limit1; }
|
||||||
hash_t* post_ibb_digest() const { return m_post_ibb_digest; }
|
hash_t* post_ibb_digest() const { return m_post_ibb_digest.get(); }
|
||||||
uint32_t ibb_entry_point() const { return m_ibb_entry_point; }
|
uint32_t ibb_entry_point() const { return m_ibb_entry_point; }
|
||||||
uint16_t ibb_digests_size() const { return m_ibb_digests_size; }
|
uint16_t ibb_digests_size() const { return m_ibb_digests_size; }
|
||||||
uint16_t num_ibb_digests() const { return m_num_ibb_digests; }
|
uint16_t num_ibb_digests() const { return m_num_ibb_digests; }
|
||||||
std::vector<hash_t*>* ibb_digests() const { return m_ibb_digests; }
|
std::vector<std::unique_ptr<hash_t>>* ibb_digests() const { return m_ibb_digests.get(); }
|
||||||
hash_t* obb_digest() const { return m_obb_digest; }
|
hash_t* obb_digest() const { return m_obb_digest.get(); }
|
||||||
std::vector<uint8_t>* reserved2() const { return m_reserved2; }
|
std::vector<uint8_t>* reserved2() const { return m_reserved2.get(); }
|
||||||
uint8_t num_ibb_segments() const { return m_num_ibb_segments; }
|
uint8_t num_ibb_segments() const { return m_num_ibb_segments; }
|
||||||
std::vector<ibb_segment_t*>* ibb_segments() const { return m_ibb_segments; }
|
std::vector<std::unique_ptr<ibb_segment_t>>* ibb_segments() const { return m_ibb_segments.get(); }
|
||||||
intel_acbp_v2_t* _root() const { return m__root; }
|
intel_acbp_v2_t* _root() const { return m__root; }
|
||||||
intel_acbp_v2_t::acbp_element_t* _parent() const { return m__parent; }
|
intel_acbp_v2_t::acbp_element_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -377,7 +377,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pmda_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent = 0, intel_acbp_v2_t* p__root = 0);
|
pmda_body_t(kaitai::kstream* p__io, intel_acbp_v2_t::acbp_element_t* p__parent = nullptr, intel_acbp_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -391,7 +391,7 @@ public:
|
|||||||
uint16_t m_total_size;
|
uint16_t m_total_size;
|
||||||
uint32_t m_version;
|
uint32_t m_version;
|
||||||
uint32_t m_num_entries;
|
uint32_t m_num_entries;
|
||||||
std::vector<pmda_entry_v3_t*>* m_entries;
|
std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v3_t>>> m_entries;
|
||||||
intel_acbp_v2_t* m__root;
|
intel_acbp_v2_t* m__root;
|
||||||
intel_acbp_v2_t::acbp_element_t* m__parent;
|
intel_acbp_v2_t::acbp_element_t* m__parent;
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ public:
|
|||||||
uint16_t total_size() const { return m_total_size; }
|
uint16_t total_size() const { return m_total_size; }
|
||||||
uint32_t version() const { return m_version; }
|
uint32_t version() const { return m_version; }
|
||||||
uint32_t num_entries() const { return m_num_entries; }
|
uint32_t num_entries() const { return m_num_entries; }
|
||||||
std::vector<pmda_entry_v3_t*>* entries() const { return m_entries; }
|
std::vector<std::unique_ptr<pmda_entry_v3_t>>* entries() const { return m_entries.get(); }
|
||||||
intel_acbp_v2_t* _root() const { return m__root; }
|
intel_acbp_v2_t* _root() const { return m__root; }
|
||||||
intel_acbp_v2_t::acbp_element_t* _parent() const { return m__parent; }
|
intel_acbp_v2_t::acbp_element_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -416,8 +416,8 @@ private:
|
|||||||
uint8_t m_acm_svn;
|
uint8_t m_acm_svn;
|
||||||
uint8_t m_reserved;
|
uint8_t m_reserved;
|
||||||
uint16_t m_nem_data_size;
|
uint16_t m_nem_data_size;
|
||||||
std::vector<acbp_element_t*>* m_elements;
|
std::unique_ptr<std::vector<std::unique_ptr<acbp_element_t>>> m_elements;
|
||||||
key_signature_t* m_key_signature;
|
std::unique_ptr<key_signature_t> m_key_signature;
|
||||||
intel_acbp_v2_t* m__root;
|
intel_acbp_v2_t* m__root;
|
||||||
kaitai::kstruct* m__parent;
|
kaitai::kstruct* m__parent;
|
||||||
|
|
||||||
@ -432,10 +432,8 @@ public:
|
|||||||
uint8_t acm_svn() const { return m_acm_svn; }
|
uint8_t acm_svn() const { return m_acm_svn; }
|
||||||
uint8_t reserved() const { return m_reserved; }
|
uint8_t reserved() const { return m_reserved; }
|
||||||
uint16_t nem_data_size() const { return m_nem_data_size; }
|
uint16_t nem_data_size() const { return m_nem_data_size; }
|
||||||
std::vector<acbp_element_t*>* elements() const { return m_elements; }
|
std::vector<std::unique_ptr<acbp_element_t>>* elements() const { return m_elements.get(); }
|
||||||
key_signature_t* key_signature() const { return m_key_signature; }
|
key_signature_t* key_signature() const { return m_key_signature.get(); }
|
||||||
intel_acbp_v2_t* _root() const { return m__root; }
|
intel_acbp_v2_t* _root() const { return m__root; }
|
||||||
kaitai::kstruct* _parent() const { return m__parent; }
|
kaitai::kstruct* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTEL_ACBP_V2_H_
|
|
||||||
|
@ -6,18 +6,12 @@
|
|||||||
intel_acm_t::intel_acm_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acm_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acm_t::intel_acm_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_acm_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = this; (void)p__root;
|
m__root = this; (void)p__root;
|
||||||
m_header = 0;
|
m_header = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acm_t::_read() {
|
void intel_acm_t::_read() {
|
||||||
m_header = new header_t(m__io, this, m__root);
|
m_header = std::unique_ptr<header_t>(new header_t(m__io, this, m__root));
|
||||||
m_body = m__io->read_bytes((4 * ((header()->module_size() - header()->header_size()) - header()->scratch_space_size())));
|
m_body = m__io->read_bytes((4 * ((header()->module_size() - header()->header_size()) - header()->scratch_space_size())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,21 +20,12 @@ intel_acm_t::~intel_acm_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_acm_t::_clean_up() {
|
void intel_acm_t::_clean_up() {
|
||||||
if (m_header) {
|
|
||||||
delete m_header; m_header = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_acm_t::header_t::header_t(kaitai::kstream* p__io, intel_acm_t* p__parent, intel_acm_t* p__root) : kaitai::kstruct(p__io) {
|
intel_acm_t::header_t::header_t(kaitai::kstream* p__io, intel_acm_t* p__parent, intel_acm_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_acm_t::header_t::_read() {
|
void intel_acm_t::header_t::_read() {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef INTEL_ACM_H_
|
#pragma once
|
||||||
#define INTEL_ACM_H_
|
|
||||||
|
|
||||||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||||
|
|
||||||
#include "../kaitai/kaitaistruct.h"
|
#include "../kaitai/kaitaistruct.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#if KAITAI_STRUCT_VERSION < 9000L
|
#if KAITAI_STRUCT_VERSION < 9000L
|
||||||
#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required"
|
#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required"
|
||||||
@ -26,7 +26,7 @@ public:
|
|||||||
KNOWN_HEADER_VERSION_V3_0 = 196608
|
KNOWN_HEADER_VERSION_V3_0 = 196608
|
||||||
};
|
};
|
||||||
|
|
||||||
intel_acm_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acm_t* p__root = 0);
|
intel_acm_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acm_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -39,7 +39,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
header_t(kaitai::kstream* p__io, intel_acm_t* p__parent = 0, intel_acm_t* p__root = 0);
|
header_t(kaitai::kstream* p__io, intel_acm_t* p__parent = nullptr, intel_acm_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -144,16 +144,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
header_t* m_header;
|
std::unique_ptr<header_t> m_header;
|
||||||
std::string m_body;
|
std::string m_body;
|
||||||
intel_acm_t* m__root;
|
intel_acm_t* m__root;
|
||||||
kaitai::kstruct* m__parent;
|
kaitai::kstruct* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
header_t* header() const { return m_header; }
|
header_t* header() const { return m_header.get(); }
|
||||||
std::string body() const { return m_body; }
|
std::string body() const { return m_body; }
|
||||||
intel_acm_t* _root() const { return m__root; }
|
intel_acm_t* _root() const { return m__root; }
|
||||||
kaitai::kstruct* _parent() const { return m__parent; }
|
kaitai::kstruct* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTEL_ACM_H_
|
|
||||||
|
@ -6,15 +6,9 @@
|
|||||||
intel_keym_v1_t::intel_keym_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v1_t::intel_keym_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = this; (void)p__root;
|
m__root = this; (void)p__root;
|
||||||
m_km_hash = 0;
|
m_km_hash = nullptr;
|
||||||
m_key_signature = 0;
|
m_key_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::_read() {
|
void intel_keym_v1_t::_read() {
|
||||||
@ -32,8 +26,8 @@ void intel_keym_v1_t::_read() {
|
|||||||
m_km_version = m__io->read_u1();
|
m_km_version = m__io->read_u1();
|
||||||
m_km_svn = m__io->read_u1();
|
m_km_svn = m__io->read_u1();
|
||||||
m_km_id = m__io->read_u1();
|
m_km_id = m__io->read_u1();
|
||||||
m_km_hash = new km_hash_t(m__io, this, m__root);
|
m_km_hash = std::unique_ptr<km_hash_t>(new km_hash_t(m__io, this, m__root));
|
||||||
m_key_signature = new key_signature_t(m__io, this, m__root);
|
m_key_signature = std::unique_ptr<key_signature_t>(new key_signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v1_t::~intel_keym_v1_t() {
|
intel_keym_v1_t::~intel_keym_v1_t() {
|
||||||
@ -41,24 +35,12 @@ intel_keym_v1_t::~intel_keym_v1_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::_clean_up() {
|
void intel_keym_v1_t::_clean_up() {
|
||||||
if (m_km_hash) {
|
|
||||||
delete m_km_hash; m_km_hash = 0;
|
|
||||||
}
|
|
||||||
if (m_key_signature) {
|
|
||||||
delete m_key_signature; m_key_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v1_t::km_hash_t::km_hash_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v1_t::km_hash_t::km_hash_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::km_hash_t::_read() {
|
void intel_keym_v1_t::km_hash_t::_read() {
|
||||||
@ -77,13 +59,7 @@ void intel_keym_v1_t::km_hash_t::_clean_up() {
|
|||||||
intel_keym_v1_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v1_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::public_key_t::_read() {
|
void intel_keym_v1_t::public_key_t::_read() {
|
||||||
@ -103,13 +79,7 @@ void intel_keym_v1_t::public_key_t::_clean_up() {
|
|||||||
intel_keym_v1_t::signature_t::signature_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v1_t::signature_t::signature_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::signature_t::_read() {
|
void intel_keym_v1_t::signature_t::_read() {
|
||||||
@ -129,23 +99,17 @@ void intel_keym_v1_t::signature_t::_clean_up() {
|
|||||||
intel_keym_v1_t::key_signature_t::key_signature_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v1_t::key_signature_t::key_signature_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent, intel_keym_v1_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_public_key = 0;
|
m_public_key = nullptr;
|
||||||
m_signature = 0;
|
m_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::key_signature_t::_read() {
|
void intel_keym_v1_t::key_signature_t::_read() {
|
||||||
m_version = m__io->read_u1();
|
m_version = m__io->read_u1();
|
||||||
m_key_id = m__io->read_u2le();
|
m_key_id = m__io->read_u2le();
|
||||||
m_public_key = new public_key_t(m__io, this, m__root);
|
m_public_key = std::unique_ptr<public_key_t>(new public_key_t(m__io, this, m__root));
|
||||||
m_sig_scheme = m__io->read_u2le();
|
m_sig_scheme = m__io->read_u2le();
|
||||||
m_signature = new signature_t(m__io, this, m__root);
|
m_signature = std::unique_ptr<signature_t>(new signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v1_t::key_signature_t::~key_signature_t() {
|
intel_keym_v1_t::key_signature_t::~key_signature_t() {
|
||||||
@ -153,10 +117,4 @@ intel_keym_v1_t::key_signature_t::~key_signature_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v1_t::key_signature_t::_clean_up() {
|
void intel_keym_v1_t::key_signature_t::_clean_up() {
|
||||||
if (m_public_key) {
|
|
||||||
delete m_public_key; m_public_key = 0;
|
|
||||||
}
|
|
||||||
if (m_signature) {
|
|
||||||
delete m_signature; m_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef INTEL_KEYM_V1_H_
|
#pragma once
|
||||||
#define INTEL_KEYM_V1_H_
|
|
||||||
|
|
||||||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||||
|
|
||||||
#include "../kaitai/kaitaistruct.h"
|
#include "../kaitai/kaitaistruct.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#if KAITAI_STRUCT_VERSION < 9000L
|
#if KAITAI_STRUCT_VERSION < 9000L
|
||||||
#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required"
|
#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required"
|
||||||
@ -22,7 +22,7 @@ public:
|
|||||||
STRUCTURE_IDS_KEYM = 6872296602200661855LL
|
STRUCTURE_IDS_KEYM = 6872296602200661855LL
|
||||||
};
|
};
|
||||||
|
|
||||||
intel_keym_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_keym_v1_t* p__root = 0);
|
intel_keym_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
km_hash_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent = 0, intel_keym_v1_t* p__root = 0);
|
km_hash_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
public_key_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent = 0, intel_keym_v1_t* p__root = 0);
|
public_key_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
signature_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent = 0, intel_keym_v1_t* p__root = 0);
|
signature_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -123,7 +123,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
key_signature_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent = 0, intel_keym_v1_t* p__root = 0);
|
key_signature_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -135,18 +135,18 @@ public:
|
|||||||
private:
|
private:
|
||||||
uint8_t m_version;
|
uint8_t m_version;
|
||||||
uint16_t m_key_id;
|
uint16_t m_key_id;
|
||||||
public_key_t* m_public_key;
|
std::unique_ptr<public_key_t> m_public_key;
|
||||||
uint16_t m_sig_scheme;
|
uint16_t m_sig_scheme;
|
||||||
signature_t* m_signature;
|
std::unique_ptr<signature_t> m_signature;
|
||||||
intel_keym_v1_t* m__root;
|
intel_keym_v1_t* m__root;
|
||||||
intel_keym_v1_t* m__parent;
|
intel_keym_v1_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint8_t version() const { return m_version; }
|
uint8_t version() const { return m_version; }
|
||||||
uint16_t key_id() const { return m_key_id; }
|
uint16_t key_id() const { return m_key_id; }
|
||||||
public_key_t* public_key() const { return m_public_key; }
|
public_key_t* public_key() const { return m_public_key.get(); }
|
||||||
uint16_t sig_scheme() const { return m_sig_scheme; }
|
uint16_t sig_scheme() const { return m_sig_scheme; }
|
||||||
signature_t* signature() const { return m_signature; }
|
signature_t* signature() const { return m_signature.get(); }
|
||||||
intel_keym_v1_t* _root() const { return m__root; }
|
intel_keym_v1_t* _root() const { return m__root; }
|
||||||
intel_keym_v1_t* _parent() const { return m__parent; }
|
intel_keym_v1_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -157,8 +157,8 @@ private:
|
|||||||
uint8_t m_km_version;
|
uint8_t m_km_version;
|
||||||
uint8_t m_km_svn;
|
uint8_t m_km_svn;
|
||||||
uint8_t m_km_id;
|
uint8_t m_km_id;
|
||||||
km_hash_t* m_km_hash;
|
std::unique_ptr<km_hash_t> m_km_hash;
|
||||||
key_signature_t* m_key_signature;
|
std::unique_ptr<key_signature_t> m_key_signature;
|
||||||
intel_keym_v1_t* m__root;
|
intel_keym_v1_t* m__root;
|
||||||
kaitai::kstruct* m__parent;
|
kaitai::kstruct* m__parent;
|
||||||
|
|
||||||
@ -168,10 +168,8 @@ public:
|
|||||||
uint8_t km_version() const { return m_km_version; }
|
uint8_t km_version() const { return m_km_version; }
|
||||||
uint8_t km_svn() const { return m_km_svn; }
|
uint8_t km_svn() const { return m_km_svn; }
|
||||||
uint8_t km_id() const { return m_km_id; }
|
uint8_t km_id() const { return m_km_id; }
|
||||||
km_hash_t* km_hash() const { return m_km_hash; }
|
km_hash_t* km_hash() const { return m_km_hash.get(); }
|
||||||
key_signature_t* key_signature() const { return m_key_signature; }
|
key_signature_t* key_signature() const { return m_key_signature.get(); }
|
||||||
intel_keym_v1_t* _root() const { return m__root; }
|
intel_keym_v1_t* _root() const { return m__root; }
|
||||||
kaitai::kstruct* _parent() const { return m__parent; }
|
kaitai::kstruct* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTEL_KEYM_V1_H_
|
|
||||||
|
@ -6,38 +6,32 @@
|
|||||||
intel_keym_v2_t::intel_keym_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v2_t::intel_keym_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = this; (void)p__root;
|
m__root = this; (void)p__root;
|
||||||
m_header = 0;
|
m_header = nullptr;
|
||||||
m_reserved = 0;
|
m_reserved = nullptr;
|
||||||
m_km_hashes = 0;
|
m_km_hashes = nullptr;
|
||||||
m_key_signature = 0;
|
m_key_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::_read() {
|
void intel_keym_v2_t::_read() {
|
||||||
m_header = new header_t(m__io, this, m__root);
|
m_header = std::unique_ptr<header_t>(new header_t(m__io, this, m__root));
|
||||||
m_key_signature_offset = m__io->read_u2le();
|
m_key_signature_offset = m__io->read_u2le();
|
||||||
m_reserved = new std::vector<uint8_t>();
|
m_reserved = std::unique_ptr<std::vector<uint8_t>>(new std::vector<uint8_t>());
|
||||||
const int l_reserved = 3;
|
const int l_reserved = 3;
|
||||||
for (int i = 0; i < l_reserved; i++) {
|
for (int i = 0; i < l_reserved; i++) {
|
||||||
m_reserved->push_back(m__io->read_u1());
|
m_reserved->push_back(std::move(m__io->read_u1()));
|
||||||
}
|
}
|
||||||
m_km_version = m__io->read_u1();
|
m_km_version = m__io->read_u1();
|
||||||
m_km_svn = m__io->read_u1();
|
m_km_svn = m__io->read_u1();
|
||||||
m_km_id = m__io->read_u1();
|
m_km_id = m__io->read_u1();
|
||||||
m_fpf_hash_algorithm_id = m__io->read_u2le();
|
m_fpf_hash_algorithm_id = m__io->read_u2le();
|
||||||
m_num_km_hashes = m__io->read_u2le();
|
m_num_km_hashes = m__io->read_u2le();
|
||||||
m_km_hashes = new std::vector<km_hash_t*>();
|
m_km_hashes = std::unique_ptr<std::vector<std::unique_ptr<km_hash_t>>>(new std::vector<std::unique_ptr<km_hash_t>>());
|
||||||
const int l_km_hashes = num_km_hashes();
|
const int l_km_hashes = num_km_hashes();
|
||||||
for (int i = 0; i < l_km_hashes; i++) {
|
for (int i = 0; i < l_km_hashes; i++) {
|
||||||
m_km_hashes->push_back(new km_hash_t(m__io, this, m__root));
|
m_km_hashes->push_back(std::move(std::unique_ptr<km_hash_t>(new km_hash_t(m__io, this, m__root))));
|
||||||
}
|
}
|
||||||
m_key_signature = new key_signature_t(m__io, this, m__root);
|
m_key_signature = std::unique_ptr<key_signature_t>(new key_signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v2_t::~intel_keym_v2_t() {
|
intel_keym_v2_t::~intel_keym_v2_t() {
|
||||||
@ -45,43 +39,22 @@ intel_keym_v2_t::~intel_keym_v2_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::_clean_up() {
|
void intel_keym_v2_t::_clean_up() {
|
||||||
if (m_header) {
|
|
||||||
delete m_header; m_header = 0;
|
|
||||||
}
|
|
||||||
if (m_reserved) {
|
|
||||||
delete m_reserved; m_reserved = 0;
|
|
||||||
}
|
|
||||||
if (m_km_hashes) {
|
|
||||||
for (std::vector<km_hash_t*>::iterator it = m_km_hashes->begin(); it != m_km_hashes->end(); ++it) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
delete m_km_hashes; m_km_hashes = 0;
|
|
||||||
}
|
|
||||||
if (m_key_signature) {
|
|
||||||
delete m_key_signature; m_key_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v2_t::key_signature_t::key_signature_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v2_t::key_signature_t::key_signature_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
m_public_key = 0;
|
m_public_key = nullptr;
|
||||||
m_signature = 0;
|
m_signature = nullptr;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::key_signature_t::_read() {
|
void intel_keym_v2_t::key_signature_t::_read() {
|
||||||
m_version = m__io->read_u1();
|
m_version = m__io->read_u1();
|
||||||
m_key_id = m__io->read_u2le();
|
m_key_id = m__io->read_u2le();
|
||||||
m_public_key = new public_key_t(m__io, this, m__root);
|
m_public_key = std::unique_ptr<public_key_t>(new public_key_t(m__io, this, m__root));
|
||||||
m_sig_scheme = m__io->read_u2le();
|
m_sig_scheme = m__io->read_u2le();
|
||||||
m_signature = new signature_t(m__io, this, m__root);
|
m_signature = std::unique_ptr<signature_t>(new signature_t(m__io, this, m__root));
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v2_t::key_signature_t::~key_signature_t() {
|
intel_keym_v2_t::key_signature_t::~key_signature_t() {
|
||||||
@ -89,24 +62,12 @@ intel_keym_v2_t::key_signature_t::~key_signature_t() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::key_signature_t::_clean_up() {
|
void intel_keym_v2_t::key_signature_t::_clean_up() {
|
||||||
if (m_public_key) {
|
|
||||||
delete m_public_key; m_public_key = 0;
|
|
||||||
}
|
|
||||||
if (m_signature) {
|
|
||||||
delete m_signature; m_signature = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_keym_v2_t::km_hash_t::km_hash_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v2_t::km_hash_t::km_hash_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::km_hash_t::_read() {
|
void intel_keym_v2_t::km_hash_t::_read() {
|
||||||
@ -126,13 +87,7 @@ void intel_keym_v2_t::km_hash_t::_clean_up() {
|
|||||||
intel_keym_v2_t::signature_t::signature_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v2_t::signature_t::signature_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::signature_t::_read() {
|
void intel_keym_v2_t::signature_t::_read() {
|
||||||
@ -152,13 +107,7 @@ void intel_keym_v2_t::signature_t::_clean_up() {
|
|||||||
intel_keym_v2_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v2_t::public_key_t::public_key_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::public_key_t::_read() {
|
void intel_keym_v2_t::public_key_t::_read() {
|
||||||
@ -178,13 +127,7 @@ void intel_keym_v2_t::public_key_t::_clean_up() {
|
|||||||
intel_keym_v2_t::header_t::header_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
intel_keym_v2_t::header_t::header_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent, intel_keym_v2_t* p__root) : kaitai::kstruct(p__io) {
|
||||||
m__parent = p__parent;
|
m__parent = p__parent;
|
||||||
m__root = p__root;
|
m__root = p__root;
|
||||||
|
_read();
|
||||||
try {
|
|
||||||
_read();
|
|
||||||
} catch(...) {
|
|
||||||
_clean_up();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_keym_v2_t::header_t::_read() {
|
void intel_keym_v2_t::header_t::_read() {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef INTEL_KEYM_V2_H_
|
#pragma once
|
||||||
#define INTEL_KEYM_V2_H_
|
|
||||||
|
|
||||||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||||
|
|
||||||
#include "../kaitai/kaitaistruct.h"
|
#include "../kaitai/kaitaistruct.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if KAITAI_STRUCT_VERSION < 9000L
|
#if KAITAI_STRUCT_VERSION < 9000L
|
||||||
@ -31,7 +31,7 @@ public:
|
|||||||
KM_USAGE_FLAGS_SDEV = 8
|
KM_USAGE_FLAGS_SDEV = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
intel_keym_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_keym_v2_t* p__root = 0);
|
intel_keym_v2_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_keym_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
key_signature_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent = 0, intel_keym_v2_t* p__root = 0);
|
key_signature_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent = nullptr, intel_keym_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -56,18 +56,18 @@ public:
|
|||||||
private:
|
private:
|
||||||
uint8_t m_version;
|
uint8_t m_version;
|
||||||
uint16_t m_key_id;
|
uint16_t m_key_id;
|
||||||
public_key_t* m_public_key;
|
std::unique_ptr<public_key_t> m_public_key;
|
||||||
uint16_t m_sig_scheme;
|
uint16_t m_sig_scheme;
|
||||||
signature_t* m_signature;
|
std::unique_ptr<signature_t> m_signature;
|
||||||
intel_keym_v2_t* m__root;
|
intel_keym_v2_t* m__root;
|
||||||
intel_keym_v2_t* m__parent;
|
intel_keym_v2_t* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint8_t version() const { return m_version; }
|
uint8_t version() const { return m_version; }
|
||||||
uint16_t key_id() const { return m_key_id; }
|
uint16_t key_id() const { return m_key_id; }
|
||||||
public_key_t* public_key() const { return m_public_key; }
|
public_key_t* public_key() const { return m_public_key.get(); }
|
||||||
uint16_t sig_scheme() const { return m_sig_scheme; }
|
uint16_t sig_scheme() const { return m_sig_scheme; }
|
||||||
signature_t* signature() const { return m_signature; }
|
signature_t* signature() const { return m_signature.get(); }
|
||||||
intel_keym_v2_t* _root() const { return m__root; }
|
intel_keym_v2_t* _root() const { return m__root; }
|
||||||
intel_keym_v2_t* _parent() const { return m__parent; }
|
intel_keym_v2_t* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
@ -76,7 +76,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
km_hash_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent = 0, intel_keym_v2_t* p__root = 0);
|
km_hash_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent = nullptr, intel_keym_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
signature_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent = 0, intel_keym_v2_t* p__root = 0);
|
signature_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent = nullptr, intel_keym_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -136,7 +136,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
public_key_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent = 0, intel_keym_v2_t* p__root = 0);
|
public_key_t(kaitai::kstream* p__io, intel_keym_v2_t::key_signature_t* p__parent = nullptr, intel_keym_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -166,7 +166,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
header_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent = 0, intel_keym_v2_t* p__root = 0);
|
header_t(kaitai::kstream* p__io, intel_keym_v2_t* p__parent = nullptr, intel_keym_v2_t* p__root = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _read();
|
void _read();
|
||||||
@ -193,32 +193,30 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
header_t* m_header;
|
std::unique_ptr<header_t> m_header;
|
||||||
uint16_t m_key_signature_offset;
|
uint16_t m_key_signature_offset;
|
||||||
std::vector<uint8_t>* m_reserved;
|
std::unique_ptr<std::vector<uint8_t>> m_reserved;
|
||||||
uint8_t m_km_version;
|
uint8_t m_km_version;
|
||||||
uint8_t m_km_svn;
|
uint8_t m_km_svn;
|
||||||
uint8_t m_km_id;
|
uint8_t m_km_id;
|
||||||
uint16_t m_fpf_hash_algorithm_id;
|
uint16_t m_fpf_hash_algorithm_id;
|
||||||
uint16_t m_num_km_hashes;
|
uint16_t m_num_km_hashes;
|
||||||
std::vector<km_hash_t*>* m_km_hashes;
|
std::unique_ptr<std::vector<std::unique_ptr<km_hash_t>>> m_km_hashes;
|
||||||
key_signature_t* m_key_signature;
|
std::unique_ptr<key_signature_t> m_key_signature;
|
||||||
intel_keym_v2_t* m__root;
|
intel_keym_v2_t* m__root;
|
||||||
kaitai::kstruct* m__parent;
|
kaitai::kstruct* m__parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
header_t* header() const { return m_header; }
|
header_t* header() const { return m_header.get(); }
|
||||||
uint16_t key_signature_offset() const { return m_key_signature_offset; }
|
uint16_t key_signature_offset() const { return m_key_signature_offset; }
|
||||||
std::vector<uint8_t>* reserved() const { return m_reserved; }
|
std::vector<uint8_t>* reserved() const { return m_reserved.get(); }
|
||||||
uint8_t km_version() const { return m_km_version; }
|
uint8_t km_version() const { return m_km_version; }
|
||||||
uint8_t km_svn() const { return m_km_svn; }
|
uint8_t km_svn() const { return m_km_svn; }
|
||||||
uint8_t km_id() const { return m_km_id; }
|
uint8_t km_id() const { return m_km_id; }
|
||||||
uint16_t fpf_hash_algorithm_id() const { return m_fpf_hash_algorithm_id; }
|
uint16_t fpf_hash_algorithm_id() const { return m_fpf_hash_algorithm_id; }
|
||||||
uint16_t num_km_hashes() const { return m_num_km_hashes; }
|
uint16_t num_km_hashes() const { return m_num_km_hashes; }
|
||||||
std::vector<km_hash_t*>* km_hashes() const { return m_km_hashes; }
|
std::vector<std::unique_ptr<km_hash_t>>* km_hashes() const { return m_km_hashes.get(); }
|
||||||
key_signature_t* key_signature() const { return m_key_signature; }
|
key_signature_t* key_signature() const { return m_key_signature.get(); }
|
||||||
intel_keym_v2_t* _root() const { return m__root; }
|
intel_keym_v2_t* _root() const { return m__root; }
|
||||||
kaitai::kstruct* _parent() const { return m__parent; }
|
kaitai::kstruct* _parent() const { return m__parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTEL_KEYM_V2_H_
|
|
||||||
|
@ -125,7 +125,7 @@ USTATUS NvramParser::parseNvarStore(const UModelIndex & index)
|
|||||||
UModelIndex prevEntryIndex;
|
UModelIndex prevEntryIndex;
|
||||||
if (currentEntryIndex > 0) {
|
if (currentEntryIndex > 0) {
|
||||||
for (UINT32 i = currentEntryIndex - 1; i > 0; i--) {
|
for (UINT32 i = currentEntryIndex - 1; i > 0; i--) {
|
||||||
const auto previousEntry = parsed.entries()->at(i);
|
const auto & previousEntry = parsed.entries()->at(i);
|
||||||
|
|
||||||
if (previousEntry == entry)
|
if (previousEntry == entry)
|
||||||
break;
|
break;
|
||||||
|
@ -20,7 +20,7 @@ fi
|
|||||||
|
|
||||||
# Generate
|
# Generate
|
||||||
echo "Attempting to to generate parsers from Kaitai KSY files on ${UPLATFORM}..."
|
echo "Attempting to to generate parsers from Kaitai KSY files on ${UPLATFORM}..."
|
||||||
kaitai-struct-compiler --target cpp_stl --outdir common/generated common/ksy/* || exit 1
|
kaitai-struct-compiler --target cpp_stl --cpp-standard 11 --outdir common/generated common/ksy/* || exit 1
|
||||||
|
|
||||||
# Show generated files
|
# Show generated files
|
||||||
${UFIND} common/generated ${UFINDOPT} \
|
${UFIND} common/generated ${UFINDOPT} \
|
||||||
@ -47,4 +47,9 @@ ${UFIND} common/generated ${UFINDOPT} \
|
|||||||
-regex '.*\.(h)' \
|
-regex '.*\.(h)' \
|
||||||
-exec sed -i ${USEDOPT} '/^ enum structure_ids_t {/s/{/: uint64_t {/g' {} + || exit 1
|
-exec sed -i ${USEDOPT} '/^ enum structure_ids_t {/s/{/: uint64_t {/g' {} + || exit 1
|
||||||
|
|
||||||
|
# Suppress type downcast warning in ami_nvar.cpp
|
||||||
|
${UFIND} common/generated ${UFINDOPT} \
|
||||||
|
-name 'ami_nvar.cpp' \
|
||||||
|
-exec sed -i ${USEDOPT} 's/_offset = _io()->pos();/_offset = (int32_t)_io()->pos();/g' {} + || exit 1
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user