mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-24 20:14:39 -04:00
NVAR parsing support
- still no proper menus for data extraction - other NVRAM formats TBD
This commit is contained in:
parent
c5dfbe7924
commit
3cf145a3cc
12 changed files with 500 additions and 22 deletions
64
common/nvram.h
Normal file
64
common/nvram.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* nvram.h
|
||||
|
||||
Copyright (c) 2016, 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,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __NVRAM_H__
|
||||
#define __NVRAM_H__
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
#include "basetypes.h"
|
||||
|
||||
//
|
||||
// Let's start with NVAR storage, as the most difficult one
|
||||
//
|
||||
|
||||
//CEF5B9A3-476D-497F-9FDC-E98143E0422C
|
||||
const QByteArray NVRAM_NVAR_FILE_GUID
|
||||
("\xA3\xB9\xF5\xCE\x6D\x47\x7F\x49\x9F\xDC\xE9\x81\x43\xE0\x42\x2C", 16);
|
||||
|
||||
extern QString variableAttributesToQstring(UINT8 attributes);
|
||||
|
||||
// Make sure we use right packing rules
|
||||
#pragma pack(push,1)
|
||||
|
||||
// Variable header
|
||||
typedef struct _NVAR_VARIABLE_HEADER {
|
||||
UINT32 Signature; // NVAR signature
|
||||
UINT16 Size; // Size of the variable including header
|
||||
UINT32 Next : 24; // Offset to the next variable in a list, or empty if latest in the list
|
||||
UINT32 Attributes : 8; // Attributes
|
||||
} NVAR_VARIABLE_HEADER;
|
||||
|
||||
// NVAR signature
|
||||
#define NVRAM_NVAR_VARIABLE_SIGNATURE 0x5241564E
|
||||
|
||||
// Attributes
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_RUNTIME 0x01
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_ASCII_NAME 0x02
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_GUID 0x04
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_DATA_ONLY 0x08
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_EXT_HEADER 0x10
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_HW_ERROR_RECORD 0x20
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_AUTH_WRITE 0x40
|
||||
#define NVRAM_NVAR_VARIABLE_ATTRIB_VALID 0x80
|
||||
|
||||
// Extended attributes
|
||||
#define NVRAM_NVAR_VARIABLE_EXT_ATTRIB_CHECKSUM 0x01
|
||||
#define NVRAM_NVAR_VARIABLE_EXT_ATTRIB_AUTH_WRITE 0x10
|
||||
#define NVRAM_NVAR_VARIABLE_EXT_ATTRIB_TIME_BASED 0x20
|
||||
|
||||
// Restore previous packing rules
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue