]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Provides a service to retrieve the PE/COFF entry point from a PE/COFF image.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #ifndef __PE_COFF_GET_ENTRY_POINT_LIB_H__\r | |
10 | #define __PE_COFF_GET_ENTRY_POINT_LIB_H__\r | |
11 | \r | |
12 | /**\r | |
13 | Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded\r | |
14 | into system memory with the PE/COFF Loader Library functions.\r | |
15 | \r | |
16 | Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry\r | |
17 | point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then\r | |
18 | return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.\r | |
19 | If Pe32Data is NULL, then ASSERT().\r | |
20 | If EntryPoint is NULL, then ASSERT().\r | |
21 | \r | |
22 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system memory.\r | |
23 | @param EntryPoint The pointer to entry point to the PE/COFF image to return.\r | |
24 | \r | |
25 | @retval RETURN_SUCCESS EntryPoint was returned.\r | |
26 | @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.\r | |
27 | \r | |
28 | **/\r | |
29 | RETURN_STATUS\r | |
30 | EFIAPI\r | |
31 | PeCoffLoaderGetEntryPoint (\r | |
32 | IN VOID *Pe32Data,\r | |
33 | OUT VOID **EntryPoint\r | |
34 | );\r | |
35 | \r | |
36 | /**\r | |
37 | Returns the machine type of a PE/COFF image.\r | |
38 | \r | |
39 | Returns the machine type from the PE/COFF image specified by Pe32Data.\r | |
40 | If Pe32Data is NULL, then ASSERT().\r | |
41 | \r | |
42 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r | |
43 | memory.\r | |
44 | \r | |
45 | @return Machine type or zero if not a valid image.\r | |
46 | \r | |
47 | **/\r | |
48 | UINT16\r | |
49 | EFIAPI\r | |
50 | PeCoffLoaderGetMachineType (\r | |
51 | IN VOID *Pe32Data\r | |
52 | );\r | |
53 | \r | |
54 | /**\r | |
55 | Returns a pointer to the PDB file name for a PE/COFF image that has been\r | |
56 | loaded into system memory with the PE/COFF Loader Library functions.\r | |
57 | \r | |
58 | Returns the PDB file name for the PE/COFF image specified by Pe32Data. If\r | |
59 | the PE/COFF image specified by Pe32Data is not a valid, then NULL is\r | |
60 | returned. If the PE/COFF image specified by Pe32Data does not contain a\r | |
61 | debug directory entry, then NULL is returned. If the debug directory entry\r | |
62 | in the PE/COFF image specified by Pe32Data does not contain a PDB file name,\r | |
63 | then NULL is returned.\r | |
64 | If Pe32Data is NULL, then ASSERT().\r | |
65 | \r | |
66 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r | |
67 | memory.\r | |
68 | \r | |
69 | @return The PDB file name for the PE/COFF image specified by Pe32Data, or NULL\r | |
70 | if it cannot be retrieved.\r | |
71 | \r | |
72 | **/\r | |
73 | VOID *\r | |
74 | EFIAPI\r | |
75 | PeCoffLoaderGetPdbPointer (\r | |
76 | IN VOID *Pe32Data\r | |
77 | );\r | |
78 | \r | |
79 | /**\r | |
80 | Returns the size of the PE/COFF headers\r | |
81 | \r | |
82 | Returns the size of the PE/COFF header specified by Pe32Data.\r | |
83 | If Pe32Data is NULL, then ASSERT().\r | |
84 | \r | |
85 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r | |
86 | memory.\r | |
87 | \r | |
88 | @return Size of PE/COFF header in bytes, or zero if not a valid image.\r | |
89 | \r | |
90 | **/\r | |
91 | UINT32\r | |
92 | EFIAPI\r | |
93 | PeCoffGetSizeOfHeaders (\r | |
94 | IN VOID *Pe32Data\r | |
95 | );\r | |
96 | \r | |
97 | /**\r | |
98 | Returns PE/COFF image base specified by the address in this PE/COFF image.\r | |
99 | \r | |
100 | On DEBUG build, searches the PE/COFF image base forward the address in this\r | |
101 | PE/COFF image and returns it.\r | |
102 | \r | |
103 | @param Address Address located in one PE/COFF image.\r | |
104 | \r | |
105 | @retval 0 RELEASE build or cannot find the PE/COFF image base.\r | |
106 | @retval others PE/COFF image base found.\r | |
107 | \r | |
108 | **/\r | |
109 | UINTN\r | |
110 | EFIAPI\r | |
111 | PeCoffSearchImageBase (\r | |
112 | IN UINTN Address\r | |
113 | );\r | |
114 | \r | |
115 | #endif\r |