Exemplo n.º 1
0
        public override void Trigger(object os_obj)
        {
            OS os = (OS)os_obj;

            if ((double)this.Delay <= 0.0)
            {
                Computer computer = Programs.getComputer(os, this.TargetComp);
                if (computer == null)
                {
                    return;
                }
                if (string.IsNullOrWhiteSpace(this.NewIP) || this.NewIP.StartsWith("#RANDOM"))
                {
                    this.NewIP = NetworkMap.generateRandomIP();
                }
                computer.ip = this.NewIP;
            }
            else
            {
                Computer computer = Programs.getComputer(os, this.DelayHost);
                if (computer == null)
                {
                    throw new NullReferenceException("Computer " + (object)computer + " could not be found as DelayHost for Function");
                }
                float delay = this.Delay;
                this.Delay = -1f;
                DelayableActionSystem.FindDelayableActionSystemOnComputer(computer).AddAction((SerializableAction)this, delay);
            }
        }
Exemplo n.º 2
0
 private static bool GeneratedPositionIsValid(Vector2 position, NetworkMap netMap)
 {
     if (position.X < 0.0 || position.X > 1.0 || (position.Y < 0.0 || position.Y > 1.0))
     {
         return(false);
     }
     return(!netMap.collides(position, -1f));
 }
Exemplo n.º 3
0
 private static bool GeneratedPositionIsValid(Vector2 position, NetworkMap netMap, bool ignoreNetmap = false)
 {
     if ((double)position.X < 0.0 || (double)position.X > 1.0 || (double)position.Y < 0.0 || (double)position.Y > 1.0)
     {
         return(false);
     }
     return(ignoreNetmap || !netMap.collides(position, -1f));
 }
Exemplo n.º 4
0
 private void generateName()
 {
     string[] companyName = NameGenerator.generateCompanyName();
     this.name         = companyName[0];
     this.postfix      = companyName[1];
     this.ipSubstring  = NetworkMap.generateRandomIP();
     this.ipSubstring  = this.ipSubstring.Substring(this.ipSubstring.Length - this.ipSubstring.LastIndexOf('.'));
     this.ipSubstring += ".";
 }
Exemplo n.º 5
0
        private void CompleteAndReturnToMenu()
        {
            this.os.Flags.AddFlag("Victory");
            Programs.disconnect(new string[0], this.os);
            Computer computer = Programs.getComputer(this.os, "porthackHeart");

            this.os.netMap.visibleNodes.Remove(this.os.netMap.nodes.IndexOf(computer));
            computer.disabled = true;
            computer.daemons.Clear();
            computer.ip = NetworkMap.generateRandomIP();
            this.os.terminal.inputLocked = false;
            this.os.ram.inputLocked      = false;
            this.os.netMap.inputLocked   = false;
            this.os.DisableTopBarButtons = false;
            this.os.canRunContent        = true;
            this.IsActive = false;
            ComputerLoader.loadMission("Content/Missions/CreditsMission.xml", false);
            this.os.threadedSaveExecute(false);
            MediaPlayer.IsRepeating = true;
            MusicManager.playSongImmediatley("Music\\Bit(Ending)");
            if (Settings.isPirateBuild)
            {
                this.os.delayer.Post(ActionDelayer.Wait(15.0), (Action)(() =>
                {
                    try
                    {
                        ComputerLoader.loadMission("Content/Missions/CreditsMission_p.xml", false);
                    }
                    catch (Exception ex)
                    {
                    }
                }));
            }
            if (!Settings.sendsDLC1PromoEmailAtEnd)
            {
                return;
            }
            this.os.delayer.Post(ActionDelayer.Wait(30.0), (Action)(() =>
            {
                try
                {
                    string body = Utils.readEntireFile("Content/LocPost/DLCMessage.txt");
                    string subject = "Labyrinths";
                    string sender = "Matt Trobbiani";
                    string email = MailServer.generateEmail(subject, body, sender);
                    MailServer daemon = this.os.netMap.mailServer.getDaemon(typeof(MailServer)) as MailServer;
                    if (daemon == null)
                    {
                        return;
                    }
                    daemon.addMail(email, this.os.defaultUser.name);
                }
                catch (Exception ex)
                {
                }
            }));
        }
Exemplo n.º 6
0
        private void generateName()
        {
            var strArray = NameGenerator.generateCompanyName();

            name         = strArray[0];
            postfix      = strArray[1];
            ipSubstring  = NetworkMap.generateRandomIP();
            ipSubstring  = ipSubstring.Substring(ipSubstring.Length - ipSubstring.LastIndexOf('.'));
            ipSubstring += ".";
        }
Exemplo n.º 7
0
        public static object generateComputer(int secLevel, string name = null)
        {
            if (name == null)
            {
                name = NameGenerator.generateName();
            }
            Computer computer = new Computer(name, NetworkMap.generateRandomIP(), OS.currentInstance.netMap.getRandomPosition(), secLevel, (byte)2, OS.currentInstance);

            if ((double)computer.traceTime <= 0.0)
            {
                computer.traceTime = 10f * Computer.BASE_TRACE_TIME;
            }
            return((object)computer);
        }
Exemplo n.º 8
0
        public void randomizeNetwork()
        {
            for (int index = 0; index < 10; ++index)
            {
                this.nodes.Add(new Computer(NameGenerator.generateName(), NetworkMap.generateRandomIP(), new Vector2((float)Utils.random.NextDouble() * (float)this.bounds.Width, (float)Utils.random.NextDouble() * (float)this.bounds.Height), Utils.random.Next(0, 4), Utils.randomCompType(), this.os));
            }
            int num1 = 2;

            for (int index1 = 0; index1 < this.nodes.Count; ++index1)
            {
                int num2 = num1 + Utils.random.Next(0, 2);
                for (int index2 = 0; index2 < num2; ++index2)
                {
                    this.nodes[index1].links.Add(Utils.random.Next(0, this.nodes.Count - 1));
                }
            }
        }
Exemplo n.º 9
0
        private void DrawIPEntryScreen(Rectangle bounds, SpriteBatch sb)
        {
            TextItem.doFontLabel(new Vector2(bounds.X + 30, bounds.Y + 20), "IP Entry :: " + scannedComputer.ip,
                                 GuiData.font, Color.White, bounds.Width, float.MaxValue);
            TextItem.doFontLabel(new Vector2(bounds.X + 30, bounds.Y + 70),
                                 "Identified as :\"" + scannedComputer.name + "\"", GuiData.smallfont, Color.White, bounds.Width,
                                 float.MaxValue);
            sb.Draw(os.display.GetComputerImage(scannedComputer), new Vector2(bounds.X + 30, bounds.Y + 100),
                    Color.White);
            var x  = bounds.X + 30 + 130;
            var y1 = bounds.Y + 100;

            if (Button.doButton(3388301, x, y1, bounds.Width - 180, 30, "Assign New IP", os.brightUnlockedColor))
            {
                bool flag;
                do
                {
                    scannedComputer.ip = NetworkMap.generateRandomIP();
                    flag = false;
                    for (var index = 0; index < os.netMap.nodes.Count; ++index)
                    {
                        if (os.netMap.nodes[index].ip == scannedComputer.ip &&
                            os.netMap.nodes[index].idName != scannedComputer.idName)
                        {
                            flag = true;
                        }
                    }
                } while (flag);
                if (os.thisComputer.idName == scannedComputer.idName)
                {
                    os.thisComputerIPReset();
                }
            }
            var y2 = y1 + 34;

            if (Button.doButton(3388304, x, y2, bounds.Width - 180, 30,
                                "Flag for Inspection" + (inspectionFlagged ? " : ACTIVE" : ""),
                                inspectionFlagged ? Color.Gray : os.highlightColor))
            {
                inspectionFlagged = true;
            }
            var y3 = y2 + 34;

            Button.doButton(3388308, x, y3, bounds.Width - 180, 30, "Pioritize Routing", os.highlightColor);
            drawBackButton(bounds, ISPDaemonState.Welcome);
        }
Exemplo n.º 10
0
        private void DrawIPEntryScreen(Rectangle bounds, SpriteBatch sb)
        {
            TextItem.doFontLabel(new Vector2((float)(bounds.X + 30), (float)(bounds.Y + 20)), LocaleTerms.Loc("IP Entry") + " :: " + this.scannedComputer.ip, GuiData.font, new Color?(Color.White), (float)bounds.Width, float.MaxValue, false);
            TextItem.doFontLabel(new Vector2((float)(bounds.X + 30), (float)(bounds.Y + 70)), LocaleTerms.Loc("Identified as") + " :\"" + this.scannedComputer.name + "\"", GuiData.smallfont, new Color?(Color.White), (float)bounds.Width, float.MaxValue, false);
            sb.Draw(this.os.display.GetComputerImage(this.scannedComputer), new Vector2((float)(bounds.X + 30), (float)(bounds.Y + 100)), Color.White);
            int x  = bounds.X + 30 + 130;
            int y1 = bounds.Y + 100;

            if (Button.doButton(3388301, x, y1, bounds.Width - 180, 30, LocaleTerms.Loc("Assign New IP"), new Color?(this.os.brightUnlockedColor)))
            {
                bool flag;
                do
                {
                    this.scannedComputer.ip = NetworkMap.generateRandomIP();
                    flag = false;
                    for (int index = 0; index < this.os.netMap.nodes.Count; ++index)
                    {
                        if (this.os.netMap.nodes[index].ip == this.scannedComputer.ip && this.os.netMap.nodes[index].idName != this.scannedComputer.idName)
                        {
                            flag = true;
                        }
                    }
                }while (flag);
                if (this.os.thisComputer.idName == this.scannedComputer.idName)
                {
                    this.os.thisComputerIPReset();
                }
            }
            int y2 = y1 + 34;

            if (Button.doButton(3388304, x, y2, bounds.Width - 180, 30, LocaleTerms.Loc("Flag for Inspection") + (this.inspectionFlagged ? " : " + LocaleTerms.Loc("ACTIVE") : ""), new Color?(this.inspectionFlagged ? Color.Gray : this.os.highlightColor)))
            {
                this.inspectionFlagged = true;
            }
            int y3 = y2 + 34;

            if (!Button.doButton(3388308, x, y3, bounds.Width - 180, 30, LocaleTerms.Loc("Prioritize Routing"), new Color?(this.os.highlightColor)))
            {
                ;
            }
            this.drawBackButton(bounds, ISPDaemon.ISPDaemonState.Welcome);
        }
Exemplo n.º 11
0
        private void CompleteAndReturnToMenu()
        {
            os.Flags.AddFlag("Victory");
            Programs.disconnect(new string[0], os);
            var computer = Programs.getComputer(os, "porthackHeart");

            os.netMap.visibleNodes.Remove(os.netMap.nodes.IndexOf(computer));
            computer.disabled = true;
            computer.daemons.Clear();
            computer.ip             = NetworkMap.generateRandomIP();
            os.terminal.inputLocked = false;
            os.ram.inputLocked      = false;
            os.netMap.inputLocked   = false;
            os.DisableTopBarButtons = false;
            os.canRunContent        = true;
            IsActive = false;
            ComputerLoader.loadMission("Content/Missions/CreditsMission.xml");
            os.threadedSaveExecute();
            MediaPlayer.IsRepeating = true;
            MusicManager.playSongImmediatley("Music\\Bit(Ending)");
        }
Exemplo n.º 12
0
 public Computer(string compName, string compIP, Vector2 compLocation, int seclevel, byte compType, OS opSystem)
 {
     name          = compName;
     ip            = compIP;
     location      = compLocation;
     type          = compType;
     files         = generateRandomFileSystem();
     idName        = compName.Replace(" ", "_");
     os            = opSystem;
     traceTime     = -1f;
     securityLevel = seclevel;
     adminIP       = NetworkMap.generateRandomIP();
     users         = new List <UserDetail>();
     adminPass     = PortExploits.getRandomPassword();
     users.Add(new UserDetail("admin", adminPass, 1));
     ports     = new List <int>(seclevel);
     portsOpen = new List <byte>(seclevel);
     openPortsForSecurityLevel(seclevel);
     links   = new List <int>();
     daemons = new List <Daemon>();
 }
Exemplo n.º 13
0
        public static void AddEOSComp(XmlReader rdr, Computer compAttatchedTo, object osObj)
        {
            var os       = (OS)osObj;
            var compName = "Unregistered eOS Device";
            var str1     = compAttatchedTo.idName + "_eos";

            if (rdr.MoveToAttribute("name"))
            {
                compName = rdr.ReadContentAsString();
            }
            if (rdr.MoveToAttribute("id"))
            {
                str1 = rdr.ReadContentAsString();
            }
            var device = new Computer(compName, NetworkMap.generateRandomIP(), os.netMap.getRandomPosition(), 0, 5, os);

            device.idName = str1;
            var str2 = "ePhone";

            if (rdr.MoveToAttribute("icon"))
            {
                str2 = rdr.ReadContentAsString();
            }
            device.icon     = str2;
            device.location = compAttatchedTo.location +
                              Corporation.getNearbyNodeOffset(compAttatchedTo.location, Utils.random.Next(12), 12,
                                                              os.netMap);
            device.setAdminPassword("alpine");
            ComputerLoader.loadPortsIntoComputer("22,3659", device);
            device.portsNeededForCrack = 2;
            GenerateEOSFilesystem(device);
            rdr.Read();
            var folder1 = device.files.root.searchForFolder("eos");
            var folder2 = folder1.searchForFolder("notes");
            var folder3 = folder1.searchForFolder("mail");

            while (!(rdr.Name == "eosDevice") || rdr.IsStartElement())
            {
                if (rdr.Name.ToLower() == "note" && rdr.IsStartElement())
                {
                    string nameEntry = null;
                    if (rdr.MoveToAttribute("filename"))
                    {
                        nameEntry = rdr.ReadContentAsString();
                    }
                    var num       = (int)rdr.MoveToContent();
                    var dataEntry = rdr.ReadElementContentAsString().TrimStart();
                    if (nameEntry == null)
                    {
                        var length = dataEntry.IndexOf("\n");
                        if (length == -1)
                        {
                            length = dataEntry.IndexOf("\n");
                        }
                        if (length == -1)
                        {
                            length = dataEntry.Length;
                        }
                        nameEntry = dataEntry.Substring(0, length).Replace(" ", "_").ToLower().Trim() + ".txt";
                    }
                    var fileEntry = new FileEntry(dataEntry, nameEntry);
                    folder2.files.Add(fileEntry);
                }
                if (rdr.Name.ToLower() == "mail" && rdr.IsStartElement())
                {
                    string str3 = null;
                    string str4 = null;
                    if (rdr.MoveToAttribute("username"))
                    {
                        str3 = rdr.ReadContentAsString();
                    }
                    if (rdr.MoveToAttribute("pass"))
                    {
                        str4 = rdr.ReadContentAsString();
                    }
                    var dataEntry = "MAIL ACCOUNT : " + str3 + "\nAccount   :" + str3 + "\nPassword :"******"\nLast Sync :" + DateTime.Now + "\n\n" + Computer.generateBinaryString(512);
                    var nameEntry = str3 + ".act";
                    folder3.files.Add(new FileEntry(dataEntry, nameEntry));
                }
                rdr.Read();
                if (rdr.EOF)
                {
                    break;
                }
            }
            os.netMap.nodes.Add(device);
            ComputerLoader.postAllLoadedActions += () => device.links.Add(os.netMap.nodes.IndexOf(compAttatchedTo));
            if (compAttatchedTo.attatchedDeviceIDs != null)
            {
                compAttatchedTo.attatchedDeviceIDs += ",";
            }
            compAttatchedTo.attatchedDeviceIDs += device.idName;
        }
