Beispiel #1
0
        public object GenerateWithNoTest(string formatter, InputArgs inputArgs)
        {
            InputArgs tempInputArgs = inputArgs.DeepCopy();

            tempInputArgs.Test = false;
            return(GenerateWithInit(formatter, tempInputArgs));
        }
Beispiel #2
0
        public object SerializeWithNoTest(object payloadObj, string formatter, InputArgs inputArgs)
        {
            InputArgs tempInputArgs = inputArgs.DeepCopy();

            tempInputArgs.Test = false;
            return(SerializeWithInit(payloadObj, formatter, tempInputArgs));
        }
Beispiel #3
0
        public virtual void Init(InputArgs inputArgs)
        {
            // Overridable to provide more flexibility for rare cases
            OptionSet options = Options();

            if (options != null)
            {
                InputArgs tempInputArgs = inputArgs.DeepCopy();

                if (tempInputArgs.ExtraInternalArguments.Count > 0)
                {
                    // This means it is an internal call from other gadgets or plugins so current ExtraArguments becomes irrelevant and ExtraInternalArguments are important
                    tempInputArgs.ExtraArguments         = tempInputArgs.ExtraInternalArguments;
                    tempInputArgs.ExtraInternalArguments = new List <string>(); // Clearing the list to prevent double use just in case!
                }

                try
                {
                    List <String> extraArguments = Options().Parse(tempInputArgs.ExtraArguments);
                }
                catch (OptionException e)
                {
                    Console.Write("ysoserial: ");
                    Console.WriteLine(e.Message);
                    Console.WriteLine("Extra options for " + Name() + " are as follows:");
                    options.WriteOptionDescriptions(Console.Out);
                    System.Environment.Exit(-1);
                }
            }
        }