summaryrefslogtreecommitdiff
path: root/plugins/efi_resolver/include/ModuleType.h
blob: 2bad23b133bc0354a6097c4743c4d616453293be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include "binaryninjaapi.h"

using namespace BinaryNinja;

enum EFIModuleType
{
	UNKNOWN,
	PEI,
	DXE,
};

static inline EFIModuleType identifyModuleType(BinaryView* bv)
{
	FileMetadata* file = bv->GetFile();
	if (file->GetViewOfType("PE"))
		return DXE;
	else if (file->GetViewOfType("TE"))
		return PEI;
	else
		return UNKNOWN;
}