Example #1
0
File: Job.cs Project: 0x0mar/Xploit
        /// <summary>
        /// Create a new job
        /// </summary>
        /// <param name="cmd">Command</param>
        /// <param name="obj">Object for dispose</param>
        public static Job Create(IModule module, IJobable obj)
        {
            if (module == null || obj == null) return null;

            Job j = new Job(obj, module.FullPath);
            // Append to global list
            JobCollection.Current.Add(j);

            module.WriteInfo(Lang.Get("Job_Created"), j.Id.ToString(), ConsoleColor.Green);
            return j;
        }
Example #2
0
        public void cmdUse(string args)
        {
            if (string.IsNullOrEmpty(args))
            {
                _Current = null;
                args = "";
            }
            else
            {
                args = args.Trim();

                _CurrentGlobal = null;
                if (_CurrentGlobal == null) _CurrentGlobal = ModuleCollection.Current.GetByFullPath(args, false);
                if (_CurrentGlobal == null) _CurrentGlobal = PayloadCollection.Current.GetByFullPath(args, false);

                if (_CurrentGlobal != null)
                {
                    _Current = (IModule)ReflectionHelper.Clone(_CurrentGlobal, true);

                    if (_Current != null && _Current is Module)
                    {
                        ((Module)_Current).Prepare(_IO);
                    }
                }
                else
                {
                    _Current = null;
                }
            }

            if (_Current == null) _IO.WriteError(Lang.Get(string.IsNullOrEmpty(args) ? "Command_Incomplete" : "Module_Not_Found", args));
            //else
            //{
            //    _Command.PromptCharacter = _Current.Name + "> ";
            //}
        }
Example #3
0
 public void cmdCD(string args)
 {
     _Current = null;
     //_Command.PromptCharacter = "> ";
 }