This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
forked from donovan6000/Universal-IFR-Extractor
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathUEFI.h
83 lines (68 loc) · 2.04 KB
/
UEFI.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Header guard
#ifndef UEFI_H
#define UEFI_H
// Header files
#include <string>
#include <vector>
#include <stdint.h>
#include <stdlib.h>
using namespace std;
// Global definitions
enum { FORM_SET, FORM, CONDITION, OPTION, OTHER };
// Classes/structs
struct UEFI_HII_PACK_HEADER {
uint32_t offset;
uint32_t length;
uint8_t type;
};
struct UEFI_IFR_STRING_PACK {
UEFI_HII_PACK_HEADER header;
uint32_t headerSize;
uint32_t stringOffset;
vector<uint16_t> languageWindow;
string language;
uint32_t structureOffset;
};
struct UEFI_IFR_FORM_SET_PACK {
UEFI_HII_PACK_HEADER header;
uint16_t titleString;
uint32_t usingStringPackage;
string title;
};
// Function prototypes
/*
Name: getUEFIStringPackages
Purpose: Gets UEFI string packages
*/
void getUEFIStringPackages(vector<UEFI_IFR_STRING_PACK> &stringPackages, const string &buffer);
/*
Name: displayUEFIStringPackages
Purpose: Displays UEFI string packages
*/
void displayUEFIStringPackages(const vector<UEFI_IFR_STRING_PACK> &stringPackages);
/*
Name: getUEFIStrings
Purpose: Gets strings from string package
*/
void getUEFIStrings(vector<UEFI_IFR_STRING_PACK> &stringPackages, vector<string> &strings, const string &buffer);
/*
Name: displayUEFIStrings
Purpose: Displays UEFI strings
*/
void displayUEFIStrings(const vector<string> &strings);
/*
Name: getUEFIFormSets
Purpose: Gets UEFI form sets
*/
void getUEFIFormSets(vector<UEFI_IFR_FORM_SET_PACK> &formSets, const string &buffer, const vector<UEFI_IFR_STRING_PACK> &stringPackages, const vector<string> &strings);
/*
Name: displayUEFIFormSets
Purpose: Displays UEFI form sets
*/
void displayUEFIFormSets(const vector<UEFI_IFR_FORM_SET_PACK> &formSets);
/*
Name: generateUEFIIFRDump
Purpose: Generates UEFI IFR dump
*/
void generateUEFIIFRDump(const string &outputFile, const vector<UEFI_IFR_STRING_PACK> &stringPackages, const vector<UEFI_IFR_FORM_SET_PACK> &formSets, const string &buffer, const vector<string> &strings);
#endif