MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / main

Function main

BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c:150–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149
150int
151main (
152 int argc,
153 char *argv[]
154 )
155/*++
156
157Routine Description:
158
159
160Arguments:
161
162
163Returns:
164
165
166--*/
167{
168 UINT64 i;
169 UINT64 filesize;
170 FILE *fpIn, *fpOut;
171 EFILDR_HEADER EfiLdrHeader;
172 EFILDR_IMAGE EfiLdrImage[MAX_PE_IMAGES];
173 CHAR8* OutputFileName = NULL;
174 CHAR8* InputFileNames[MAX_PE_IMAGES + 1];
175 UINT8 InputFileCount = 0;
176 UINT64 DebugLevel = 0;
177 UINT64 VerboseLevel = 0;
178 EFI_STATUS Status = EFI_SUCCESS;
179
180 SetUtilityName (UTILITY_NAME);
181
182 if (argc == 1) {
183 printf ("Usage: EfiLdrImage -o OutImage LoaderImage PeImage1 PeImage2 ... PeImageN\n");
184 return STATUS_ERROR;
185 }
186
187 argc --;
188 argv ++;
189
190 if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
191 Usage();
192 return STATUS_SUCCESS;
193 }
194
195 if (stricmp (argv[0], "--version") == 0) {
196 Version();
197 return STATUS_SUCCESS;
198 }
199
200 while (argc > 0) {
201
202 if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
203 OutputFileName = argv[1];
204 if (OutputFileName == NULL) {
205 Error (NULL, 0, 1003, "Invalid option value", "Output file can't be null");
206 return STATUS_ERROR;
207 }

Callers

nothing calls this directly

Calls 15

SetUtilityNameFunction · 0.85
printfFunction · 0.85
CountVerboseLevelFunction · 0.85
AsciiStringToUint64Function · 0.85
fopenFunction · 0.85
fcloseFunction · 0.85
FCopyFileFunction · 0.85
fwriteFunction · 0.85
UsageFunction · 0.70
VersionFunction · 0.70
ErrorFunction · 0.50
strlenFunction · 0.50

Tested by

no test coverage detected