Exemplo n.º 14
0
        public static Vector2 getNearbyNodeOffsetOld(Vector2 basePos, int positionNumber, int total, NetworkMap map,
                                                     float ExtraSeperationDistance = 0.0f)
        {
            var     num1    = 60;
            var     num2    = 0;
            var     vector2 = Vector2.Zero;
            Vector2 location;

            do
            {
                var num3 = positionNumber + num2;
                var num4 = total;
                while (num3 >= num4)
                {
                    num3 -= num4;
                    num4 += total;
                }
                if (num3 > 0)
                {
                    vector2 = Utils.PolarToCartesian(num3 / (float)num4 * 6.283185f, 1f);
                }
                else
                {
                    vector2.X = 1f;
                }
                vector2.Y *= Y_ASPECT_RATIO_BIAS;
                double num5 = COMPUTER_SEPERATION;
                vector2  = new Vector2(vector2.X * COMPUTER_SEPERATION, vector2.Y * COMPUTER_SEPERATION);
                location = basePos + vector2;
                ++num2;
                TestedPositions.Add(vector2);
            } while ((location.X < 0.0 || location.X > 1.0 || (location.Y < 0.0 || location.Y > 1.0) ||
                      map.collides(location, 0.075f)) && num2 < num1);
            if (num2 >= num1)
            {
                if (ExtraSeperationDistance <= 0.0)
                {
                    return(getNearbyNodeOffsetOld(basePos, positionNumber, total, map, COMPUTER_SEPERATION));
                }
                if (ExtraSeperationDistance <= (double)COMPUTER_SEPERATION)
                {
                    return(getNearbyNodeOffsetOld(basePos, positionNumber, total, map,
                                                  COMPUTER_SEPERATION + COMPUTER_SEPERATION));
                }
                Console.WriteLine("Node had to resort to random");
                vector2 = map.getRandomPosition() - basePos;
            }
            return(vector2);
        }
Exemplo n.º 15
0
        public static Vector2 getNearbyNodeOffset(Vector2 basePos, int positionNumber, int total, NetworkMap map, float extraDistance = 0.0f, bool forceUseThisPosition = false)
        {
            int total1 = total;
            int num1   = positionNumber;

            if (total < 20)
            {
                int   num2 = 30;
                float num3 = (float)positionNumber / (float)total;
                total1 = num2;
                num1   = (int)((double)num3 * (double)num2);
            }
            int num4 = 300;

            for (int index = 0; index < num4; ++index)
            {
                Vector2 positionFromCycle = Corporation.GetOffsetPositionFromCycle(num1 + index, total1, extraDistance);
                if (Corporation.GeneratedPositionIsValid(positionFromCycle + basePos, map, forceUseThisPosition))
                {
                    return(positionFromCycle);
                }
                Corporation.TestedPositions.Add(positionFromCycle + basePos);
            }
            return(map.getRandomPosition() - basePos);
        }
Exemplo n.º 16
0
        public static Vector2 getNearbyNodeOffsetOld(Vector2 basePos, int positionNumber, int total, NetworkMap map, float ExtraSeperationDistance = 0.0f)
        {
            int     num1    = 60;
            int     num2    = 0;
            Vector2 vector2 = Vector2.Zero;
            Vector2 location;

            do
            {
                int num3 = positionNumber + num2;
                int num4 = total;
                while (num3 >= num4)
                {
                    num3 -= num4;
                    num4 += total;
                }
                if (num3 > 0)
                {
                    vector2 = Utils.PolarToCartesian((float)num3 / (float)num4 * 6.283185f, 1f);
                }
                else
                {
                    vector2.X = 1f;
                }
                vector2.Y *= Corporation.Y_ASPECT_RATIO_BIAS;
                float num5 = Corporation.COMPUTER_SEPERATION + ExtraSeperationDistance;
                vector2  = new Vector2(vector2.X * Corporation.COMPUTER_SEPERATION, vector2.Y * Corporation.COMPUTER_SEPERATION);
                location = basePos + vector2;
                ++num2;
                Corporation.TestedPositions.Add(vector2);
            }while (((double)location.X < 0.0 || (double)location.X > 1.0 || ((double)location.Y < 0.0 || (double)location.Y > 1.0) || map.collides(location, 0.075f)) && num2 < num1);
            if (num2 >= num1)
            {
                if ((double)ExtraSeperationDistance <= 0.0)
                {
                    return(Corporation.getNearbyNodeOffsetOld(basePos, positionNumber, total, map, Corporation.COMPUTER_SEPERATION));
                }
                if ((double)ExtraSeperationDistance <= (double)Corporation.COMPUTER_SEPERATION)
                {
                    return(Corporation.getNearbyNodeOffsetOld(basePos, positionNumber, total, map, Corporation.COMPUTER_SEPERATION + Corporation.COMPUTER_SEPERATION));
                }
                vector2 = map.getRandomPosition() - basePos;
            }
            return(vector2);
        }
Exemplo n.º 17
0
        public static Vector2 getNearbyNodeOffset(Vector2 basePos, int positionNumber, int total, NetworkMap map)
        {
            var total1 = total;
            var num1   = positionNumber;

            if (total < 20)
            {
                var num2 = 30;
                var num3 = positionNumber / (float)total;
                total1 = num2;
                num1   = (int)(num3 * (double)num2);
            }
            var num4 = 300;

            for (var index = 0; index < num4; ++index)
            {
                var positionFromCycle = GetOffsetPositionFromCycle(num1 + index, total1);
                if (GeneratedPositionIsValid(positionFromCycle + basePos, map))
                {
                    return(positionFromCycle);
                }
                TestedPositions.Add(positionFromCycle + basePos);
            }
            Console.WriteLine("Node had to resort to random");
            return(map.getRandomPosition() - basePos);
        }
