/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>
typedef enum {
    FU_PE_COFF_MACHINE_UNKNOWN,
    FU_PE_COFF_MACHINE_ALPHA = 0x184,
    FU_PE_COFF_MACHINE_ALPHA64 = 0x284,
    FU_PE_COFF_MACHINE_AM33 = 0x1d3,
    FU_PE_COFF_MACHINE_AMD64 = 0x8664,
    FU_PE_COFF_MACHINE_ARM = 0x1c0,
    FU_PE_COFF_MACHINE_ARM64 = 0xaa64,
    FU_PE_COFF_MACHINE_ARMNT = 0x1c4,
    FU_PE_COFF_MACHINE_EBC = 0xebc,
    FU_PE_COFF_MACHINE_I386 = 0x14c,
    FU_PE_COFF_MACHINE_IA64 = 0x200,
    FU_PE_COFF_MACHINE_LOONGARCH32 = 0x6232,
    FU_PE_COFF_MACHINE_LOONGARCH64 = 0x6264,
    FU_PE_COFF_MACHINE_M32R = 0x9041,
    FU_PE_COFF_MACHINE_MIPS16 = 0x266,
    FU_PE_COFF_MACHINE_MIPSFPU = 0x366,
    FU_PE_COFF_MACHINE_MIPSFPU16 = 0x466,
    FU_PE_COFF_MACHINE_POWERPC = 0x1f0,
    FU_PE_COFF_MACHINE_POWERPCFP = 0x1f1,
    FU_PE_COFF_MACHINE_R4000 = 0x166,
    FU_PE_COFF_MACHINE_RISCV32 = 0x5032,
    FU_PE_COFF_MACHINE_RISCV64 = 0x5064,
    FU_PE_COFF_MACHINE_RISCV128 = 0x5128,
    FU_PE_COFF_MACHINE_SH3 = 0x1a2,
    FU_PE_COFF_MACHINE_SH3DSP = 0x1a3,
    FU_PE_COFF_MACHINE_SH4 = 0x1a6,
    FU_PE_COFF_MACHINE_SH5 = 0x1a8,
    FU_PE_COFF_MACHINE_THUMB = 0x1c2,
    FU_PE_COFF_MACHINE_WCEMIPSV2 = 0x169,
} FuPeCoffMachine;
typedef enum {
    FU_PE_COFF_MAGIC_PE32 = 0x10b,
    FU_PE_COFF_MAGIC_PE32_PLUS = 0x20b,
} FuPeCoffMagic;
typedef enum {
    FU_FU_COFF_SUBSYSTEM_UNKNOWN,
    FU_FU_COFF_SUBSYSTEM_NATIVE = 1,
    FU_FU_COFF_SUBSYSTEM_WINDOWS_GUI = 2,
    FU_FU_COFF_SUBSYSTEM_WINDOWS_CUI = 3,
    FU_FU_COFF_SUBSYSTEM_OS2_CUI = 5,
    FU_FU_COFF_SUBSYSTEM_POSIX_CUI = 7,
    FU_FU_COFF_SUBSYSTEM_NATIVE_WINDOWS = 8,
    FU_FU_COFF_SUBSYSTEM_WINDOWS_CE_GUI = 9,
    FU_FU_COFF_SUBSYSTEM_EFI_APPLICATION = 10,
    FU_FU_COFF_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11,
    FU_FU_COFF_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12,
    FU_FU_COFF_SUBSYSTEM_EFI_ROM = 13,
    FU_FU_COFF_SUBSYSTEM_XBOX = 14,
    FU_FU_COFF_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16,
} FuFuCoffSubsystem;

GByteArray *fu_struct_pe_dos_header_parse_bytes(GBytes *blob, gsize offset, GError **error);
gboolean fu_struct_pe_dos_header_validate_bytes(GBytes *blob, gsize offset, GError **error);
guint32 fu_struct_pe_dos_header_get_lfanew(const GByteArray *st);
#define FU_STRUCT_PE_DOS_HEADER_OFFSET_MAGIC 0x0
#define FU_STRUCT_PE_DOS_HEADER_OFFSET_LFANEW 0x3C
#define FU_STRUCT_PE_DOS_HEADER_SIZE 0x40
#define FU_STRUCT_PE_DOS_HEADER_DEFAULT_MAGIC 0x5A4D
#define FU_STRUCT_PE_DOS_HEADER_DEFAULT_LFANEW 0x80

