Inheritance: Common.StartupArgs
Beispiel #1
0
 // selects type-dependent args validation
 private static void ValidateArgs(OperationArgs args)
 {
     if (args is ExtractArgs)
     {
         ValidateExtractArgs((ExtractArgs)args);
     }
     else if (args is InjectArgs)
     {
         ValidateInjectArgs((InjectArgs)args);
     }
     else if (args is DeleteArgs)
     {
         ValidateDeleteArgs((DeleteArgs)args);
     }
 }
Beispiel #2
0
 // selects args type-dependent write logic
 private static void WriteOutput(OperationArgs args)
 {
     if (args is ExtractArgs)
     {
         WriteExtractOutput((ExtractArgs)args);
     }
     else if (args is InjectArgs)
     {
         WriteInjectOutput((InjectArgs)args);
     }
     else if (args is DeleteArgs)
     {
         WriteDeleteOutput((DeleteArgs)args);
     }
 }
Beispiel #3
0
        private static void ValidateOperationArgs(OperationArgs args)
        {
            // source pe file should exist
            if (!File.Exists(args.SourcePath))
            {
                var message = string.Format(Localization.ValidateArgsSourceFile, args.SourcePath);
                throw new IOException(message);
            }

            // output pe file should not exist
            if (args.SourcePath != args.OutputPath && File.Exists(args.OutputPath))
            {
                var message = string.Format(Localization.ValidateArgsOutputFile, args.OutputPath);
                throw new IOException(message);
            }
        }
Beispiel #4
0
 // selects args type-dependent write logic
 private static void WriteOutput(OperationArgs args)
 {
     if (args is ExtractArgs)
         WriteExtractOutput((ExtractArgs)args);
     else if (args is InjectArgs)
         WriteInjectOutput((InjectArgs)args);
     else if (args is DeleteArgs)
         WriteDeleteOutput((DeleteArgs)args);
 }
Beispiel #5
0
        private static void ValidateOperationArgs(OperationArgs args)
        {
            // source pe file should exist
            if (!File.Exists(args.SourcePath))
            {
                var message = string.Format(Localization.ValidateArgsSourceFile, args.SourcePath);
                throw new IOException(message);
            }

            // output pe file should not exist
            if (args.SourcePath != args.OutputPath && File.Exists(args.OutputPath))
            {
                var message = string.Format(Localization.ValidateArgsOutputFile, args.OutputPath);
                throw new IOException(message);
            }
        }
Beispiel #6
0
 // selects type-dependent args validation
 private static void ValidateArgs(OperationArgs args)
 {
     if (args is ExtractArgs)
         ValidateExtractArgs((ExtractArgs)args);
     else if (args is InjectArgs)
         ValidateInjectArgs((InjectArgs)args);
     else if (args is DeleteArgs)
         ValidateDeleteArgs((DeleteArgs)args);
 }