Exemplo n.º 18
0
        public static void runCommand(int value, string name)
        {
            MissionFunctions.assertOS();
            if (name.ToLower().Trim() == "none")
            {
                return;
            }
            if (name.Equals("addRank"))
            {
                if (!OS.TestingPassOnly || MissionFunctions.os.currentFaction != null)
                {
                    MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os);
                    string email = MailServer.generateEmail(LocaleTerms.Loc("Contract Successful"), string.Format(Utils.readEntireFile("Content/LocPost/MissionCompleteEmail.txt"), (object)MissionFunctions.os.currentFaction.getRank(), (object)MissionFunctions.os.currentFaction.getMaxRank(), (object)MissionFunctions.os.currentFaction.name), MissionFunctions.os.currentFaction.name + " ReplyBot");
                    ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name);
                }
                else if (OS.DEBUG_COMMANDS && MissionFunctions.os.currentFaction == null)
                {
                    MissionFunctions.os.write("----------");
                    MissionFunctions.os.write("----------");
                    MissionFunctions.os.write("ERROR IN FUNCTION 'addRank'");
                    MissionFunctions.os.write("Player is not assigned to a faction, so rank cannot be added!");
                    MissionFunctions.os.write("Make sure you have assigned a player a faction with the 'SetFaction' function before using this!");
                    MissionFunctions.os.write("----------");
                    MissionFunctions.os.write("----------");
                }
            }
            else if (name.Equals("addRankSilent"))
            {
                if (OS.TestingPassOnly && MissionFunctions.os.currentFaction == null)
                {
                    return;
                }
                MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os);
            }
            else if (name.StartsWith("addFlags:"))
            {
                foreach (string flag in name.Substring("addFlags:".Length).Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries))
                {
                    MissionFunctions.os.Flags.AddFlag(flag);
                }
                CustomFaction currentFaction = MissionFunctions.os.currentFaction as CustomFaction;
                if (currentFaction == null)
                {
                    return;
                }
                currentFaction.CheckForAllCustomActionsToRun((object)MissionFunctions.os);
            }
            else if (name.StartsWith("removeFlags:"))
            {
                string[] strArray = name.Substring("removeFlags:".Length).Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries);
                for (int index = 0; index < strArray.Length; ++index)
                {
                    if (MissionFunctions.os.Flags.HasFlag(strArray[index]))
                    {
                        MissionFunctions.os.Flags.RemoveFlag(strArray[index]);
                    }
                }
                CustomFaction currentFaction = MissionFunctions.os.currentFaction as CustomFaction;
                if (currentFaction == null)
                {
                    return;
                }
                currentFaction.CheckForAllCustomActionsToRun((object)MissionFunctions.os);
            }
            else if (name.StartsWith("setFaction:"))
            {
                string newFaction = name.Substring("setFaction:".Length);
                bool   flag       = false;
                foreach (KeyValuePair <string, Faction> faction in MissionFunctions.os.allFactions.factions)
                {
                    if (faction.Value.idName.ToLower() == newFaction.ToLower())
                    {
                        MissionFunctions.os.allFactions.setCurrentFaction(newFaction, MissionFunctions.os);
                        flag = true;
                        break;
                    }
                }
                if (!flag && OS.TestingPassOnly)
                {
                    throw new NullReferenceException("Faction " + newFaction + "not found for setFaction action!");
                }
            }
            else if (name.StartsWith("loadConditionalActions:"))
            {
                RunnableConditionalActions.LoadIntoOS(name.Substring("loadConditionalActions:".Length), (object)MissionFunctions.os);
            }
            else if (name.Equals("triggerThemeHackRevenge"))
            {
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(5.0), (Action)(() =>
                {
                    string email = MailServer.generateEmail(LocaleTerms.Loc("Are you Kidding me?"), Utils.readEntireFile("Content/LocPost/NaixEmail.txt"), "*****@*****.**");
                    ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name);
                    MissionFunctions.os.delayer.Post(ActionDelayer.Wait(24.0), (Action)(() =>
                    {
                        try
                        {
                            HackerScriptExecuter.runScript("HackerScripts/ThemeHack.txt", (object)MissionFunctions.os, (string)null, (string)null);
                        }
                        catch (Exception ex)
                        {
                            if (!Settings.recoverFromErrorsSilently)
                            {
                                throw ex;
                            }
                            MissionFunctions.os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT");
                            MissionFunctions.os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY");
                            Console.WriteLine("Critical error loading hacker script - aborting");
                        }
                    }));
                }));
            }
            else if (name.Equals("changeSong"))
            {
                switch (value)
                {
                case 2:
                    MusicManager.transitionToSong("Music\\The_Quickening");
                    break;

                case 3:
                    MusicManager.transitionToSong("Music\\TheAlgorithm");
                    break;

                case 4:
                    MusicManager.transitionToSong("Music\\Ryan3");
                    break;

                case 5:
                    MusicManager.transitionToSong("Music\\Bit(Ending)");
                    break;

                case 6:
                    MusicManager.transitionToSong("Music\\Rico_Puestel-Roja_Drifts_By");
                    break;

                case 7:
                    MusicManager.transitionToSong("Music\\out_run_the_wolves");
                    break;

                case 8:
                    MusicManager.transitionToSong("Music\\Irritations");
                    break;

                case 9:
                    MusicManager.transitionToSong("Music\\Broken_Boy");
                    break;

                case 10:
                    MusicManager.transitionToSong("Music\\Ryan10");
                    break;

                case 11:
                    MusicManager.transitionToSong("Music\\tetrameth");
                    break;

                default:
                    MusicManager.transitionToSong("Music\\Revolve");
                    break;
                }
            }
            else if (name.Equals("entropyEndMissionSetup"))
            {
                MissionFunctions.runCommand(3, "changeSong");
                Computer  comp1      = MissionFunctions.findComp("corp0#IS");
                Computer  comp2      = MissionFunctions.findComp("corp0#MF");
                Computer  comp3      = MissionFunctions.findComp("corp0#BU");
                FileEntry fileEntry1 = new FileEntry(Computer.generateBinaryString(5000), "HacknetOS.rar");
                FileEntry fileEntry2 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Data.xnb");
                FileEntry fileEntry3 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Content.xnb");
                Folder    folder1    = comp1.files.root.folders[2];
                folder1.files.Add(fileEntry1);
                folder1.files.Add(fileEntry2);
                folder1.files.Add(fileEntry3);
                Folder folder2 = comp2.files.root.folders[2];
                folder2.files.Add(fileEntry1);
                folder2.files.Add(fileEntry2);
                folder2.files.Add(fileEntry3);
                FileEntry fileEntry4 = new FileEntry(fileEntry1.data, fileEntry1.name + "_backup");
                FileEntry fileEntry5 = new FileEntry(fileEntry2.data, fileEntry2.name + "_backup");
                FileEntry fileEntry6 = new FileEntry(fileEntry3.data, fileEntry3.name + "_backup");
                Folder    folder3    = comp3.files.root.folders[2];
                folder3.files.Add(fileEntry4);
                folder3.files.Add(fileEntry5);
                folder3.files.Add(fileEntry6);
                comp1.traceTime           = Computer.BASE_TRACE_TIME * 7.5f;
                comp3.traceTime           = Computer.BASE_TRACE_TIME * 7.5f;
                comp2.traceTime           = Computer.BASE_TRACE_TIME * 7.5f;
                comp2.portsNeededForCrack = 3;
                comp1.portsNeededForCrack = 2;
                comp3.portsNeededForCrack = 2;
                Folder folder4 = MissionFunctions.findComp("entropy01").files.root.folders[2];
                folder4.files.Add(new FileEntry(PortExploits.crackExeData[25], "SMTPoverflow.exe"));
                folder4.files.Add(new FileEntry(PortExploits.crackExeData[80], "WebServerWorm.exe"));
            }
            else if (name.Equals("entropyAddSMTPCrack"))
            {
                Folder folder = MissionFunctions.findComp("entropy01").files.root.folders[2];
                bool   flag   = false;
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    if (folder.files[index].data == PortExploits.crackExeData[25] || folder.files[index].name == "SMTPoverflow.exe")
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    folder.files.Add(new FileEntry(PortExploits.crackExeData[25], Utils.GetNonRepeatingFilename("SMTPoverflow", ".exe", folder)));
                }
                MissionFunctions.os.Flags.AddFlag("ThemeHackTransitionAssetsAdded");
            }
            else if (name.Equals("transitionToBitMissions"))
            {
                if (Settings.isDemoMode)
                {
                    MissionFunctions.runCommand(6, "changeSong");
                    if (Settings.isPressBuildDemo)
                    {
                        ComputerLoader.loadMission("Content/Missions/Demo/PressBuild/DemoMission01.xml", false);
                    }
                    else
                    {
                        ComputerLoader.loadMission("Content/Missions/Demo/AvconDemo.xml", false);
                    }
                }
                else
                {
                    ComputerLoader.loadMission("Content/Missions/BitMission0.xml", false);
                }
            }
            else if (name.Equals("entropySendCSECInvite"))
            {
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(6.0), (Action)(() => ComputerLoader.loadMission("Content/Missions/MainHub/Intro/Intro01.xml", false)));
            }
            else if (name.Equals("hubBitSetComplete01"))
            {
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(4.0), (Action)(() => MissionFunctions.runCommand(1, "addRank")));
                MissionFunctions.runCommand(3, "changeSong");
                MissionFunctions.os.Flags.AddFlag("csecBitSet01Complete");
            }
            else if (name.Equals("enTechEnableOfflineBackup"))
            {
                Programs.getComputer(MissionFunctions.os, "EnTechOfflineBackup");
                MissionFunctions.os.Flags.AddFlag("VaporSequencerEnabled");
                Folder folder1 = MissionFunctions.findComp("mainHubAssets").files.root.searchForFolder("bin");
                Folder folder2 = folder1.searchForFolder("Sequencer");
                if (folder2 == null)
                {
                    folder2 = new Folder("Sequencer");
                    folder1.folders.Add(folder2);
                }
                if (folder2.searchForFile("Sequencer.exe") != null)
                {
                    return;
                }
                folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe"));
            }
            else if (name.Equals("rudeNaixResponse"))
            {
                AchievementsManager.Unlock("rude_response", false);
            }
            else if (name.Equals("assignPlayerToHubServerFaction"))
            {
                MissionFunctions.os.allFactions.setCurrentFaction("hub", MissionFunctions.os);
                Computer         computer   = Programs.getComputer(MissionFunctions.os, "mainHub");
                MissionHubServer daemon     = (MissionHubServer)computer.getDaemon(typeof(MissionHubServer));
                UserDetail       userDetail = new UserDetail(MissionFunctions.os.defaultUser.name, "reptile", (byte)3);
                computer.addNewUser(computer.ip, userDetail);
                daemon.addUser(userDetail);
                MissionFunctions.os.homeNodeID        = "mainHub";
                MissionFunctions.os.homeAssetServerID = "mainHubAssets";
                MissionFunctions.runCommand(3, "changeSong");
                MissionFunctions.os.Flags.AddFlag("CSEC_Member");
                AchievementsManager.Unlock("progress_csec", false);
                if (!MissionFunctions.os.HasLoadedDLCContent || !Settings.EnableDLC || MissionFunctions.os.Flags.HasFlag("dlc_complete"))
                {
                    return;
                }
                daemon.AddMissionToListings("Content/DLC/Missions/BaseGameConnectors/Missions/CSEC_DLCConnectorIntro.xml", 1);
            }
            else if (name.Equals("assignPlayerToEntropyFaction"))
            {
                MissionFunctions.runCommand(6, "changeSong");
                MissionFunctions.os.homeNodeID        = "entropy00";
                MissionFunctions.os.homeAssetServerID = "entropy01";
                AchievementsManager.Unlock("progress_entropy", false);
            }
            else if (name.Equals("assignPlayerToLelzSec"))
            {
                MissionFunctions.os.homeNodeID        = "lelzSecHub";
                MissionFunctions.os.homeAssetServerID = "lelzSecHub";
                MissionFunctions.os.Flags.AddFlag("LelzSec_Member");
                AchievementsManager.Unlock("progress_lelz", false);
            }
            else if (name.Equals("lelzSecVictory"))
            {
                AchievementsManager.Unlock("secret_path_complete", false);
            }
            else if (name.Equals("demoFinalMissionEnd"))
            {
                MissionFunctions.os.exes.Clear();
                PostProcessor.EndingSequenceFlashOutActive             = true;
                PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
                MusicManager.stop();
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("Music/Ambient/spiral_gauge_down").Play()));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(3.0), (Action)(() =>
                {
                    PostProcessor.dangerModeEnabled = false;
                    PostProcessor.dangerModePercentComplete = 0.0f;
                    MissionFunctions.os.ExitScreen();
                    MissionFunctions.os.ScreenManager.AddScreen((GameScreen) new DemoEndScreen());
                }));
            }
            else if (name.Equals("demoFinalMissionEndDLC"))
            {
                if (!Settings.isDemoMode)
                {
                    return;
                }
                MissionFunctions.os.exes.Clear();
                PostProcessor.EndingSequenceFlashOutActive             = true;
                PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
                MusicManager.stop();
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.0), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("SFX/BrightFlash").Play()));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.4), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("SFX/TraceKill").Play()));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(1.6), (Action)(() =>
                {
                    MusicManager.playSongImmediatley("DLC/Music/DreamHead");
                    PostProcessor.dangerModeEnabled = false;
                    PostProcessor.dangerModePercentComplete = 0.0f;
                    MissionFunctions.os.ScreenManager.AddScreen((GameScreen) new DemoEndScreen()
                    {
                        StopsMusic = false,
                        IsDLCDemoScreen = true
                    });
                    MissionFunctions.os.ExitScreen();
                }));
            }
            else if (name.Equals("demoFinalMissionStart"))
            {
                MissionFunctions.os.Flags.AddFlag("DemoSequencerEnabled");
                MusicManager.transitionToSong("Music/Ambient/dark_drone_008");
            }
            else if (name.Equals("CSECTesterGameWorldSetup"))
            {
                for (int index = 0; index < PortExploits.services.Count && index < 4; ++index)
                {
                    MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]], PortExploits.cracks[PortExploits.portNums[index]]));
                }
                for (int index = 0; index < 4; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os);
                    c.adminIP = MissionFunctions.os.thisComputer.adminIP;
                    MissionFunctions.os.netMap.nodes.Add(c);
                    MissionFunctions.os.netMap.discoverNode(c);
                }
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                {
                    MissionFunctions.os.allFactions.setCurrentFaction("entropy", MissionFunctions.os);
                    MissionFunctions.os.currentMission = (ActiveMission)null;
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy00"));
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy01"));
                }));
            }
            else if (name.Equals("EntropyFastFowardSetup"))
            {
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], PortExploits.cracks[22]));
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], PortExploits.cracks[21]));
                for (int index = 0; index < 3; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os);
                    c.adminIP = MissionFunctions.os.thisComputer.adminIP;
                    MissionFunctions.os.netMap.nodes.Add(c);
                    MissionFunctions.os.netMap.discoverNode(c);
                }
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                {
                    MissionFunctions.os.allFactions.setCurrentFaction("entropy", MissionFunctions.os);
                    MissionFunctions.os.currentMission = (ActiveMission)null;
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy00"));
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy01"));
                    Computer computer = Programs.getComputer(MissionFunctions.os, "entropy01");
                    UserDetail user = computer.users[0];
                    user.known = true;
                    computer.users[0] = user;
                    MissionFunctions.os.allFactions.factions[MissionFunctions.os.allFactions.currentFaction].playerValue = 2;
                    MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                    {
                        MissionFunctions.os.Flags.AddFlag("eosPathStarted");
                        ComputerLoader.loadMission("Content/Missions/Entropy/StartingSet/eosMissions/eosIntroDelayer.xml", false);
                    }));
                }));
            }
            else if (name.Equals("CSECFastFowardSetup"))
            {
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], PortExploits.cracks[22]));
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], PortExploits.cracks[21]));
                for (int index = 0; index < 3; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os);
                    c.adminIP = MissionFunctions.os.thisComputer.adminIP;
                    MissionFunctions.os.netMap.nodes.Add(c);
                    MissionFunctions.os.netMap.discoverNode(c);
                }
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                {
                    MissionFunctions.runCommand(0, "assignPlayerToHubServerFaction");
                    MissionFunctions.os.currentMission = (ActiveMission)null;
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "mainHub"));
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "mainHubAssets"));
                    Computer computer = Programs.getComputer(MissionFunctions.os, "mainHubAssets");
                    UserDetail user = computer.users[0];
                    user.known = true;
                    computer.users[0] = user;
                }));
            }
            else if (name.Equals("csecAddTraceKill"))
            {
                Folder folder = MissionFunctions.findComp("mainHubAssets").files.root.searchForFolder("bin");
                Folder f      = folder.searchForFolder("TK");
                if (f == null)
                {
                    f = new Folder("TK");
                    folder.folders.Add(f);
                }
                f.files.Add(new FileEntry(FileEncrypter.EncryptString(PortExploits.crackExeData[12], "Vapor Trick Enc.", "NULL", "dx122DX", ".exe"), Utils.GetNonRepeatingFilename("TraceKill", ".dec", f)));
                MissionFunctions.os.Flags.AddFlag("bitPathStarted");
                MissionFunctions.runCommand(10, "changeSong");
            }
            else if (name.Equals("junebugComplete"))
            {
                Computer computer = Programs.getComputer(MissionFunctions.os, "pacemaker01");
                if (computer != null)
                {
                    HeartMonitorDaemon daemon = (HeartMonitorDaemon)computer.getDaemon(typeof(HeartMonitorDaemon));
                    if (daemon != null)
                    {
                        daemon.ForceStopBeepSustainSound();
                    }
                }
                MissionFunctions.runCommand(1, "addRank");
            }
            else if (name.Equals("eosIntroMissionSetup"))
            {
                MissionFunctions.findComp("entropy01").files.root.searchForFolder("bin").files.Add(new FileEntry(PortExploits.crackExeData[13], "eosDeviceScan.exe"));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(8.0), (Action)(() =>
                {
                    string email = MailServer.generateEmail("Fwd: eOS Stuff", Utils.readEntireFile("Content/Post/eosScannerMail.txt"), "vtfx", new List <string>((IEnumerable <string>) new string[1] {
                        "note#%#" + LocaleTerms.Loc("eOS Security Basics") + "#%#" + Utils.readEntireFile("Content/LocPost/eOSNote.txt")
                    }));
                    ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name);
                    MissionFunctions.os.saveGame();
                }));
                MissionFunctions.runCommand(4, "changeSong");
                MissionFunctions.os.saveGame();
            }
            else if (name.Equals("eosIntroEndFunc"))
            {
                MissionFunctions.runCommand(1, "addRank");
                MissionListingServer daemon         = (MissionListingServer)MissionFunctions.findComp("entropy00").getDaemon(typeof(MissionListingServer));
                List <ActiveMission> branchMissions = MissionFunctions.os.branchMissions;
                ActiveMission        m = (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/StartingSet/eosMissions/eosAddedMission.xml");
                daemon.addMisison(m, false);
                MissionFunctions.os.branchMissions = branchMissions;
            }
            else if (name.Equals("changeSongDLC"))
            {
                switch (value)
                {
                case 2:
                    MusicManager.transitionToSong("DLC\\Music\\snidelyWhiplash");
                    break;

                case 3:
                    MusicManager.transitionToSong("DLC\\Music\\Slow_Motion");
                    break;

                case 4:
                    MusicManager.transitionToSong("DLC\\Music\\World_Chase");
                    break;

                case 5:
                    MusicManager.transitionToSong("DLC\\Music\\HOME_Resonance");
                    break;

                case 6:
                    MusicManager.transitionToSong("DLC\\Music\\Remi_Finale");
                    break;

                case 7:
                    MusicManager.transitionToSong("DLC\\Music\\RemiDrone");
                    break;

                case 8:
                    MusicManager.transitionToSong("DLC\\Music\\DreamHead");
                    break;

                case 9:
                    MusicManager.transitionToSong("DLC\\Music\\Userspacelike");
                    break;

                case 10:
                    MusicManager.transitionToSong("DLC\\Music\\CrashTrack");
                    break;

                default:
                    MusicManager.transitionToSong("DLC\\Music\\Remi2");
                    break;
                }
            }
            else if (name.Equals("scanAndStartDLCVenganceHack"))
            {
                Computer comp = MissionFunctions.findComp("dAttackTarget");
                if (comp == null)
                {
                    return;
                }
                Folder folder = comp.files.root.searchForFolder("log");
                bool   flag   = false;
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    if (folder.files[index].data.Contains(MissionFunctions.os.thisComputer.ip))
                    {
                        SARunFunction saRunFunction = new SARunFunction()
                        {
                            DelayHost = "dhs", FunctionName = "triggerDLCHackRevenge", FunctionValue = 1
                        };
                        ((DLCHubServer)Programs.getComputer(MissionFunctions.os, "dhs").getDaemon(typeof(DLCHubServer))).DelayedActions.AddAction((SerializableAction)saRunFunction, 16f);
                        break;
                    }
                }
                if (!flag)
                {
                    MissionFunctions.runCommand(4, "changeSongDLC");
                }
            }
            else if (name.Equals("triggerDLCHackRevenge"))
            {
                try
                {
                    HackerScriptExecuter.runScript("DLC/ActionScripts/Hackers/SystemHack.txt", (object)MissionFunctions.os, (string)null, (string)null);
                }
                catch (Exception ex)
                {
                    if (!Settings.recoverFromErrorsSilently)
                    {
                        throw ex;
                    }
                    MissionFunctions.os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT");
                    MissionFunctions.os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY");
                    Console.WriteLine("Critical error loading hacker script - aborting\r\n" + Utils.GenerateReportFromException(ex));
                }
            }
            else if (name.Equals("activateAircraftStatusOverlay"))
            {
                MissionFunctions.os.AircraftInfoOverlay.Activate();
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true;
            }
            else if (name.Equals("activateAircraftStatusOverlayLabyrinthsMonitoring"))
            {
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true;
            }
            else if (name.Equals("deActivateAircraftStatusOverlay"))
            {
                MissionFunctions.os.AircraftInfoOverlay.IsActive = false;
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = false;
                MissionFunctions.os.Flags.AddFlag("AircraftInfoOverlayDeactivated");
            }
            else if (name.Equals("defAttackAircraft"))
            {
                Computer computer = Programs.getComputer(MissionFunctions.os, "dair_crash");
                Folder   folder   = computer.files.root.searchForFolder("FlightSystems");
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    if (folder.files[index].name == "747FlightOps.dll")
                    {
                        folder.files.RemoveAt(index);
                        break;
                    }
                }
                ((AircraftDaemon)computer.getDaemon(typeof(AircraftDaemon))).StartReloadFirmware();
                if (MissionFunctions.os.AircraftInfoOverlay.IsActive)
                {
                    return;
                }
                MissionFunctions.os.AircraftInfoOverlay.Activate();
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true;
            }
            else if (name.Equals("playAirlineCrashSongSequence"))
            {
                MusicManager.playSongImmediatley("DLC\\Music\\Remi_Finale");
                MediaPlayer.IsRepeating = false;
            }
            else if (name.Equals("flashUI"))
            {
                MissionFunctions.os.warningFlash();
            }
            else if (name.Equals("addRankSilent"))
            {
                MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os);
            }
            else if (name.StartsWith("addRankFaction:"))
            {
                string str = name.Substring("addRankFaction:".Length);
                foreach (KeyValuePair <string, Faction> faction in MissionFunctions.os.allFactions.factions)
                {
                    if (faction.Value.idName.ToLower() == str.ToLower())
                    {
                        faction.Value.addValue(value, (object)MissionFunctions.os);
                        break;
                    }
                }
            }
            else if (name.StartsWith("setHubServer:"))
            {
                string str = name.Substring("setHubServer:".Length);
                MissionFunctions.os.homeNodeID = str;
            }
            else if (name.StartsWith("setAssetServer:"))
            {
                string str = name.Substring("setAssetServer:".Length);
                MissionFunctions.os.homeAssetServerID = str;
            }
            else if (name.StartsWith("playCustomSong:"))
            {
                string songName = Utils.GetFileLoadPrefix() + name.Substring("playCustomSong:".Length);
                if (songName.EndsWith(".ogg"))
                {
                    songName = songName.Substring(0, songName.Length - ".ogg".Length);
                }
                if (songName.StartsWith("Content"))
                {
                    songName = songName.Substring("Content/".Length);
                }
                else if (songName.StartsWith("Extensions"))
                {
                    songName = "../" + songName;
                }
                MusicManager.transitionToSong(songName);
            }
            else if (name.StartsWith("playCustomSongImmediatley:"))
            {
                string songname = Utils.GetFileLoadPrefix() + name.Substring("playCustomSongImmediatley:".Length);
                if (songname.EndsWith(".ogg"))
                {
                    songname = songname.Substring(0, songname.Length - ".ogg".Length);
                }
                if (songname.StartsWith("Content"))
                {
                    songname = songname.Substring("Content/".Length);
                }
                else if (songname.StartsWith("Extensions"))
                {
                    songname = "../" + songname;
                }
                MusicManager.playSongImmediatley(songname);
            }
            else
            {
                if (OS.TestingPassOnly && !string.IsNullOrWhiteSpace(name))
                {
                    throw new FormatException("No Command Function " + name);
                }
                if (MissionFunctions.ReportErrorInCommand != null)
                {
                    MissionFunctions.ReportErrorInCommand("No command found for \"" + name + "\" with value \"" + (object)value + "\"");
                }
            }
        }
