mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-17 16:45:06 -04:00
Add initial support for Insyde H2O FlashDeviceMap rev4
This commit is contained in:
parent
97a85f9ddc
commit
7ef371957a
3 changed files with 6 additions and 15 deletions
|
@ -1540,7 +1540,7 @@ continue_searching: {}
|
|||
if (restSize < fdmHeader->Size)
|
||||
continue;
|
||||
|
||||
if (fdmHeader->Revision > 3) {
|
||||
if (fdmHeader->Revision > 4) {
|
||||
msg(usprintf("%s: Insyde Flash Device Map candidate with unknown revision %u", __FUNCTION__, fdmHeader->Revision), index);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
||||
|
||||
#include "insyde_fdm.h"
|
||||
#include "../kaitai/exceptions.h"
|
||||
|
||||
insyde_fdm_t::insyde_fdm_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, insyde_fdm_t* p__root) : kaitai::kstruct(p__io) {
|
||||
m__parent = p__parent;
|
||||
|
@ -16,29 +15,23 @@ insyde_fdm_t::insyde_fdm_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, i
|
|||
|
||||
void insyde_fdm_t::_read() {
|
||||
m_signature = m__io->read_u4le();
|
||||
if (!(signature() == 1296320072)) {
|
||||
throw kaitai::validation_not_equal_error<uint32_t>(1296320072, signature(), _io(), std::string("/seq/0"));
|
||||
}
|
||||
m_store_size = m__io->read_u4le();
|
||||
m_data_offset = m__io->read_u4le();
|
||||
m_entry_size = m__io->read_u4le();
|
||||
m_entry_format = m__io->read_u1();
|
||||
m_revision = m__io->read_u1();
|
||||
if (!( ((revision() == 1) || (revision() == 2) || (revision() == 3)) )) {
|
||||
throw kaitai::validation_not_any_of_error<uint8_t>(revision(), _io(), std::string("/seq/5"));
|
||||
}
|
||||
m_num_extensions = m__io->read_u1();
|
||||
m_checksum = m__io->read_u1();
|
||||
m_fd_base_address = m__io->read_u8le();
|
||||
n_extensions = true;
|
||||
if (revision() == 3) {
|
||||
if (revision() > 2) {
|
||||
n_extensions = false;
|
||||
m__raw_extensions = m__io->read_bytes((num_extensions() * 4));
|
||||
m__io__raw_extensions = std::unique_ptr<kaitai::kstream>(new kaitai::kstream(m__raw_extensions));
|
||||
m_extensions = std::unique_ptr<fdm_extensions_t>(new fdm_extensions_t(m__io__raw_extensions.get(), this, m__root));
|
||||
}
|
||||
n_board_ids = true;
|
||||
if ( ((revision() == 3) && (extensions()->extensions()->at(1)->count() > 0)) ) {
|
||||
if ( ((revision() > 2) && (extensions()->extensions()->at(1)->count() > 0)) ) {
|
||||
n_board_ids = false;
|
||||
m_board_ids = std::unique_ptr<fdm_board_ids_t>(new fdm_board_ids_t(m__io, this, m__root));
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ meta:
|
|||
seq:
|
||||
- id: signature
|
||||
type: u4
|
||||
valid: 0x4D444648 # HFDM
|
||||
- id: store_size
|
||||
type: u4
|
||||
- id: data_offset
|
||||
|
@ -23,8 +22,6 @@ seq:
|
|||
type: u1
|
||||
- id: revision
|
||||
type: u1
|
||||
valid:
|
||||
any-of: [1, 2, 3]
|
||||
- id: num_extensions
|
||||
type: u1
|
||||
- id: checksum
|
||||
|
@ -34,10 +31,11 @@ seq:
|
|||
- id: extensions
|
||||
type: fdm_extensions
|
||||
size: num_extensions * sizeof<fdm_extension>
|
||||
if: revision == 3
|
||||
if: revision > 2
|
||||
- id: board_ids
|
||||
type: fdm_board_ids
|
||||
if: revision == 3 and extensions.extensions[1].count > 0
|
||||
if: revision > 2 and extensions.extensions[1].count > 0
|
||||
#TODO: need to find a sample with revision == 4 and extensions.extensions[2].count > 0
|
||||
- id: entries
|
||||
type: fdm_entries
|
||||
size: store_size - data_offset
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue