diff --git a/Utilities/ACPIe/ACPIe.c b/Utilities/ACPIe/ACPIe.c index 0d246803..29abc537 100644 --- a/Utilities/ACPIe/ACPIe.c +++ b/Utilities/ACPIe/ACPIe.c @@ -110,12 +110,11 @@ AcpiFindEntryInFile ( @param[in] Entry Number of required entry. **/ -INT32 +int ENTRY_POINT ( - IN INT32 argc, - IN CONST CHAR8 *argv[] - ) // ENTRY_POINT - + int argc, + char *argv[] + ) { UINT32 ReturnedOffset; EFI_STATUS Status; @@ -221,10 +220,11 @@ ENTRY_POINT ( return 0; } -INT32 + +int LLVMFuzzerTestOneInput ( - CONST UINT8 *Data, - UINTN Size + const uint8_t *Data, + size_t Size ) { if (Size > 0) { diff --git a/Utilities/AppleEfiSignTool/AppleEfiSignTool.c b/Utilities/AppleEfiSignTool/AppleEfiSignTool.c index 4df3e5fa..630b5b47 100644 --- a/Utilities/AppleEfiSignTool/AppleEfiSignTool.c +++ b/Utilities/AppleEfiSignTool/AppleEfiSignTool.c @@ -118,10 +118,10 @@ VerifySignature ( return 0; } -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + int argc, + char *argv[] ) { CONST CHAR8 *ImageFileName; @@ -141,12 +141,12 @@ ENTRY_POINT ( // // Print usage. // - if (Argc != 2) { + if (argc != 2) { PrintHelp (); return EXIT_FAILURE; } - ImageFileName = Argv[1]; + ImageFileName = argv[1]; ImageFileBuffer = UserReadFile (ImageFileName, &ImageSize); if (ImageFileBuffer == NULL) { DEBUG ((DEBUG_ERROR, "Failed to read %a\n", ImageFileName)); @@ -177,10 +177,10 @@ ENTRY_POINT ( return RetVal; } -INT32 +int LLVMFuzzerTestOneInput ( - IN CONST UINT8 *Data, - IN UINTN Size + const uint8_t *Data, + size_t Size ) { #if 0 diff --git a/Utilities/TestBmf/Bmf.c b/Utilities/TestBmf/Bmf.c index a44ac634..3b54bf65 100644 --- a/Utilities/TestBmf/Bmf.c +++ b/Utilities/TestBmf/Bmf.c @@ -53,10 +53,10 @@ GuiBmpToImage ( return EFI_SUCCESS; } -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + int argc, + char *argv[] ) { BOOLEAN Result; @@ -70,13 +70,13 @@ ENTRY_POINT ( VOID *BmpImage; UINT32 BmpImageSize; - if (Argc != 3) { + if (argc != 3) { DEBUG ((DEBUG_ERROR, "./Bmf ")); return -1; } - FontImage = UserReadFile (Argv[1], &FontImageSize); - FontMetrics = UserReadFile (Argv[2], &FontMetricsSize); + FontImage = UserReadFile (argv[1], &FontImageSize); + FontMetrics = UserReadFile (argv[2], &FontMetricsSize); Result = GuiFontConstruct (&Context, FontImage, FontImageSize, FontMetrics, FontMetricsSize, 1); if (!Result) { DEBUG ((DEBUG_WARN, "BMF: Helvetica failed\n")); diff --git a/Utilities/TestCpuFrequency/CpuFrequency.c b/Utilities/TestCpuFrequency/CpuFrequency.c index 9fea0a28..f2d6001f 100644 --- a/Utilities/TestCpuFrequency/CpuFrequency.c +++ b/Utilities/TestCpuFrequency/CpuFrequency.c @@ -35,8 +35,7 @@ STATIC FREQUENCY_TEST mTests[] = { INT32 ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + void ) { int RetVal; diff --git a/Utilities/TestDiskImage/DiskImage.c b/Utilities/TestDiskImage/DiskImage.c index 911d5543..211f2077 100644 --- a/Utilities/TestDiskImage/DiskImage.c +++ b/Utilities/TestDiskImage/DiskImage.c @@ -15,10 +15,10 @@ #define NUM_EXTENTS 20 -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + int argc, + char *argv[] ) { int Index; @@ -35,22 +35,22 @@ ENTRY_POINT ( UINT32 Index2; OC_APPLE_CHUNKLIST_CONTEXT ChunklistContext; - if (Argc < 2) { + if (argc < 2) { DEBUG ((DEBUG_ERROR, "Please provide a valid Disk Image path\n")); return -1; } - if ((Argc % 2) != 1) { + if ((argc % 2) != 1) { DEBUG ((DEBUG_ERROR, "Please provide a chunklist file for each DMG, enter \'n\' to skip\n")); } - for (Index = 1; Index < (Argc - 1); Index += 2) { + for (Index = 1; Index < (argc - 1); Index += 2) { DmgContextValid = FALSE; Dmg = NULL; Chunklist = NULL; UncompDmg = NULL; - if ((Dmg = UserReadFile (Argv[Index], &DmgSize)) == NULL) { + if ((Dmg = UserReadFile (argv[Index], &DmgSize)) == NULL) { DEBUG ((DEBUG_ERROR, "Read fail\n")); goto ContinueDmgLoop; } @@ -77,8 +77,8 @@ ENTRY_POINT ( DmgContextValid = TRUE; - if (AsciiStrCmp (Argv[Index + 1], "n") != 0) { - if ((Chunklist = UserReadFile (Argv[Index + 1], &ChunklistSize)) == NULL) { + if (AsciiStrCmp (argv[Index + 1], "n") != 0) { + if ((Chunklist = UserReadFile (argv[Index + 1], &ChunklistSize)) == NULL) { DEBUG ((DEBUG_ERROR, "Read fail\n")); goto ContinueDmgLoop; } @@ -150,10 +150,10 @@ ENTRY_POINT ( return 0; } -INT32 +int LLVMFuzzerTestOneInput ( - IN CONST UINT8 *Data, - IN UINTN Size + const uint8_t *Data, + size_t Size ) { #define MAX_INPUT 256 diff --git a/Utilities/TestHelloWorld/HelloWorld.c b/Utilities/TestHelloWorld/HelloWorld.c index e25fb599..ffc1c96a 100644 --- a/Utilities/TestHelloWorld/HelloWorld.c +++ b/Utilities/TestHelloWorld/HelloWorld.c @@ -18,10 +18,9 @@ UefiMain ( return EFI_SUCCESS; } -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + void ) { UefiMain (gImageHandle, gST); diff --git a/Utilities/TestImg4/Img4.c b/Utilities/TestImg4/Img4.c index e96b5688..13bcebf2 100644 --- a/Utilities/TestImg4/Img4.c +++ b/Utilities/TestImg4/Img4.c @@ -188,36 +188,36 @@ VerifyImg4 ( return 0; } -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + int argc, + char *argv[] ) { INT32 RetVal; INT32 Index; - if (Argc < 2 || ((Argc % 3) != 1 && Argc != 2)) { + if (argc < 2 || ((argc % 3) != 1 && argc != 2)) { DEBUG ((DEBUG_ERROR, "Usage: ./Img4 ([image path] [manifest path] [object type])*\n")); DEBUG ((DEBUG_ERROR, "Usage: Img4 [manifest path]\n")); return -1; } - if (Argc == 2) { - return DebugManifest (Argv[1]); + if (argc == 2) { + return DebugManifest (argv[1]); } RetVal = 0; - for (Index = 1; Index < (Argc - 1); Index += 3) { - if (AsciiStrLen (Argv[Index + 2]) != 4) { + for (Index = 1; Index < (argc - 1); Index += 3) { + if (AsciiStrLen (argv[Index + 2]) != 4) { DEBUG ((DEBUG_ERROR, "Object types require exactly 4 characters.\n")); return -1; } RetVal = VerifyImg4 ( - Argv[Index + 0], - Argv[Index + 1], - Argv[Index + 2] + argv[Index + 0], + argv[Index + 1], + argv[Index + 2] ); if (RetVal != 0) { return RetVal; @@ -227,10 +227,10 @@ ENTRY_POINT ( return RetVal; } -INT32 +int LLVMFuzzerTestOneInput ( - IN CONST UINT8 *Data, - IN UINTN Size + const uint8_t *Data, + size_t Size ) { STATIC CONST UINT32 Signatures[] = { diff --git a/Utilities/TestKextInject/KextInject.c b/Utilities/TestKextInject/KextInject.c index 4b4d99bd..cadd4ba4 100644 --- a/Utilities/TestKextInject/KextInject.c +++ b/Utilities/TestKextInject/KextInject.c @@ -799,7 +799,12 @@ int wrap_main(int argc, char** argv) { return 0; } -INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { +int +LLVMFuzzerTestOneInput ( + const uint8_t *Data, + size_t Size + ) +{ UINT32 PrelinkedSize; UINT32 AllocSize; UINT8 *Prelinked; @@ -854,7 +859,12 @@ INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { return 0; } -int ENTRY_POINT(int argc, char *argv[]) { +int +ENTRY_POINT ( + int argc, + char *argv[] + ) +{ int code = wrap_main(argc, argv); if (FailedToProcess) { code = -1; diff --git a/Utilities/TestMacho/Macho.c b/Utilities/TestMacho/Macho.c index 431d4f32..c480337b 100644 --- a/Utilities/TestMacho/Macho.c +++ b/Utilities/TestMacho/Macho.c @@ -271,7 +271,12 @@ static int FeedMacho(void *file, uint32_t size) { return code != 963; } -int ENTRY_POINT(int argc, char** argv) { +int +ENTRY_POINT ( + int argc, + char *argv[] + ) +{ uint32_t f; uint8_t *b; if ((b = UserReadFile(argc > 1 ? argv[1] : "kernel", &f)) == NULL) { @@ -282,7 +287,12 @@ int ENTRY_POINT(int argc, char** argv) { return FeedMacho (b, f); } -INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { +int +LLVMFuzzerTestOneInput ( + const uint8_t *Data, + size_t Size + ) +{ if (Size > 0) { VOID *NewData = AllocatePool (Size); if (NewData) { diff --git a/Utilities/TestMp3/Mp3.c b/Utilities/TestMp3/Mp3.c index 576dde4c..55d381fa 100644 --- a/Utilities/TestMp3/Mp3.c +++ b/Utilities/TestMp3/Mp3.c @@ -25,7 +25,12 @@ #include -int ENTRY_POINT(int argc, char** argv) { +int +ENTRY_POINT ( + int argc, + char *argv[] + ) +{ uint32_t size; uint8_t *buffer; if ((buffer = UserReadFile(argc > 1 ? argv[1] : "test.mp3", &size)) == NULL) { @@ -62,7 +67,12 @@ int ENTRY_POINT(int argc, char** argv) { return 1; } -INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { +int +LLVMFuzzerTestOneInput ( + const uint8_t *Data, + size_t Size + ) +{ if (Size > 0) { void *outbuffer; uint32_t outsize; diff --git a/Utilities/TestPeCoff/PeCoff.c b/Utilities/TestPeCoff/PeCoff.c index d4ee6e3c..4687c96a 100644 --- a/Utilities/TestPeCoff/PeCoff.c +++ b/Utilities/TestPeCoff/PeCoff.c @@ -203,7 +203,12 @@ PeCoffTestLoadFull ( return Status; } -INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { +int +LLVMFuzzerTestOneInput ( + const uint8_t *Data, + size_t Size + ) +{ if (Size == 0) return 0; @@ -229,7 +234,12 @@ INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { return 0; } -int ENTRY_POINT (int argc, char *argv[]) { +int +ENTRY_POINT ( + int argc, + char *argv[] + ) +{ if (argc < 2) { printf ("Please provide a valid PE image path\n"); return -1; diff --git a/Utilities/TestSmbios/Smbios.c b/Utilities/TestSmbios/Smbios.c index 7f9f5459..1eeac009 100644 --- a/Utilities/TestSmbios/Smbios.c +++ b/Utilities/TestSmbios/Smbios.c @@ -69,7 +69,12 @@ bool doDump = false; SMBIOS_TABLE_ENTRY_POINT gSmbios; SMBIOS_TABLE_3_0_ENTRY_POINT gSmbios3; -int ENTRY_POINT(int argc, char** argv) { +int +ENTRY_POINT ( + int argc, + char *argv[] + ) +{ PcdGet32 (PcdFixedDebugPrintErrorLevel) |= DEBUG_INFO; PcdGet32 (PcdDebugPrintErrorLevel) |= DEBUG_INFO; @@ -124,7 +129,12 @@ int ENTRY_POINT(int argc, char** argv) { return 0; } -INT32 LLVMFuzzerTestOneInput(CONST UINT8 *Data, UINTN Size) { +int +LLVMFuzzerTestOneInput ( + const uint8_t *Data, + size_t Size + ) +{ if (Size > 0) { VOID *NewData = AllocatePool (Size); if (NewData) { diff --git a/Utilities/ocpasswordgen/ocpasswordgen.c b/Utilities/ocpasswordgen/ocpasswordgen.c index 0f373baa..dc6ccd14 100644 --- a/Utilities/ocpasswordgen/ocpasswordgen.c +++ b/Utilities/ocpasswordgen/ocpasswordgen.c @@ -9,10 +9,9 @@ #include #include -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + void ) { CHAR8 Char; diff --git a/Utilities/ocvalidate/ocvalidate.c b/Utilities/ocvalidate/ocvalidate.c index 91a41cb0..31a28bc3 100644 --- a/Utilities/ocvalidate/ocvalidate.c +++ b/Utilities/ocvalidate/ocvalidate.c @@ -60,10 +60,10 @@ CheckConfig ( return ErrorCount; } -INT32 +int ENTRY_POINT ( - IN INT32 Argc, - IN CONST CHAR8 *Argv[] + int argc, + char *argv[] ) { UINT8 *ConfigFileBuffer; @@ -88,15 +88,15 @@ ENTRY_POINT ( // // Print usage. // - if (Argc != 2) { - DEBUG ((DEBUG_ERROR, "Usage: %a \n\n", Argv[0])); + if (argc != 2) { + DEBUG ((DEBUG_ERROR, "Usage: %a \n\n", argv[0])); return -1; } // // Read config file (Only one single config is supported). // - ConfigFileName = Argv[1]; + ConfigFileName = argv[1]; ConfigFileBuffer = UserReadFile (ConfigFileName, &ConfigFileSize); if (ConfigFileBuffer == NULL) { DEBUG ((DEBUG_ERROR, "Failed to read %a\n", ConfigFileName)); @@ -152,10 +152,10 @@ ENTRY_POINT ( return 0; } -INT32 +int LLVMFuzzerTestOneInput ( - IN CONST UINT8 *Data, - IN UINTN Size + const uint8_t *Data, + size_t Size ) { VOID *NewData;