Exemplo n.º 19
0
 public override void LoadContent()
 {
     if (canRunContent)
     {
         delayer = new ActionDelayer();
         ComputerLoader.init(this);
         content = ScreenManager.Game.Content;
         username = SaveUserAccountName == null
             ? (Settings.isConventionDemo ? Settings.ConventionLoginName : Environment.UserName)
             : SaveUserAccountName;
         username = FileSanitiser.purifyStringForDisplay(username);
         var compLocation = new Vector2(0.1f, 0.5f);
         if (multiplayer && !isServer)
             compLocation = new Vector2(0.8f, 0.8f);
         ramAvaliable = totalRam;
         var str = !multiplayer || !isServer ? NetworkMap.generateRandomIP() : NetworkMap.generateRandomIP();
         thisComputer = new Computer(username + " PC", NetworkMap.generateRandomIP(), compLocation, 5, 4, this);
         thisComputer.adminIP = thisComputer.ip;
         thisComputer.idName = "playerComp";
         var folder = thisComputer.files.root.searchForFolder("home");
         folder.folders.Add(new Folder("stash"));
         folder.folders.Add(new Folder("misc"));
         var userDetail = thisComputer.users[0];
         userDetail.known = true;
         thisComputer.users[0] = userDetail;
         defaultUser = new UserDetail(username, "password", 1);
         defaultUser.known = true;
         var theme = OSTheme.HacknetBlue;
         if (Settings.isConventionDemo)
         {
             var num = Utils.random.NextDouble();
             if (num < 0.33)
                 theme = OSTheme.HacknetMint;
             else if (num < 0.66)
                 theme = OSTheme.HackerGreen;
         }
         ThemeManager.setThemeOnComputer(thisComputer, theme);
         if (multiplayer)
         {
             thisComputer.addMultiplayerTargetFile();
             sendMessage("newComp #" + thisComputer.ip + "#" + compLocation.X + "#" + compLocation.Y +
                         "#" + 5 + "#" + thisComputer.name);
             multiplayerMissionLoaded = false;
         }
         if (!WillLoadSave)
             People.init();
         modules = new List<Module>();
         exes = new List<ExeModule>();
         shells = new List<ShellExe>();
         shellIPs = new List<string>();
         var viewport = ScreenManager.GraphicsDevice.Viewport;
         var width1 = RamModule.MODULE_WIDTH;
         var height1 = 205;
         var width2 = (int) ((viewport.Width - width1 - 6)*0.4442);
         var num1 = (int) ((viewport.Width - width1 - 6)*0.5558);
         var height2 = viewport.Height - height1 - TOP_BAR_HEIGHT - 6;
         terminal =
             new Terminal(
                 new Rectangle(viewport.Width - 2 - width2, TOP_BAR_HEIGHT, width2,
                     viewport.Height - TOP_BAR_HEIGHT - 2), this);
         terminal.name = "TERMINAL";
         modules.Add(terminal);
         netMap = new NetworkMap(new Rectangle(width1 + 4, viewport.Height - height1 - 2, num1 - 1, height1),
             this);
         netMap.name = "netMap v1.7";
         modules.Add(netMap);
         display = new DisplayModule(new Rectangle(width1 + 4, TOP_BAR_HEIGHT, num1 - 2, height2), this);
         display.name = "DISPLAY";
         modules.Add(display);
         ram =
             new RamModule(
                 new Rectangle(2, TOP_BAR_HEIGHT, width1, ramAvaliable + RamModule.contentStartOffset), this);
         ram.name = "RAM";
         modules.Add(ram);
         for (var index = 0; index < modules.Count; ++index)
             modules[index].LoadContent();
         for (var index = 0; index < 2; ++index)
         {
             if (isServer || !multiplayer)
                 thisComputer.links.Add(index);
             else
                 thisComputer.links.Add(netMap.nodes.Count - 1 - index);
         }
         var flag1 = false;
         if (!WillLoadSave)
         {
             netMap.nodes.Insert(0, thisComputer);
             netMap.visibleNodes.Add(0);
             MusicManager.loadAsCurrentSong("Music\\Revolve");
         }
         else
         {
             loadSaveFile();
             flag1 = true;
             Settings.initShowsTutorial = false;
         }
         if (!multiplayer && !flag1)
         {
             MailServer.shouldGenerateJunk = false;
             netMap.mailServer.addNewUser(thisComputer.ip, defaultUser);
         }
         mailicon = new MailIcon(this, new Vector2(0.0f, 0.0f));
         mailicon.pos.X = viewport.Width - mailicon.getWidth() - 2;
         topBar = new Rectangle(0, 0, viewport.Width, TOP_BAR_HEIGHT - 1);
         crashModule =
             new CrashModule(
                 new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width,
                     ScreenManager.GraphicsDevice.Viewport.Height), this);
         crashModule.LoadContent();
         introTextModule =
             new IntroTextModule(
                 new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width,
                     ScreenManager.GraphicsDevice.Viewport.Height), this);
         introTextModule.LoadContent();
         traceTracker = new TraceTracker(this);
         IncConnectionOverlay = new IncomingConnectionOverlay(this);
         if (allFactions == null)
         {
             allFactions = new AllFactions();
             allFactions.init();
         }
         currentFaction = allFactions.factions[allFactions.currentFaction];
         scanLines = content.Load<Texture2D>("ScanLines");
         cross = content.Load<Texture2D>("Cross");
         cog = content.Load<Texture2D>("Cog");
         saveIcon = content.Load<Texture2D>("SaveIcon");
         beepSound = content.Load<SoundEffect>("SFX/beep");
         if (!multiplayer & !flag1)
             loadMissionNodes();
         if (!flag1)
             MusicManager.playSong();
         if (flag1 || !Settings.slowOSStartup)
         {
             initShowsTutorial = false;
             introTextModule.complete = true;
         }
         inputEnabled = true;
         isLoaded = true;
         fullscreen = new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width,
             ScreenManager.GraphicsDevice.Viewport.Height);
         TraceDangerSequence = new TraceDangerSequence(content, ScreenManager.SpriteBatch, fullscreen, this);
         endingSequence = new EndingSequenceModule(fullscreen, this);
         var flag2 = Settings.slowOSStartup && !flag1;
         var flag3 = Settings.osStartsWithTutorial && (!flag1 || !Flags.HasFlag("TutorialComplete"));
         if (flag2)
         {
             rebootThisComputer();
             if (!Settings.initShowsTutorial)
                 return;
             display.visible = false;
             ram.visible = false;
             netMap.visible = false;
             terminal.visible = true;
         }
         else if (flag3)
         {
             display.visible = false;
             ram.visible = false;
             netMap.visible = false;
             terminal.visible = true;
             terminal.reset();
             Settings.initShowsTutorial = true;
             initShowsTutorial = true;
             if (TestingPassOnly)
                 return;
             execute("FirstTimeInitdswhupwnemfdsiuoewnmdsmffdjsklanfeebfjkalnbmsdakj Init");
         }
         else
         {
             if (!TestingPassOnly)
                 runCommand("connect " + thisComputer.ip);
             if (thisComputer.files.root.searchForFolder("sys").searchForFile("Notes_Reopener.bat") == null)
                 return;
             runCommand("notes");
         }
     }
     else
     {
         if (!multiplayer)
             return;
         initializeNetwork();
     }
 }
Exemplo n.º 20
0
 public static void runCommand(int value, string name)
 {
     assertOS();
     if (name.Equals("addRank"))
     {
         os.currentFaction.addValue(value, os);
         var mail = MailServer.generateEmail("Contract Successful",
             "Congratulations,\nThe client of your recent contract has reported a success, and is pleased with your work.\n" +
             "You are now free to accept further contracts from the contact database.\n" +
             "\nYour Current Ranking is " + os.currentFaction.getRank() + " of " +
             os.currentFaction.getMaxRank() + ".\n" + "\nThankyou,\n -" + os.currentFaction.name,
             os.currentFaction.name + " ReplyBot");
         ((MailServer) os.netMap.mailServer.getDaemon(typeof (MailServer))).addMail(mail, os.defaultUser.name);
     }
     else if (name.StartsWith("addFlags:"))
     {
         foreach (
             var flag in
                 name.Substring("addFlags:".Length)
                     .Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries))
             os.Flags.AddFlag(flag);
     }
     if (name.Equals("triggerThemeHackRevenge"))
         os.delayer.Post(ActionDelayer.Wait(5.0), () =>
         {
             var mail = MailServer.generateEmail("Are you Kidding me?",
                 "Seriously?\n\n" +
                 "You think you can just f**k with my stuff and leave without consequence? Did you think I wouldn't notice?\n" +
                 "\nDid you think I wouldn't FIND you!?\n" +
                 "\nYou're a pathetic scrit kiddie, you couldn't hack a f*****g honeypot without your precious buttons and scrollbars.\n" +
                 "\nSay goodbye to your x-server, idiot." + "\n\nNaix", "*****@*****.**");
             ((MailServer) os.netMap.mailServer.getDaemon(typeof (MailServer))).addMail(mail, os.defaultUser.name);
             os.delayer.Post(ActionDelayer.Wait(24.0), () =>
             {
                 try
                 {
                     HackerScriptExecuter.runScript("ThemeHack.txt", os);
                 }
                 catch (Exception ex)
                 {
                     if (!Settings.recoverFromErrorsSilently)
                         throw ex;
                     os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT");
                     os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY");
                     Console.WriteLine("Critical error loading hacker script - aborting");
                 }
             });
         });
     else if (name.Equals("changeSong"))
     {
         switch (value)
         {
             case 2:
                 MusicManager.transitionToSong("Music\\The_Quickening");
                 break;
             case 3:
                 MusicManager.transitionToSong("Music\\TheAlgorithm");
                 break;
             case 4:
                 MusicManager.transitionToSong("Music\\Ryan3");
                 break;
             case 5:
                 MusicManager.transitionToSong("Music\\Bit(Ending)");
                 break;
             case 6:
                 MusicManager.transitionToSong("Music\\Rico_Puestel-Roja_Drifts_By");
                 break;
             case 7:
                 MusicManager.transitionToSong("Music\\out_run_the_wolves");
                 break;
             case 8:
                 MusicManager.transitionToSong("Music\\Irritations");
                 break;
             case 9:
                 MusicManager.transitionToSong("Music\\Broken_Boy");
                 break;
             case 10:
                 MusicManager.transitionToSong("Music\\Ryan10");
                 break;
             case 11:
                 MusicManager.transitionToSong("Music\\tetrameth");
                 break;
             default:
                 MusicManager.transitionToSong("Music\\Revolve");
                 break;
         }
     }
     else if (name.Equals("entropyEndMissionSetup"))
     {
         runCommand(3, "changeSong");
         var comp1 = findComp("corp0#IS");
         var comp2 = findComp("corp0#MF");
         var comp3 = findComp("corp0#BU");
         var fileEntry1 = new FileEntry(Computer.generateBinaryString(5000), "HacknetOS.rar");
         var fileEntry2 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Data.xnb");
         var fileEntry3 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Content.xnb");
         var folder1 = comp1.files.root.folders[2];
         folder1.files.Add(fileEntry1);
         folder1.files.Add(fileEntry2);
         folder1.files.Add(fileEntry3);
         var folder2 = comp2.files.root.folders[2];
         folder2.files.Add(fileEntry1);
         folder2.files.Add(fileEntry2);
         folder2.files.Add(fileEntry3);
         var fileEntry4 = new FileEntry(fileEntry1.data, fileEntry1.name + "_backup");
         var fileEntry5 = new FileEntry(fileEntry2.data, fileEntry2.name + "_backup");
         var fileEntry6 = new FileEntry(fileEntry3.data, fileEntry3.name + "_backup");
         var folder3 = comp3.files.root.folders[2];
         folder3.files.Add(fileEntry4);
         folder3.files.Add(fileEntry5);
         folder3.files.Add(fileEntry6);
         comp1.traceTime = Computer.BASE_TRACE_TIME*7.5f;
         comp3.traceTime = Computer.BASE_TRACE_TIME*7.5f;
         comp2.traceTime = Computer.BASE_TRACE_TIME*7.5f;
         comp2.portsNeededForCrack = 3;
         comp1.portsNeededForCrack = 2;
         comp3.portsNeededForCrack = 2;
         var folder4 = findComp("entropy01").files.root.folders[2];
         folder4.files.Add(new FileEntry(PortExploits.crackExeData[25], "SMTPoverflow.exe"));
         folder4.files.Add(new FileEntry(PortExploits.crackExeData[80], "WebServerWorm.exe"));
     }
     else if (name.Equals("entropyAddSMTPCrack"))
     {
         var f = findComp("entropy01").files.root.folders[2];
         f.files.Add(new FileEntry(PortExploits.crackExeData[25],
             Utils.GetNonRepeatingFilename("SMTPoverflow", ".exe", f)));
         os.saveGame();
     }
     else if (name.Equals("transitionToBitMissions"))
     {
         if (Settings.isDemoMode)
         {
             runCommand(6, "changeSong");
             if (Settings.isPressBuildDemo)
                 ComputerLoader.loadMission("Content/Missions/Demo/PressBuild/DemoMission01.xml");
             else
                 ComputerLoader.loadMission("Content/Missions/Demo/AvconDemo.xml");
         }
         else
             ComputerLoader.loadMission("Content/Missions/BitMission0.xml");
     }
     else if (name.Equals("entropySendCSECInvite"))
         os.delayer.Post(ActionDelayer.Wait(6.0),
             () => ComputerLoader.loadMission("Content/Missions/MainHub/Intro/Intro01.xml"));
     else if (name.Equals("hubBitSetComplete01"))
     {
         os.delayer.Post(ActionDelayer.Wait(4.0), () => runCommand(1, "addRank"));
         runCommand(3, "changeSong");
         os.Flags.AddFlag("csecBitSet01Complete");
     }
     else if (name.Equals("enTechEnableOfflineBackup"))
     {
         var computer = Programs.getComputer(os, "EnTechOfflineBackup");
         Programs.getComputer(os, "EnTechMainframe").links.Add(os.netMap.nodes.IndexOf(computer));
         os.Flags.AddFlag("VaporSequencerEnabled");
         var folder1 = findComp("mainHubAssets").files.root.searchForFolder("bin");
         var folder2 = folder1.searchForFolder("Sequencer");
         if (folder2 == null)
         {
             folder2 = new Folder("Sequencer");
             folder1.folders.Add(folder2);
         }
         if (folder2.searchForFile("Sequencer.exe") != null)
             return;
         folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe"));
     }
     else if (name.Equals("rudeNaixResponse"))
         AchievementsManager.Unlock("rude_response", false);
     else if (name.Equals("assignPlayerToHubServerFaction"))
     {
         os.allFactions.setCurrentFaction("hub", os);
         var computer = Programs.getComputer(os, "mainHub");
         var missionHubServer = (MissionHubServer) computer.getDaemon(typeof (MissionHubServer));
         var userDetail = new UserDetail(os.defaultUser.name, "reptile", 3);
         computer.addNewUser(computer.ip, userDetail);
         missionHubServer.addUser(userDetail);
         os.homeNodeID = "mainHub";
         os.homeAssetServerID = "mainHubAssets";
         runCommand(3, "changeSong");
         os.Flags.AddFlag("CSEC_Member");
         AchievementsManager.Unlock("progress_csec", false);
     }
     else if (name.Equals("assignPlayerToEntropyFaction"))
     {
         runCommand(6, "changeSong");
         AchievementsManager.Unlock("progress_entropy", false);
     }
     else if (name.Equals("assignPlayerToLelzSec"))
     {
         os.homeNodeID = "lelzSecHub";
         os.homeAssetServerID = "lelzSecHub";
         os.Flags.AddFlag("LelzSec_Member");
         AchievementsManager.Unlock("progress_lelz", false);
     }
     else if (name.Equals("lelzSecVictory"))
         AchievementsManager.Unlock("secret_path_complete", false);
     else if (name.Equals("demoFinalMissionEnd"))
     {
         os.exes.Clear();
         PostProcessor.EndingSequenceFlashOutActive = true;
         PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
         MusicManager.stop();
         os.delayer.Post(ActionDelayer.Wait(0.2),
             () => os.content.Load<SoundEffect>("Music/Ambient/spiral_gauge_down").Play());
         os.delayer.Post(ActionDelayer.Wait(3.0), () =>
         {
             PostProcessor.dangerModeEnabled = false;
             PostProcessor.dangerModePercentComplete = 0.0f;
             os.ExitScreen();
             os.ScreenManager.AddScreen(new DemoEndScreen());
         });
     }
     else if (name.Equals("demoFinalMissionStart"))
     {
         os.Flags.AddFlag("DemoSequencerEnabled");
         MusicManager.transitionToSong("Music/Ambient/dark_drone_008");
     }
     else if (name.Equals("CSECTesterGameWorldSetup"))
     {
         for (var index = 0; index < PortExploits.services.Count && index < 4; ++index)
             os.thisComputer.files.root.folders[2].files.Add(
                 new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]],
                     PortExploits.cracks[PortExploits.portNums[index]]));
         for (var index = 0; index < 4; ++index)
         {
             var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                 os.netMap.getRandomPosition(), 0, 2, os);
             c.adminIP = os.thisComputer.adminIP;
             os.netMap.nodes.Add(c);
             os.netMap.discoverNode(c);
         }
         os.delayer.Post(ActionDelayer.Wait(0.2), () =>
         {
             os.allFactions.setCurrentFaction("entropy", os);
             os.currentMission = null;
             os.netMap.discoverNode(Programs.getComputer(os, "entropy00"));
             os.netMap.discoverNode(Programs.getComputer(os, "entropy01"));
         });
     }
     else if (name.Equals("EntropyFastFowardSetup"))
     {
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22],
             PortExploits.cracks[22]));
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21],
             PortExploits.cracks[21]));
         for (var index = 0; index < 3; ++index)
         {
             var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                 os.netMap.getRandomPosition(), 0, 2, os);
             c.adminIP = os.thisComputer.adminIP;
             os.netMap.nodes.Add(c);
             os.netMap.discoverNode(c);
         }
         os.delayer.Post(ActionDelayer.Wait(0.2), () =>
         {
             os.allFactions.setCurrentFaction("entropy", os);
             os.currentMission = null;
             os.netMap.discoverNode(Programs.getComputer(os, "entropy00"));
             os.netMap.discoverNode(Programs.getComputer(os, "entropy01"));
             var computer = Programs.getComputer(os, "entropy01");
             var userDetail = computer.users[0];
             userDetail.known = true;
             computer.users[0] = userDetail;
             os.allFactions.factions[os.allFactions.currentFaction].playerValue = 2;
             os.delayer.Post(ActionDelayer.Wait(0.2), () =>
             {
                 os.Flags.AddFlag("eosPathStarted");
                 ComputerLoader.loadMission(
                     "Content/Missions/Entropy/StartingSet/eosMissions/eosIntroDelayer.xml");
             });
         });
     }
     else if (name.Equals("CSECFastFowardSetup"))
     {
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22],
             PortExploits.cracks[22]));
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21],
             PortExploits.cracks[21]));
         for (var index = 0; index < 3; ++index)
         {
             var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                 os.netMap.getRandomPosition(), 0, 2, os);
             c.adminIP = os.thisComputer.adminIP;
             os.netMap.nodes.Add(c);
             os.netMap.discoverNode(c);
         }
         os.delayer.Post(ActionDelayer.Wait(0.2), () =>
         {
             runCommand(0, "assignPlayerToHubServerFaction");
             os.currentMission = null;
             os.netMap.discoverNode(Programs.getComputer(os, "mainHub"));
             os.netMap.discoverNode(Programs.getComputer(os, "mainHubAssets"));
             var computer = Programs.getComputer(os, "mainHubAssets");
             var userDetail = computer.users[0];
             userDetail.known = true;
             computer.users[0] = userDetail;
         });
     }
     else if (name.Equals("csecAddTraceKill"))
     {
         var folder = findComp("mainHubAssets").files.root.searchForFolder("bin");
         var f = folder.searchForFolder("TK");
         if (f == null)
         {
             f = new Folder("TK");
             folder.folders.Add(f);
         }
         f.files.Add(
             new FileEntry(
                 FileEncrypter.EncryptString(PortExploits.crackExeData[12], "Vapor Trick Enc.", "NULL", "dx122DX",
                     ".exe"), Utils.GetNonRepeatingFilename("TraceKill", ".dec", f)));
         os.Flags.AddFlag("bitPathStarted");
         runCommand(10, "changeSong");
     }
     else if (name.Equals("junebugComplete"))
     {
         var computer = Programs.getComputer(os, "pacemaker01");
         if (computer != null)
         {
             var heartMonitorDaemon = (HeartMonitorDaemon) computer.getDaemon(typeof (HeartMonitorDaemon));
             if (heartMonitorDaemon != null)
                 heartMonitorDaemon.ForceStopBeepSustainSound();
         }
         runCommand(1, "addRank");
     }
     else if (name.Equals("eosIntroMissionSetup"))
     {
         findComp("entropy01")
             .files.root.searchForFolder("bin")
             .files.Add(new FileEntry(PortExploits.crackExeData[13], "eosDeviceScan.exe"));
         os.delayer.Post(ActionDelayer.Wait(8.0), () =>
         {
             var mail = MailServer.generateEmail("Fwd: eOS Stuff",
                 Utils.readEntireFile("Content/Post/eosScannerMail.txt"), "vtfx", new List<string>(new string[1]
                 {
                     "note#%#eOS Security Basics#%#" +
                     ("1: Get admin access to a computer that you suspect has an eOS device sync'd to it\n" +
                      "2: Run eosdevicescanner.exe\nto scan for paired devices and automatically open connection ports\n" +
                      "3: connect to the revealed device\n" +
                      "3: login with\nuser: \"admin\"\npassword: \"alpine\"\n\n" +
                      "The password is the same for all eOS devices!")
                 }));
             ((MailServer) os.netMap.mailServer.getDaemon(typeof (MailServer))).addMail(mail, os.defaultUser.name);
         });
         runCommand(4, "changeSong");
         os.saveGame();
     }
     else
     {
         if (!name.Equals("eosIntroEndFunc"))
             return;
         runCommand(1, "addRank");
         var missionListingServer =
             (MissionListingServer) findComp("entropy00").getDaemon(typeof (MissionListingServer));
         var list = os.branchMissions;
         var m =
             (ActiveMission)
                 ComputerLoader.readMission(
                     "Content/Missions/Entropy/StartingSet/eosMissions/eosAddedMission.xml");
         missionListingServer.addMisison(m);
         os.branchMissions = list;
     }
 }
