]>
Commit | Line | Data |
---|---|---|
fb3df220 | 1 | /** @file\r |
50a64e5b | 2 | Provides a service to retrieve the PE/COFF entry point from a PE/COFF image.\r |
fb3df220 | 3 | \r |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
fb3df220 | 6 | \r |
fb3df220 | 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 | |
af2dc6a7 | 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 | |
fb3df220 | 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 | |
af2dc6a7 | 42 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r |
fb3df220 | 43 | memory.\r |
44 | \r | |
cb6cb44c | 45 | @return Machine type or zero if not a valid image.\r |
fb3df220 | 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 | |
9095d37b | 56 | loaded into system memory with the PE/COFF Loader Library functions.\r |
fb3df220 | 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 | |
af2dc6a7 | 66 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r |
fb3df220 | 67 | memory.\r |
68 | \r | |
af2dc6a7 | 69 | @return The PDB file name for the PE/COFF image specified by Pe32Data, or NULL\r |
fb3df220 | 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 | |
225290eb A |
79 | \r |
80 | /**\r | |
81 | Returns the size of the PE/COFF headers\r | |
82 | \r | |
83 | Returns the size of the PE/COFF header specified by Pe32Data.\r | |
84 | If Pe32Data is NULL, then ASSERT().\r | |
85 | \r | |
af2dc6a7 | 86 | @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r |
225290eb A |
87 | memory.\r |
88 | \r | |
af2dc6a7 | 89 | @return Size of PE/COFF header in bytes, or zero if not a valid image.\r |
225290eb A |
90 | \r |
91 | **/\r | |
cb6cb44c | 92 | UINT32\r |
93 | EFIAPI\r | |
94 | PeCoffGetSizeOfHeaders (\r | |
95 | IN VOID *Pe32Data\r | |
96 | );\r | |
225290eb | 97 | \r |
412e9dea JF |
98 | /**\r |
99 | Returns PE/COFF image base specified by the address in this PE/COFF image.\r | |
100 | \r | |
101 | On DEBUG build, searches the PE/COFF image base forward the address in this\r | |
102 | PE/COFF image and returns it.\r | |
103 | \r | |
104 | @param Address Address located in one PE/COFF image.\r | |
105 | \r | |
106 | @retval 0 RELEASE build or cannot find the PE/COFF image base.\r | |
107 | @retval others PE/COFF image base found.\r | |
108 | \r | |
109 | **/\r | |
110 | UINTN\r | |
111 | EFIAPI\r | |
9e981317 | 112 | PeCoffSearchImageBase (\r |
412e9dea JF |
113 | IN UINTN Address\r |
114 | );\r | |
115 | \r | |
fb3df220 | 116 | #endif\r |