GByteArray *fu_struct_pe_coff_file_header_parse_bytes(GBytes *blob, gsize offset, GError **error);
FuPeCoffMachine fu_struct_pe_coff_file_header_get_machine(const GByteArray *st);
guint16 fu_struct_pe_coff_file_header_get_number_of_sections(const GByteArray *st);
guint32 fu_struct_pe_coff_file_header_get_pointer_to_symbol_table(const GByteArray *st);
guint32 fu_struct_pe_coff_file_header_get_number_of_symbols(const GByteArray *st);
guint16 fu_struct_pe_coff_file_header_get_size_of_optional_header(const GByteArray *st);
guint16 fu_struct_pe_coff_file_header_get_characteristics(const GByteArray *st);
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_MACHINE 0x4
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_NUMBER_OF_SECTIONS 0x6
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_POINTER_TO_SYMBOL_TABLE 0xC
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_NUMBER_OF_SYMBOLS 0x10
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_SIZE_OF_OPTIONAL_HEADER 0x14
#define FU_STRUCT_PE_COFF_FILE_HEADER_OFFSET_CHARACTERISTICS 0x16
#define FU_STRUCT_PE_COFF_FILE_HEADER_SIZE 0x18
#define FU_STRUCT_PE_COFF_FILE_HEADER_DEFAULT_SIGNATURE 0x4550
#define FU_STRUCT_PE_COFF_FILE_HEADER_DEFAULT_MACHINE FU_PE_COFF_MACHINE_AMD64
#define FU_STRUCT_PE_COFF_FILE_HEADER_DEFAULT_SIZE_OF_OPTIONAL_HEADER 0xf0
#define FU_STRUCT_PE_COFF_FILE_HEADER_DEFAULT_CHARACTERISTICS 0x2022

GByteArray *fu_struct_pe_coff_optional_header64_parse_bytes(GBytes *blob, gsize offset, GError **error);
FuPeCoffMagic fu_struct_pe_coff_optional_header64_get_magic(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_size_of_code(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_size_of_initialized_data(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_size_of_uninitialized_data(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_addressofentrypoint(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_base_of_code(const GByteArray *st);
guint64 fu_struct_pe_coff_optional_header64_get_image_base(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_section_alignment(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_file_alignment(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_size_of_image(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_size_of_headers(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_check_sum(const GByteArray *st);
FuFuCoffSubsystem fu_struct_pe_coff_optional_header64_get_subsystem(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_loader_flags(const GByteArray *st);
guint32 fu_struct_pe_coff_optional_header64_get_number_of_rva_and_sizes(const GByteArray *st);
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_MAGIC 0x0
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SIZE_OF_CODE 0x4
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SIZE_OF_INITIALIZED_DATA 0x8
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SIZE_OF_UNINITIALIZED_DATA 0xC
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_ADDRESSOFENTRYPOINT 0x10
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_BASE_OF_CODE 0x14
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_IMAGE_BASE 0x18
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SECTION_ALIGNMENT 0x20
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_FILE_ALIGNMENT 0x24
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SIZE_OF_IMAGE 0x38
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SIZE_OF_HEADERS 0x3C
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_CHECK_SUM 0x40
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_SUBSYSTEM 0x44
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_LOADER_FLAGS 0x68
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_OFFSET_NUMBER_OF_RVA_AND_SIZES 0x6C
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_SIZE 0x70
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_DEFAULT_MAGIC FU_PE_COFF_MAGIC_PE32_PLUS
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_DEFAULT_SECTION_ALIGNMENT 0x200
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_DEFAULT_FILE_ALIGNMENT 0x200
#define FU_STRUCT_PE_COFF_OPTIONAL_HEADER64_DEFAULT_SUBSYSTEM FU_FU_COFF_SUBSYSTEM_EFI_APPLICATION

#define FU_STRUCT_PE_COFF_SYMBOL_OFFSET_NAME 0x0
#define FU_STRUCT_PE_COFF_SYMBOL_OFFSET_VALUE 0x8
#define FU_STRUCT_PE_COFF_SYMBOL_OFFSET_SECTION_NUMBER 0xC
#define FU_STRUCT_PE_COFF_SYMBOL_OFFSET_TYPE 0xE
#define FU_STRUCT_PE_COFF_SYMBOL_OFFSET_STORAGE_CLASS 0x10
#define FU_STRUCT_PE_COFF_SYMBOL_OFFSET_NUMBER_OF_AUX_SYMBOLS 0x11
#define FU_STRUCT_PE_COFF_SYMBOL_SIZE_NAME 0x8
#define FU_STRUCT_PE_COFF_SYMBOL_SIZE 0x12

GByteArray *fu_struct_pe_coff_section_parse_bytes(GBytes *blob, gsize offset, GError **error);
gchar *fu_struct_pe_coff_section_get_name(const GByteArray *st);
guint32 fu_struct_pe_coff_section_get_virtual_size(const GByteArray *st);
guint32 fu_struct_pe_coff_section_get_virtual_address(const GByteArray *st);
guint32 fu_struct_pe_coff_section_get_size_of_raw_data(const GByteArray *st);
guint32 fu_struct_pe_coff_section_get_pointer_to_raw_data(const GByteArray *st);
guint32 fu_struct_pe_coff_section_get_characteristics(const GByteArray *st);
#define FU_STRUCT_PE_COFF_SECTION_OFFSET_NAME 0x0
#define FU_STRUCT_PE_COFF_SECTION_OFFSET_VIRTUAL_SIZE 0x8
#define FU_STRUCT_PE_COFF_SECTION_OFFSET_VIRTUAL_ADDRESS 0xC
#define FU_STRUCT_PE_COFF_SECTION_OFFSET_SIZE_OF_RAW_DATA 0x10
#define FU_STRUCT_PE_COFF_SECTION_OFFSET_POINTER_TO_RAW_DATA 0x14
#define FU_STRUCT_PE_COFF_SECTION_OFFSET_CHARACTERISTICS 0x24
#define FU_STRUCT_PE_COFF_SECTION_SIZE_NAME 0x8
#define FU_STRUCT_PE_COFF_SECTION_SIZE 0x28