Exemplo n.º 21
0
        public static void AddEOSComp(XmlReader rdr, Computer compAttatchedTo, object osObj)
        {
            OS     os       = (OS)osObj;
            string compName = "Unregistered eOS Device";
            string str1     = compAttatchedTo.idName + "_eos";
            bool   flag     = false;

            if (rdr.MoveToAttribute("name"))
            {
                compName = ComputerLoader.filter(rdr.ReadContentAsString());
            }
            if (rdr.MoveToAttribute("id"))
            {
                str1 = rdr.ReadContentAsString();
            }
            if (rdr.MoveToAttribute("empty"))
            {
                flag = rdr.ReadContentAsString().ToLower() == "true";
            }
            string newPass = "******";

            if (rdr.MoveToAttribute("passOverride"))
            {
                newPass = rdr.ReadContentAsString();
            }
            Computer device = new Computer(compName, NetworkMap.generateRandomIP(), os.netMap.getRandomPosition(), 0, (byte)5, os);

            device.idName = str1;
            string str2 = "ePhone";

            if (rdr.MoveToAttribute("icon"))
            {
                str2 = rdr.ReadContentAsString();
            }
            device.icon     = str2;
            device.location = compAttatchedTo.location + Corporation.getNearbyNodeOffset(compAttatchedTo.location, Utils.random.Next(12), 12, os.netMap, 0.0f, false);
            device.setAdminPassword(newPass);
            ComputerLoader.loadPortsIntoComputer("22,3659", (object)device);
            device.portsNeededForCrack = 2;
            EOSComp.GenerateEOSFilesystem(device);
            rdr.Read();
            Folder folder1 = device.files.root.searchForFolder("eos");
            Folder folder2 = folder1.searchForFolder("notes");
            Folder folder3 = folder1.searchForFolder("mail");

            while (!(rdr.Name == "eosDevice") || rdr.IsStartElement())
            {
                if (rdr.Name.ToLower() == "note" && rdr.IsStartElement())
                {
                    string nameEntry = (string)null;
                    if (rdr.MoveToAttribute("filename"))
                    {
                        nameEntry = ComputerLoader.filter(rdr.ReadContentAsString());
                    }
                    int    content   = (int)rdr.MoveToContent();
                    string dataEntry = ComputerLoader.filter(rdr.ReadElementContentAsString().TrimStart());
                    if (nameEntry == null)
                    {
                        int length = dataEntry.IndexOf("\n");
                        if (length == -1)
                        {
                            length = dataEntry.IndexOf("\n");
                        }
                        if (length == -1)
                        {
                            length = dataEntry.Length;
                        }
                        string str3 = dataEntry.Substring(0, length);
                        if (str3.Length > 50)
                        {
                            str3 = str3.Substring(0, 47) + "...";
                        }
                        nameEntry = str3.Replace(" ", "_").Replace(":", "").ToLower().Trim() + ".txt";
                    }
                    FileEntry fileEntry = new FileEntry(dataEntry, nameEntry);
                    folder2.files.Add(fileEntry);
                }
                if (rdr.Name.ToLower() == "mail" && rdr.IsStartElement())
                {
                    string str3 = (string)null;
                    string str4 = (string)null;
                    if (rdr.MoveToAttribute("username"))
                    {
                        str3 = ComputerLoader.filter(rdr.ReadContentAsString());
                    }
                    if (rdr.MoveToAttribute("pass"))
                    {
                        str4 = ComputerLoader.filter(rdr.ReadContentAsString());
                    }
                    string dataEntry = "MAIL ACCOUNT : " + str3 + "\nAccount   :" + str3 + "\nPassword :"******"\nLast Sync :" + DateTime.Now.ToString() + "\n\n" + Computer.generateBinaryString(512);
                    string nameEntry = str3 + ".act";
                    folder3.files.Add(new FileEntry(dataEntry, nameEntry));
                }
                if (rdr.Name.ToLower() == "file" && rdr.IsStartElement())
                {
                    string nameEntry = (string)null;
                    if (rdr.MoveToAttribute("name"))
                    {
                        nameEntry = rdr.ReadContentAsString();
                    }
                    string path = "home";
                    if (rdr.MoveToAttribute("path"))
                    {
                        path = rdr.ReadContentAsString();
                    }
                    int    content   = (int)rdr.MoveToContent();
                    string dataEntry = ComputerLoader.filter(rdr.ReadElementContentAsString()).TrimStart();
                    device.getFolderFromPath(path, true).files.Add(new FileEntry(dataEntry, nameEntry));
                }
                rdr.Read();
                if (rdr.EOF)
                {
                    break;
                }
            }
            if (flag)
            {
                Folder folder4 = folder1.searchForFolder("apps");
                if (folder4 != null)
                {
                    folder4.files.Clear();
                    folder4.folders.Clear();
                }
            }
            os.netMap.nodes.Add(device);
            ComputerLoader.postAllLoadedActions += (Action)(() => device.links.Add(os.netMap.nodes.IndexOf(compAttatchedTo)));
            if (compAttatchedTo.attatchedDeviceIDs != null)
            {
                compAttatchedTo.attatchedDeviceIDs += ",";
            }
            compAttatchedTo.attatchedDeviceIDs += device.idName;
        }
