File: insyde_fdc.cpp

package info (click to toggle)
uefitool 0.28.0%2BA73-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,728 kB
  • sloc: ansic: 55,322; cpp: 23,375; sh: 43; xml: 23; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 1,146 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

#include "insyde_fdc.h"
#include "../kaitai/exceptions.h"

insyde_fdc_t::insyde_fdc_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, insyde_fdc_t* p__root) : kaitai::kstruct(p__io) {
    m__parent = p__parent;
    m__root = p__root ? p__root : this;
    f_len_fdc_store_header = false;
    _read();
}

void insyde_fdc_t::_read() {
    m_signature = m__io->read_u4le();
    m_fdc_size = m__io->read_u4le();
    {
        uint32_t _ = m_fdc_size;
        if (!( ((_ > static_cast<uint32_t>(len_fdc_store_header())) && (_ < 4294967295UL)) )) {
            throw kaitai::validation_expr_error<uint32_t>(m_fdc_size, m__io, std::string("/seq/1"));
        }
    }
    m_body = m__io->read_bytes(fdc_size() - len_fdc_store_header());
}

insyde_fdc_t::~insyde_fdc_t() {
    _clean_up();
}

void insyde_fdc_t::_clean_up() {
}

int8_t insyde_fdc_t::len_fdc_store_header() {
    if (f_len_fdc_store_header)
        return m_len_fdc_store_header;
    f_len_fdc_store_header = true;
    m_len_fdc_store_header = 80;
    return m_len_fdc_store_header;
}