00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "global.h"
00026 #ifdef HAVE_HDRSTOP
00027 #pragma hdrstop
00028 #endif
00029
00030 #include "options.h"
00031 #include "perdroptions.h"
00032
00033 PeRdrOption options = {
00034 false,
00035 false,
00036 false,
00037 false,
00038 false,
00039 false,
00040 false,
00041 false,
00042 false,
00043 false,
00044 false,
00045 false,
00046 false,
00047 false,
00048 false
00049 };
00050
00051 static option allOptions[] =
00052 {
00053 { "b\0bytes\0", &options.showBytes, optionBool },
00054 { "\0disable-3dnow\0", &options.disable3DNow, optionBool },
00055 { "\0disable-enh3dnow\0", &options.disableEnh3DNow, optionBool },
00056 { "\0disable-pentium3\0", &options.disableP3, optionBool },
00057 { "\0disable-athlon\0", &options.disableAthlon, optionBool },
00058 { "\0version\0", &options.showVersion, optionBool },
00059 { "\0help\0", &options.showHelp, optionBool },
00060 { "\0show-priority\0", &options.showPriority, optionBool },
00061 { "\0raw-dump\0", &options.rawDumping, optionBool },
00062 { "\0extract-icon-resource\0", &options.extractIconRes, optionBool },
00063 { "\0show-headers\0", &options.showHeaders, optionBool },
00064 { "\0show-imports\0", &options.showImports, optionBool },
00065 { "\0show-relocations\0", &options.showRelocations, optionBool },
00066 { "\0show-exports\0", &options.showExports, optionBool },
00067 { "\0show-resources\0", &options.showResources, optionBool },
00068 { "\0show-code\0", &options.showCode, optionBool },
00069 { NULL, NULL, optionBool }
00070 };
00071
00072 int ReadOptions(int argc,char** argv)
00073 {
00074
00075 int res = get_options(argc,argv,allOptions);
00076
00077
00078 if (options.disable3DNow)
00079 options.disableEnh3DNow = true;
00080
00081 if (!options.showHeaders && !options.showImports && !options.showRelocations
00082 && !options.showExports && !options.showCode
00083 && !options.showResources)
00084 {
00085 options.showHeaders = true;
00086 options.showImports = true;
00087 options.showRelocations = true;
00088 options.showExports = true;
00089 options.showCode = true;
00090 options.showResources = true;
00091 }
00092
00093 return res;
00094 }