Exemplo n.º 22
0
        public static bool ExecuteProgram(object os_object, string[] arguments)
        {
            var os       = (OS)os_object;
            var strArray = arguments;
            var flag1    = true;

            if (strArray[0].Equals("connect"))
            {
                Programs.connect(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("disconnect") || strArray[0].Equals("dc"))
            {
                Programs.disconnect(strArray, os);
            }
            else if (strArray[0].Equals("ls") || strArray[0].Equals("dir"))
            {
                Programs.ls(strArray, os);
            }
            else if (strArray[0].Equals("cd"))
            {
                Programs.cd(strArray, os);
            }
            else if (strArray[0].Equals("cd.."))
            {
                strArray = new string[2]
                {
                    "cd",
                    ".."
                };
                Programs.cd(strArray, os);
            }
            else if (strArray[0].Equals("cat") || strArray[0].Equals("less"))
            {
                Programs.cat(strArray, os);
            }
            else if (strArray[0].Equals("exe"))
            {
                Programs.execute(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("probe") || strArray[0].Equals("nmap"))
            {
                Programs.probe(strArray, os);
            }
            else if (strArray[0].Equals("scp"))
            {
                Programs.scp(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("scan"))
            {
                Programs.scan(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("rm"))
            {
                Programs.rm(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("mv"))
            {
                Programs.mv(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("ps"))
            {
                Programs.ps(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("kill"))
            {
                Programs.kill(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("reboot"))
            {
                Programs.reboot(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("openCDTray"))
            {
                Programs.opCDTray(strArray, os, true);
                flag1 = false;
            }
            else if (strArray[0].Equals("closeCDTray"))
            {
                Programs.opCDTray(strArray, os, false);
                flag1 = false;
            }
            else if (strArray[0].Equals("replace"))
            {
                Programs.replace2(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("analyze"))
            {
                Programs.analyze(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("solve"))
            {
                Programs.solve(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("clear"))
            {
                Programs.clear(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("upload") || strArray[0].Equals("up"))
            {
                Programs.upload(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("login"))
            {
                Programs.login(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("addnote"))
            {
                Programs.addNote(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals(":(){:|:&};:"))
            {
                ExecuteProgram(os, new string[1]
                {
                    "forkbomb"
                });
            }
            else if (strArray[0].Equals("append"))
            {
                var fileEntry1 = Programs.getCurrentFolder(os).searchForFile(strArray[1]);
                if (fileEntry1 != null)
                {
                    var str1 = "";
                    for (var index = 2; index < strArray.Length; ++index)
                    {
                        str1 = str1 + strArray[index] + " ";
                    }
                    var fileEntry2 = fileEntry1;
                    var str2       = fileEntry2.data + "\n" + str1;
                    fileEntry2.data = str2;
                    flag1           = true;
                    strArray[0]     = "cat";
                    for (var index = 2; index < strArray.Length; ++index)
                    {
                        strArray[index] = "";
                    }
                    Programs.cat(strArray, os);
                }
            }
            else if (strArray[0].Equals("remline"))
            {
                var fileEntry = Programs.getCurrentFolder(os).searchForFile(strArray[1]);
                if (fileEntry != null)
                {
                    var length = fileEntry.data.LastIndexOf('\n');
                    if (length < 0)
                    {
                        length = 0;
                    }
                    fileEntry.data = fileEntry.data.Substring(0, length);
                    flag1          = true;
                    strArray[0]    = "cat";
                    for (var index = 2; index < strArray.Length; ++index)
                    {
                        strArray[index] = "";
                    }
                    Programs.cat(strArray, os);
                }
            }
            else if (strArray[0].Equals("getString"))
            {
                Programs.getString(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("FirstTimeInitdswhupwnemfdsiuoewnmdsmffdjsklanfeebfjkalnbmsdakj"))
            {
                Programs.firstTimeInit(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("chat"))
            {
                var message = "chat " + os.username + " ";
                for (var index = 1; index < strArray.Length; ++index)
                {
                    message = message + strArray[index] + " ";
                }
                if (os.multiplayer)
                {
                    os.sendMessage(message);
                }
                flag1 = false;
            }
            else if ((strArray[0].Equals("exitdemo") || strArray[0].Equals("resetdemo")) && Settings.isDemoMode)
            {
                MusicManager.transitionToSong("Music/Ambient/AmbientDrone_Clipped");
                var mainMenu = new MainMenu();
                os.ScreenManager.AddScreen(mainMenu);
                MainMenu.resetOS();
                os.ExitScreen();
                flag1 = false;
            }
            else if (strArray[0].Equals("fh") && OS.DEBUG_COMMANDS)
            {
                Programs.fastHack(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("ra") && OS.DEBUG_COMMANDS)
            {
                Programs.revealAll(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("deathseq") && OS.DEBUG_COMMANDS)
            {
                os.TraceDangerSequence.BeginTraceDangerSequence();
                flag1 = false;
            }
            else if (strArray[0].Equals("testcredits") && OS.DEBUG_COMMANDS)
            {
                os.endingSequence.IsActive = true;
                flag1 = false;
            }
            else if (strArray[0].Equals("addflag") && OS.DEBUG_COMMANDS)
            {
                if (strArray.Length < 2)
                {
                    os.write("\nFlag to add required\n");
                }
                os.Flags.AddFlag(strArray[1]);
                flag1 = false;
            }
            else if (strArray[0].Equals("addTestEmails") && OS.DEBUG_COMMANDS)
            {
                for (var index = 0; index < 4; ++index)
                {
                    ((MailServer)os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(
                        MailServer.generateEmail(
                            string.Concat("testEmail ", index, " ", Utils.getRandomByte().ToString()), "test", "test"),
                        os.defaultUser.name);
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("dscan") && OS.DEBUG_COMMANDS)
            {
                if (strArray.Length < 2)
                {
                    os.write("\nNode ID Required\n");
                }
                var flag2 = false;
                for (var index = 0; index < os.netMap.nodes.Count; ++index)
                {
                    if (os.netMap.nodes[index].idName.StartsWith(strArray[1]))
                    {
                        os.netMap.discoverNode(os.netMap.nodes[index]);
                        os.netMap.nodes[index].highlightFlashTime = 1f;
                        flag2 = true;
                        break;
                    }
                }
                if (!flag2)
                {
                    os.write("Node ID Not found");
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("testsave") && OS.DEBUG_COMMANDS ||
                     strArray[0].Equals("save!(SJN!*SNL8vAewew57WewJdwl89(*4;;;&!)@&(ak'^&#@J3KH@!*"))
            {
                os.threadedSaveExecute();
                SettingsLoader.writeStatusFile();
                flag1 = false;
            }
            else if (strArray[0].Equals("testload") && OS.DEBUG_COMMANDS)
            {
                flag1 = false;
            }
            else if (strArray[0].Equals("debug") && OS.DEBUG_COMMANDS)
            {
                var num = PortExploits.services.Count;
                if (strArray.Length > 1)
                {
                    try
                    {
                        num = Convert.ToInt32(strArray[1]);
                    }
                    catch (Exception ex)
                    {
                    }
                }
                for (var index = 0; index < PortExploits.services.Count && index < num; ++index)
                {
                    os.thisComputer.files.root.folders[2].files.Add(
                        new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]],
                                      PortExploits.cracks[PortExploits.portNums[index]]));
                }
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[9],
                                                                              PortExploits.cracks[9]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[10],
                                                                              PortExploits.cracks[10]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[11],
                                                                              PortExploits.cracks[11]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[12],
                                                                              PortExploits.cracks[12]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[13],
                                                                              PortExploits.cracks[13]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[14],
                                                                              PortExploits.cracks[14]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[15],
                                                                              PortExploits.cracks[15]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[16],
                                                                              PortExploits.cracks[16]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[17],
                                                                              PortExploits.cracks[17]));
                os.thisComputer.files.root.folders[2].files.Add(
                    new FileEntry(PortExploits.DangerousPacemakerFirmware, "KBT_TestFirmware.dll"));
                os.Flags.AddFlag("dechead");
                os.Flags.AddFlag("decypher");
                os.Flags.AddFlag("csecBitSet01Complete");
                os.Flags.AddFlag("csecRankingS2Pass");
                flag1 = false;
                for (var index = 0; index < 4; ++index)
                {
                    var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                                         os.netMap.getRandomPosition(), 0, 2, os);
                    c.adminIP = os.thisComputer.adminIP;
                    os.netMap.nodes.Add(c);
                    os.netMap.discoverNode(c);
                }
                os.netMap.discoverNode("practiceServer");
                os.netMap.discoverNode("entropy00");
            }
            else if (strArray[0].Equals("flash") && OS.DEBUG_COMMANDS)
            {
                os.traceTracker.start(20f);
                os.warningFlash();
                flag1 = false;
                os.IncConnectionOverlay.Activate();
            }
            else if (strArray[0].Equals("testRevealNodes") && OS.DEBUG_COMMANDS)
            {
                for (var index = 0; index < os.netMap.nodes.Count; ++index)
                {
                    if (Utils.random.NextDouble() < 0.01)
                    {
                        os.netMap.discoverNode(os.netMap.nodes[index]);
                    }
                }
            }
            else if (strArray[0].Equals("dectest") && OS.DEBUG_COMMANDS)
            {
                var str1 = "this is a test message for the encrypter";
                var str2 = FileEncrypter.EncryptString(str1, "header message", "1.2.3.4.5",
                                                       "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongpass", null);
                os.write(str1);
                os.write("  ");
                os.write("  ");
                os.write(str2);
                os.write("  ");
                os.write("  ");
                os.write(
                    FileEncrypter.MakeReplacementsForDisplay(
                        FileEncrypter.DecryptString(str2,
                                                    "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongpass")[2]));
                os.write("  ");
                os.write(
                    FileEncrypter.MakeReplacementsForDisplay(FileEncrypter.DecryptString(str2, "wrongPass")[2] ==
                                                             null
                        ? "NULL"
                        : "CORRECT"));
                os.write("  ");
            }
            else if (strArray[0].Equals("test") && OS.DEBUG_COMMANDS)
            {
                HackerScriptExecuter.runScript("ThemeHack.txt", os);
            }
            else if (strArray[0].Equals("MotIsTheBest") && OS.DEBUG_COMMANDS)
            {
                os.runCommand("probe");
                os.runCommand("exe WebServerWorm 80");
                os.runCommand("exe SSHcrack 22");
                os.runCommand("exe SMTPoverflow 25");
                os.runCommand("exe FTPBounce 21");
            }
            else if (strArray[0].Equals("help") || strArray[0].Equals("Help") ||
                     (strArray[0].Equals("?") || strArray[0].Equals("man")))
            {
                var page = 0;
                if (strArray.Length > 1)
                {
                    try
                    {
                        page = Convert.ToInt32(strArray[1]);
                        if (page > Helpfile.getNumberOfPages())
                        {
                            os.write("Invalid Page Number - Displaying First Page");
                            page = 0;
                        }
                    }
                    catch (FormatException ex)
                    {
                        os.write("Invalid Page Number");
                    }
                    catch (OverflowException ex)
                    {
                        os.write("Invalid Page Number");
                    }
                }
                Helpfile.writeHelp(os, page);
                flag1 = false;
            }
            else
            {
                if (strArray[0] != "")
                {
                    var num = AttemptExeProgramExecution(os, strArray);
                    if (num == 0)
                    {
                        os.write("Execution failed");
                    }
                    else if (num < 0)
                    {
                        os.write("No Command " + strArray[0] + " - Check Syntax\n");
                    }
                }
                flag1 = false;
            }
            if (flag1)
            {
                if (!os.commandInvalid)
                {
                    os.display.command     = strArray[0];
                    os.display.commandArgs = strArray;
                    os.display.typeChanged();
                }
                else
                {
                    os.commandInvalid = false;
                }
            }
            return(flag1);
        }
Exemplo n.º 23
0
        public List <Computer> generateSPNetwork(OS os)
        {
            List <Computer> computerList = new List <Computer>();
            Computer        computer     = new Computer(NameGenerator.generateName(), NetworkMap.generateRandomIP(), this.getRandomPosition(), 0, (byte)2, os);

            computer.idName = "firstGeneratedNode";
            computer.files.root.searchForFolder("bin").files.Add(new FileEntry(Utils.readEntireFile("Content/files/config.txt"), "config.txt"));
            ThemeManager.setThemeOnComputer((object)computer, OSTheme.HackerGreen);
            computerList.Add(computer);
            if (!os.IsDLCConventionDemo)
            {
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[4], "SecurityTracer.exe"));
            }
            return(computerList);
        }
Exemplo n.º 24
0
 private static bool GeneratedPositionIsValid(Vector2 position, NetworkMap netMap)
 {
     if (position.X < 0.0 || position.X > 1.0 || (position.Y < 0.0 || position.Y > 1.0))
         return false;
     return !netMap.collides(position, -1f);
 }
Exemplo n.º 25
0
 public static Vector2 getNearbyNodeOffset(Vector2 basePos, int positionNumber, int total, NetworkMap map)
 {
     var total1 = total;
     var num1 = positionNumber;
     if (total < 20)
     {
         var num2 = 30;
         var num3 = positionNumber/(float) total;
         total1 = num2;
         num1 = (int) (num3*(double) num2);
     }
     var num4 = 300;
     for (var index = 0; index < num4; ++index)
     {
         var positionFromCycle = GetOffsetPositionFromCycle(num1 + index, total1);
         if (GeneratedPositionIsValid(positionFromCycle + basePos, map))
             return positionFromCycle;
         TestedPositions.Add(positionFromCycle + basePos);
     }
     Console.WriteLine("Node had to resort to random");
     return map.getRandomPosition() - basePos;
 }
Exemplo n.º 26
0
 public static Vector2 getNearbyNodeOffsetOld(Vector2 basePos, int positionNumber, int total, NetworkMap map,
     float ExtraSeperationDistance = 0.0f)
 {
     var num1 = 60;
     var num2 = 0;
     var vector2 = Vector2.Zero;
     Vector2 location;
     do
     {
         var num3 = positionNumber + num2;
         var num4 = total;
         while (num3 >= num4)
         {
             num3 -= num4;
             num4 += total;
         }
         if (num3 > 0)
             vector2 = Utils.PolarToCartesian(num3/(float) num4*6.283185f, 1f);
         else
             vector2.X = 1f;
         vector2.Y *= Y_ASPECT_RATIO_BIAS;
         double num5 = COMPUTER_SEPERATION;
         vector2 = new Vector2(vector2.X*COMPUTER_SEPERATION, vector2.Y*COMPUTER_SEPERATION);
         location = basePos + vector2;
         ++num2;
         TestedPositions.Add(vector2);
     } while ((location.X < 0.0 || location.X > 1.0 || (location.Y < 0.0 || location.Y > 1.0) ||
               map.collides(location, 0.075f)) && num2 < num1);
     if (num2 >= num1)
     {
         if (ExtraSeperationDistance <= 0.0)
             return getNearbyNodeOffsetOld(basePos, positionNumber, total, map, COMPUTER_SEPERATION);
         if (ExtraSeperationDistance <= (double) COMPUTER_SEPERATION)
             return getNearbyNodeOffsetOld(basePos, positionNumber, total, map,
                 COMPUTER_SEPERATION + COMPUTER_SEPERATION);
         Console.WriteLine("Node had to resort to random");
         vector2 = map.getRandomPosition() - basePos;
     }
     return vector2;
 }
Exemplo n.º 27
0
        public List <Computer> generateNetwork(OS os)
        {
            List <Computer> computerList1 = new List <Computer>();
            List <Computer> computerList2 = new List <Computer>();
            List <Computer> computerList3 = new List <Computer>();
            int             num1          = 2;
            float           num2          = 0.5f;
            int             num3          = 4;
            int             num4          = 0;
            float           num5          = (float)num1;
            bool            flag1         = false;
            float           x             = (float)((this.bounds.Width - 40) / (num3 * 2 + 3));
            float           num6          = (float)(this.bounds.Height - 30);
            float           y             = 10f;
            Vector2         compLocation  = new Vector2(x, y);
            bool            flag2         = false;

            while (num4 >= 0 || !flag1)
            {
                float num7 = num6 / (num5 + 1f);
                compLocation.Y = num7;
                for (int index1 = 0; index1 < (int)num5; ++index1)
                {
                    Computer computer = new Computer(NameGenerator.generateName(), NetworkMap.generateRandomIP(), compLocation, num4, Utils.flipCoin() ? (byte)1 : (byte)2, os);
                    Utils.random.NextDouble();
                    int index2 = Math.Min(Math.Max(num4, 0), PortExploits.services.Count - 1);
                    computer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index2]], PortExploits.cracks[PortExploits.portNums[index2]]));
                    computerList3.Add(computer);
                    computerList1.Add(computer);
                    compLocation.Y += num7;
                }
                for (int index = 0; index < computerList2.Count; ++index)
                {
                    bool flag3 = index - 1 >= 0 && index < computerList2.Count - 1;
                    bool flag4 = index < computerList3.Count && index < computerList2.Count;
                    bool flag5 = index + 1 < computerList3.Count && index + 1 < computerList2.Count - 1;
                    if (flag3)
                    {
                        computerList3[index - 1].links.Add(computerList1.IndexOf(computerList2[index]));
                        computerList2[index - 1].links.Add(computerList1.IndexOf(computerList3[index]));
                    }
                    if (flag4)
                    {
                        computerList3[index].links.Add(computerList1.IndexOf(computerList2[index]));
                        computerList2[index].links.Add(computerList1.IndexOf(computerList3[index]));
                    }
                    if (flag5)
                    {
                        computerList3[index + 1].links.Add(computerList1.IndexOf(computerList2[index]));
                        computerList2[index + 1].links.Add(computerList1.IndexOf(computerList3[index]));
                    }
                }
                computerList2.Clear();
                for (int index = 0; index < computerList3.Count; ++index)
                {
                    computerList2.Add(computerList3[index]);
                }
                computerList3.Clear();
                compLocation.X += x;
                if (flag1)
                {
                    --num4;
                    num5 -= num2;
                }
                else
                {
                    ++num4;
                    num5 += num2;
                }
                if (num4 > num3)
                {
                    --num4;
                    flag1 = true;
                    num5 += num2;
                }
                flag2 = false;
            }
            if (!os.multiplayer)
            {
                computerList1.AddRange((IEnumerable <Computer>) this.generateGameNodes());
            }
            if (Settings.isDemoMode)
            {
                computerList1.AddRange((IEnumerable <Computer>) this.generateDemoNodes());
            }
            return(computerList1);
        }
Exemplo n.º 28
0
        public static bool ExecuteProgram(object os_object, string[] arguments)
        {
            OS os = (OS)os_object;

            string[] strArray = arguments;
            bool     flag1    = true;

            if (strArray[0].ToLower().Equals("connect"))
            {
                Programs.connect(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("disconnect") || strArray[0].Equals("dc"))
            {
                Programs.disconnect(strArray, os);
            }
            else if (strArray[0].Equals("ls") || strArray[0].Equals("dir"))
            {
                Programs.ls(strArray, os);
            }
            else if (strArray[0].Equals("cd"))
            {
                Programs.cd(strArray, os);
            }
            else if (strArray[0].Equals("cd.."))
            {
                strArray = new string[2] {
                    "cd", ".."
                };
                Programs.cd(strArray, os);
            }
            else if (strArray[0].Equals("cat") || strArray[0].Equals("more") || strArray[0].Equals("less"))
            {
                Programs.cat(strArray, os);
            }
            else if (strArray[0].Equals("exe"))
            {
                Programs.execute(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("probe") || strArray[0].Equals("nmap"))
            {
                Programs.probe(strArray, os);
            }
            else if (strArray[0].Equals("scp"))
            {
                Programs.scp(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("scan"))
            {
                Programs.scan(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("rm") || strArray[0].Equals("del"))
            {
                Programs.rm(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("mv"))
            {
                Programs.mv(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("ps"))
            {
                Programs.ps(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("kill") || strArray[0].Equals("pkill"))
            {
                Programs.kill(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("reboot"))
            {
                Programs.reboot(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("opencdtray"))
            {
                Programs.opCDTray(strArray, os, true);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("closecdtray"))
            {
                Programs.opCDTray(strArray, os, false);
                flag1 = false;
            }
            else if (strArray[0].Equals("replace"))
            {
                Programs.replace2(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("analyze"))
            {
                Programs.analyze(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("solve"))
            {
                Programs.solve(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("clear"))
            {
                Programs.clear(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("upload") || strArray[0].Equals("up"))
            {
                Programs.upload(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("login"))
            {
                Programs.login(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("addnote"))
            {
                Programs.addNote(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals(":(){:|:&};:"))
            {
                ProgramRunner.ExecuteProgram((object)os, new string[1]
                {
                    "forkbomb"
                });
            }
            else if (strArray[0].ToLower().Equals("append"))
            {
                flag1 = false;
                string[] quoteSeperatedArgs = Utils.GetQuoteSeperatedArgs(strArray);
                Folder   currentFolder      = Programs.getCurrentFolder(os);
                if (quoteSeperatedArgs.Length > 1)
                {
                    FileEntry fileEntry1 = currentFolder.searchForFile(quoteSeperatedArgs[1]);
                    int       num        = 2;
                    if (fileEntry1 == null)
                    {
                        fileEntry1 = currentFolder.searchForFile(os.display.commandArgs[1]);
                        if (fileEntry1 == null)
                        {
                            os.write("Usage: append [FILENAME] [LINE TO APPEND]");
                            return(flag1);
                        }
                        os.write("No filename provided");
                        os.write("Assuming active flag file \"" + fileEntry1.name + "\" For editing");
                        if (strArray.Length == 1)
                        {
                            strArray = new string[2]
                            {
                                "append",
                                fileEntry1.name
                            }
                        }
                        ;
                        else
                        {
                            strArray[1] = fileEntry1.name;
                        }
                        num = 1;
                    }
                    if (fileEntry1 != null)
                    {
                        string str1 = "";
                        for (int index = num; index < quoteSeperatedArgs.Length; ++index)
                        {
                            str1 = str1 + quoteSeperatedArgs[index] + " ";
                        }
                        FileEntry fileEntry2 = fileEntry1;
                        string    str2       = fileEntry2.data + "\n" + str1;
                        fileEntry2.data = str2;
                        flag1           = true;
                        strArray[0]     = "cat";
                        strArray[1]     = fileEntry1.name;
                        for (int index = 2; index < strArray.Length; ++index)
                        {
                            strArray[index] = "";
                        }
                        Programs.cat(strArray, os);
                    }
                }
                else
                {
                    os.write("Usage: append [FILENAME] [LINE TO APPEND]");
                    return(flag1);
                }
            }
            else if (strArray[0].Equals("remline"))
            {
                FileEntry fileEntry = Programs.getCurrentFolder(os).searchForFile(strArray[1]);
                if (fileEntry != null)
                {
                    int length = fileEntry.data.LastIndexOf('\n');
                    if (length < 0)
                    {
                        length = 0;
                    }
                    fileEntry.data = fileEntry.data.Substring(0, length);
                    flag1          = true;
                    strArray[0]    = "cat";
                    for (int index = 2; index < strArray.Length; ++index)
                    {
                        strArray[index] = "";
                    }
                    Programs.cat(strArray, os);
                }
            }
            else if (strArray[0].Equals("getString"))
            {
                Programs.getString(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("reloadtheme"))
            {
                FileEntry fileEntry = os.thisComputer.files.root.searchForFolder("sys").searchForFile("x-server.sys");
                if (fileEntry != null)
                {
                    OSTheme themeForDataString = ThemeManager.getThemeForDataString(fileEntry.data);
                    ThemeManager.switchTheme((object)os, themeForDataString);
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("FirstTimeInitdswhupwnemfdsiuoewnmdsmffdjsklanfeebfjkalnbmsdakj"))
            {
                Programs.firstTimeInit(strArray, os, false);
                flag1 = false;
            }
            else if (strArray[0].Equals("chat"))
            {
                string message = "chat " + os.username + " ";
                for (int index = 1; index < strArray.Length; ++index)
                {
                    message = message + strArray[index] + " ";
                }
                if (os.multiplayer)
                {
                    os.sendMessage(message);
                }
                flag1 = false;
            }
            else if ((strArray[0].Equals("exitdemo") || strArray[0].Equals("resetdemo")) && Settings.isDemoMode)
            {
                MusicManager.transitionToSong("Music/Ambient/AmbientDrone_Clipped");
                MainMenu mainMenu = new MainMenu();
                os.ScreenManager.AddScreen((GameScreen)mainMenu);
                MainMenu.resetOS();
                os.ExitScreen();
                OS.currentInstance = (OS)null;
                flag1 = false;
                if (Settings.MultiLingualDemo)
                {
                    LocaleActivator.ActivateLocale("zh-cn", Game1.getSingleton().Content);
                }
            }
            else if (strArray[0].Equals("fh") && OS.DEBUG_COMMANDS)
            {
                Programs.fastHack(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("ra") && OS.DEBUG_COMMANDS)
            {
                Programs.revealAll(strArray, os);
                flag1 = false;
            }
            else if (strArray[0].Equals("deathseq") && OS.DEBUG_COMMANDS)
            {
                os.TraceDangerSequence.BeginTraceDangerSequence();
                flag1 = false;
            }
            else if (strArray[0].Equals("testcredits") && OS.DEBUG_COMMANDS)
            {
                os.endingSequence.IsActive = true;
                flag1 = false;
            }
            else if (strArray[0].Equals("addflag") && OS.DEBUG_COMMANDS)
            {
                if (strArray.Length < 2)
                {
                    os.write("\nFlag to add required\n");
                }
                os.Flags.AddFlag(strArray[1]);
                flag1 = false;
            }
            else if (strArray[0].Equals("addTestEmails") && OS.DEBUG_COMMANDS)
            {
                for (int index = 0; index < 4; ++index)
                {
                    ((MailServer)os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(MailServer.generateEmail("testEmail " + (object)index + " " + Utils.getRandomByte().ToString(), "test", "test"), os.defaultUser.name);
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("dscan") && OS.DEBUG_COMMANDS)
            {
                if (strArray.Length < 2)
                {
                    os.write("\nNode ID Required\n");
                }
                bool flag2 = false;
                for (int index = 0; index < os.netMap.nodes.Count; ++index)
                {
                    if (os.netMap.nodes[index].idName.ToLower().StartsWith(strArray[1].ToLower()))
                    {
                        os.netMap.discoverNode(os.netMap.nodes[index]);
                        os.netMap.nodes[index].highlightFlashTime = 1f;
                        flag2 = true;
                        break;
                    }
                }
                if (!flag2)
                {
                    os.write("Node ID Not found");
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("revmany") && OS.DEBUG_COMMANDS)
            {
                for (int index1 = 0; index1 < 60; ++index1)
                {
                    int index2;
                    do
                    {
                        index2 = Utils.random.Next(os.netMap.nodes.Count);
                    }while (os.netMap.nodes[index2].idName == "mainHub" || os.netMap.nodes[index2].idName == "entropy00" || os.netMap.nodes[index2].idName == "entropy01");
                    os.netMap.discoverNode(os.netMap.nodes[index2]);
                }
                os.netMap.lastAddedNode = os.thisComputer;
                os.homeAssetServerID    = "dhsDrop";
                os.homeNodeID           = "dhs";
                os.netMap.discoverNode(Programs.getComputer(os, "dhs"));
                os.netMap.discoverNode(Programs.getComputer(os, "dhsDrop"));
                flag1 = false;
            }
            else if (strArray[0].ToLower().Equals("reloadext") && OS.DEBUG_COMMANDS)
            {
                if (Settings.IsInExtensionMode)
                {
                    ExtensionLoader.ReloadExtensionNodes((object)os);
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("testsave") && OS.DEBUG_COMMANDS || strArray[0].Equals("save!(SJN!*SNL8vAewew57WewJdwl89(*4;;;&!)@&(ak'^&#@J3KH@!*"))
            {
                os.threadedSaveExecute(false);
                SettingsLoader.writeStatusFile();
                flag1 = false;
            }
            else if (strArray[0].Equals("testload") && OS.DEBUG_COMMANDS)
            {
                flag1 = false;
            }
            else if (strArray[0].Equals("teststrikerhack") && OS.DEBUG_COMMANDS)
            {
                os.delayer.Post(ActionDelayer.Wait(3.0), (Action)(() => MissionFunctions.runCommand(1, "triggerDLCHackRevenge")));
                flag1 = false;
            }
            else if (strArray[0].Equals("linkToCSECPostDLC") && OS.DEBUG_COMMANDS)
            {
                os.execute("dscan mainhub");
                os.allFactions.setCurrentFaction("hub", os);
                os.currentFaction.playerValue = 2;
                os.Flags.AddFlag("dlc_complete");
                os.Flags.AddFlag("dlc_csec_end_facval:0");
                MissionFunctions.runCommand(1, "addRank");
                flag1 = false;
            }
            else if (strArray[0].Equals("debug") && OS.DEBUG_COMMANDS)
            {
                int num = PortExploits.services.Count;
                if (strArray.Length > 1)
                {
                    try
                    {
                        num = Convert.ToInt32(strArray[1]);
                    }
                    catch (Exception ex)
                    {
                    }
                }
                for (int index = 0; index < PortExploits.services.Count && index <= num; ++index)
                {
                    os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]], PortExploits.cracks[PortExploits.portNums[index]]));
                }
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[9], PortExploits.cracks[9]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[10], PortExploits.cracks[10]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[11], PortExploits.cracks[11]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[12], PortExploits.cracks[12]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[13], PortExploits.cracks[13]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[14], PortExploits.cracks[14]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[15], PortExploits.cracks[15]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[16], PortExploits.cracks[16]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[17], PortExploits.cracks[17]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[31], PortExploits.cracks[31]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[33], PortExploits.cracks[33]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[34], PortExploits.cracks[34]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[35], PortExploits.cracks[35]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[36], PortExploits.cracks[36]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[37], PortExploits.cracks[37]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[38], PortExploits.cracks[38]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[39], PortExploits.cracks[39]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[41], PortExploits.cracks[41]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[554], PortExploits.cracks[554]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[40], PortExploits.cracks[40]));
                os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.DangerousPacemakerFirmware, "KBT_TestFirmware.dll"));
                os.Flags.AddFlag("dechead");
                os.Flags.AddFlag("decypher");
                os.Flags.AddFlag("csecBitSet01Complete");
                os.Flags.AddFlag("csecRankingS2Pass");
                os.Flags.AddFlag("CSEC_Member");
                os.Flags.AddFlag("bitPathStarted");
                flag1 = false;
                for (int index = 0; index < 4; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), os.netMap.getRandomPosition(), 0, (byte)2, os);
                    c.adminIP = os.thisComputer.adminIP;
                    os.netMap.nodes.Add(c);
                    os.netMap.discoverNode(c);
                }
                os.netMap.discoverNode("practiceServer");
                os.netMap.discoverNode("entropy00");
            }
            else if (strArray[0].Equals("flash") && OS.DEBUG_COMMANDS)
            {
                os.traceTracker.start(40f);
                os.warningFlash();
                flag1 = false;
                os.IncConnectionOverlay.Activate();
            }
            else if (strArray[0].Equals("cycletheme") && OS.DEBUG_COMMANDS)
            {
                Action <OSTheme> ctheme = (Action <OSTheme>)(theme => ThemeManager.switchTheme((object)os, theme));
                int    next             = 1;
                double delay            = 1.2;
                Action cthemeAct        = (Action)(() =>
                {
                    ctheme((OSTheme)next);
                    next = (next + 1) % 7;
                });
                cthemeAct += (Action)(() => os.delayer.Post(ActionDelayer.Wait(delay), cthemeAct));
                cthemeAct();
            }
            else if (strArray[0].Equals("testdlc") && OS.DEBUG_COMMANDS)
            {
                MissionFunctions.runCommand(0, "demoFinalMissionEndDLC");
                flag1 = false;
            }
            else if (strArray[0].Equals("testircentries") && OS.DEBUG_COMMANDS)
            {
                DLCHubServer daemon = Programs.getComputer(os, "dhs").getDaemon(typeof(DLCHubServer)) as DLCHubServer;
                for (int index = 0; index < 100; ++index)
                {
                    daemon.IRCSystem.AddLog("Test", "Test Message\nMultiline\nMessage", (string)null);
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("testirc") && OS.DEBUG_COMMANDS)
            {
                DLCHubServer daemon = Programs.getComputer(os, "dhs").getDaemon(typeof(DLCHubServer)) as DLCHubServer;
                daemon.IRCSystem.AddLog("Test", "Test Message", (string)null);
                daemon.IRCSystem.AddLog("Channel", "Test Message\nfrom channel", (string)null);
                flag1 = false;
            }
            else if (strArray[0].Equals("flashtest") && OS.DEBUG_COMMANDS)
            {
                if (!PostProcessor.dangerModeEnabled)
                {
                    PostProcessor.dangerModeEnabled         = true;
                    PostProcessor.dangerModePercentComplete = 0.5f;
                }
                else
                {
                    PostProcessor.dangerModeEnabled         = false;
                    PostProcessor.dangerModePercentComplete = 0.0f;
                }
                flag1 = false;
            }
            else if (strArray[0].Equals("dectest") && OS.DEBUG_COMMANDS)
            {
                string str1 = "this is a test message for the encrypter";
                string str2 = FileEncrypter.EncryptString(str1, "header message", "1.2.3.4.5", "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongpass", (string)null);
                os.write(str1);
                os.write("  ");
                os.write("  ");
                os.write(str2);
                os.write("  ");
                os.write("  ");
                os.write(FileEncrypter.MakeReplacementsForDisplay(FileEncrypter.DecryptString(str2, "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongpass")[2]));
                os.write("  ");
                os.write(FileEncrypter.MakeReplacementsForDisplay(FileEncrypter.DecryptString(str2, "wrongPass")[2] == null ? "NULL" : "CORRECT"));
                os.write("  ");
            }
            else if (strArray[0].Equals("test") && OS.DEBUG_COMMANDS)
            {
                ((DLCHubServer)Programs.getComputer(os, "dhs").getDaemon(typeof(DLCHubServer))).AddMission((ActiveMission)ComputerLoader.readMission("Content/DLC/Missions/Attack/AttackMission.xml"), (string)null, false);
            }
            else if (strArray[0].Equals("testtrace") && OS.DEBUG_COMMANDS)
            {
                MissionFunctions.runCommand(1, "triggerDLCHackRevenge");
            }
            else if (strArray[0].Equals("testboot") && OS.DEBUG_COMMANDS)
            {
                os.BootAssitanceModule.IsActive = true;
                os.bootingUp     = false;
                os.canRunContent = false;
                MusicManager.stop();
            }
            else if (strArray[0].Equals("testhhbs") && OS.DEBUG_COMMANDS)
            {
                os.write(HostileHackerBreakinSequence.IsInBlockingHostileFileState((object)os) ? "BLOCKED" : "SAFE");
            }
            else if (strArray[0].Equals("printflags") && OS.DEBUG_COMMANDS)
            {
                os.write(os.Flags.GetSaveString());
            }
            else if (strArray[0].Equals("loseadmin") && OS.DEBUG_COMMANDS)
            {
                os.connectedComp.adminIP = os.connectedComp.ip;
                flag1 = false;
            }
            else if (strArray[0].Equals("runcmd") && OS.DEBUG_COMMANDS)
            {
                if (strArray.Length > 1)
                {
                    string name = strArray[1];
                    int    num  = 0;
                    if (strArray.Length > 2)
                    {
                        num = Convert.ToInt32(strArray[1]);
                    }
                    MissionFunctions.runCommand(num, name);
                }
            }
            else if (strArray[0].ToLower().Equals("runhackscript") && OS.DEBUG_COMMANDS)
            {
                if (strArray.Length > 1)
                {
                    string scriptName = strArray[1];
                    try
                    {
                        HackerScriptExecuter.runScript(scriptName, (object)os, os.thisComputer.ip, os.thisComputer.ip);
                    }
                    catch (Exception ex)
                    {
                        os.write("Error launching script " + scriptName);
                        os.write(Utils.GenerateReportFromExceptionCompact(ex));
                    }
                }
            }
            else if (strArray[0].Equals("MotIsTheBest") && OS.DEBUG_COMMANDS)
            {
                os.runCommand("probe");
                os.runCommand("exe WebServerWorm 80");
                os.runCommand("exe SSHcrack 22");
                os.runCommand("exe SMTPoverflow 25");
                os.runCommand("exe FTPBounce 21");
            }
            else if (strArray[0].Equals("help") || strArray[0].Equals("Help") || strArray[0].Equals("?") || strArray[0].Equals("man"))
            {
                int page = 0;
                if (strArray.Length > 1)
                {
                    try
                    {
                        page = Convert.ToInt32(strArray[1]);
                        if (page > Helpfile.getNumberOfPages())
                        {
                            os.write("Invalid Page Number - Displaying First Page");
                            page = 0;
                        }
                    }
                    catch (FormatException ex)
                    {
                        os.write("Invalid Page Number");
                    }
                    catch (OverflowException ex)
                    {
                        os.write("Invalid Page Number");
                    }
                }
                Helpfile.writeHelp(os, page);
                flag1 = false;
            }
            else
            {
                if (strArray[0] != "")
                {
                    int num = ProgramRunner.AttemptExeProgramExecution(os, strArray);
                    if (num == 0)
                    {
                        os.write("Execution failed");
                    }
                    else if (num < 0)
                    {
                        os.write("No Command " + strArray[0] + " - Check Syntax\n");
                    }
                }
                flag1 = false;
            }
            if (flag1)
            {
                if (!os.commandInvalid)
                {
                    os.display.command     = strArray[0];
                    os.display.commandArgs = strArray;
                    os.display.typeChanged();
                }
                else
                {
                    os.commandInvalid = false;
                }
            }
            return(flag1);
        }