#include <string.h>\r
#include <stdlib.h>\r
\r
+#define UTILITY_NAME "GenTEImage"\r
+#define UTILITY_MAJOR_VERSION 0\r
+#define UTILITY_MINOR_VERSION 1\r
+\r
+void\r
+Version (\r
+ void\r
+ )\r
+/*++\r
+Routine Description:\r
+ print version information for this utility\r
+\r
+Arguments:\r
+ None\r
+\r
+Returns:\r
+ None\r
+--*/\r
+// GC_TODO: void - add argument and description to function comment\r
+{\r
+ //\r
+ // print usage of command\r
+ //\r
+ printf ("%s v%d.%d -Utility to zero the Debug Data Fields of Portable Executable (PE) format file.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
void\r
-PrintUsage (\r
+Usage (\r
void\r
)\r
/*++\r
--*/\r
// GC_TODO: void - add argument and description to function comment\r
{\r
+ Version();\r
//\r
// print usage of command\r
//\r
FILE *fpData;\r
char DataFile[1024] = "";\r
\r
- //\r
- // check the number of parameters\r
- //\r
- if (argc < 2) {\r
- printf ("\nUsage: ZeroDebugData <PE-File> [DebugData-File]\n");\r
+ if (argc == 1) {\r
+ Usage();\r
return -1;\r
}\r
+ \r
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
+ Usage();\r
+ return -1;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+ Version();\r
+ return -1;\r
+ }\r
+\r
+ if (argc == 2) {\r
+ Usage();\r
+ return -1;\r
+ }\r
+\r
//\r
// open the DebugData file, if not exists, return\r
//\r