2015-11-11 01:35:16 +08:00
|
|
|
/* parsingdata.h
|
2015-04-02 16:04:37 +08:00
|
|
|
|
|
|
|
Copyright (c) 2015, Nikolaj Schlej. All rights reserved.
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
Parsing data is an information needed for each level of image reconstruction
|
|
|
|
routines without the need of backward traversal
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2016-04-09 18:47:19 +08:00
|
|
|
#ifndef PARSINGDATA_H
|
|
|
|
#define PARSINGDATA_H
|
2015-04-02 16:04:37 +08:00
|
|
|
|
|
|
|
#include "basetypes.h"
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct VOLUME_PARSING_DATA_ {
|
2015-04-02 16:04:37 +08:00
|
|
|
EFI_GUID extendedHeaderGuid;
|
|
|
|
UINT32 alignment;
|
|
|
|
UINT8 revision;
|
|
|
|
BOOLEAN hasExtendedHeader;
|
2015-07-07 21:57:41 +08:00
|
|
|
BOOLEAN hasAppleCrc32;
|
|
|
|
BOOLEAN hasAppleFSO;
|
2015-04-02 16:04:37 +08:00
|
|
|
BOOLEAN isWeakAligned;
|
|
|
|
} VOLUME_PARSING_DATA;
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct FILE_PARSING_DATA_ {
|
2016-04-21 04:41:18 +08:00
|
|
|
EFI_GUID guid;
|
2015-04-02 16:04:37 +08:00
|
|
|
} FILE_PARSING_DATA;
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct COMPRESSED_SECTION_PARSING_DATA_ {
|
2015-04-02 16:04:37 +08:00
|
|
|
UINT32 uncompressedSize;
|
|
|
|
UINT8 compressionType;
|
|
|
|
UINT8 algorithm;
|
|
|
|
} COMPRESSED_SECTION_PARSING_DATA;
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct GUIDED_SECTION_PARSING_DATA_ {
|
2015-04-02 16:04:37 +08:00
|
|
|
EFI_GUID guid;
|
|
|
|
} GUIDED_SECTION_PARSING_DATA;
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct FREEFORM_GUIDED_SECTION_PARSING_DATA_ {
|
2015-04-02 16:04:37 +08:00
|
|
|
EFI_GUID guid;
|
|
|
|
} FREEFORM_GUIDED_SECTION_PARSING_DATA;
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct TE_IMAGE_SECTION_PARSING_DATA_ {
|
2015-06-20 02:26:45 +08:00
|
|
|
UINT32 imageBase;
|
|
|
|
UINT32 adjustedImageBase;
|
|
|
|
UINT8 revision;
|
|
|
|
} TE_IMAGE_SECTION_PARSING_DATA;
|
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct SECTION_PARSING_DATA_ {
|
2015-04-02 16:04:37 +08:00
|
|
|
union {
|
|
|
|
COMPRESSED_SECTION_PARSING_DATA compressed;
|
|
|
|
GUIDED_SECTION_PARSING_DATA guidDefined;
|
|
|
|
FREEFORM_GUIDED_SECTION_PARSING_DATA freeformSubtypeGuid;
|
2015-06-20 02:26:45 +08:00
|
|
|
TE_IMAGE_SECTION_PARSING_DATA teImage;
|
2015-04-02 16:04:37 +08:00
|
|
|
};
|
|
|
|
} SECTION_PARSING_DATA;
|
|
|
|
|
2016-04-18 21:10:07 +08:00
|
|
|
typedef struct NVAR_ENTRY_PARSING_DATA_ {
|
2016-04-21 04:41:18 +08:00
|
|
|
UINT32 next;
|
2016-04-18 21:10:07 +08:00
|
|
|
BOOLEAN isValid;
|
|
|
|
} NVAR_ENTRY_PARSING_DATA;
|
2016-03-21 06:59:03 +08:00
|
|
|
|
2016-04-09 19:47:28 +08:00
|
|
|
typedef struct PARSING_DATA_ {
|
2015-04-02 16:04:37 +08:00
|
|
|
UINT8 emptyByte;
|
|
|
|
UINT8 ffsVersion;
|
|
|
|
UINT32 offset;
|
2015-06-20 02:26:45 +08:00
|
|
|
UINT32 address;
|
2015-04-02 16:04:37 +08:00
|
|
|
union {
|
2016-04-18 21:10:07 +08:00
|
|
|
VOLUME_PARSING_DATA volume;
|
|
|
|
FILE_PARSING_DATA file;
|
|
|
|
SECTION_PARSING_DATA section;
|
|
|
|
NVAR_ENTRY_PARSING_DATA nvar;
|
2015-04-02 16:04:37 +08:00
|
|
|
};
|
|
|
|
} PARSING_DATA;
|
|
|
|
|
2016-04-09 18:47:19 +08:00
|
|
|
#endif // NVRAM_H
|