Exemplo n.º 1
0
        public static void UpgradeSession(object osobj, bool needsNodeInjection)
        {
            OS os = (OS)osobj;

            MemoryDumpInjector.InjectMemory(LocalizedFileLoader.GetLocalizedFilepath("Content/DLC/Missions/Injections/MemoryDumps/GibsonLink.xml"), (object)Programs.getComputer(os, "polarSnakeDest"));
            MemoryDumpInjector.InjectMemory(LocalizedFileLoader.GetLocalizedFilepath("Content/DLC/Missions/Injections/MemoryDumps/NaixHome.xml"), (object)Programs.getComputer(os, "naixGateway"));
            MemoryDumpInjector.InjectMemory(LocalizedFileLoader.GetLocalizedFilepath("Content/DLC/Missions/Injections/MemoryDumps/BitDropBox.xml"), (object)Programs.getComputer(os, "BitWorkServer"));
            MemoryDumpInjector.InjectMemory(LocalizedFileLoader.GetLocalizedFilepath("Content/DLC/Missions/Injections/MemoryDumps/ExpandKeysInjection.xml"), (object)Programs.getComputer(os, "portcrack01"));
            if (os.thisComputer.Memory == null)
            {
                os.thisComputer.Memory = new MemoryContents();
            }
            os.allFactions.factions.Add("Bibliotheque", (Faction)CustomFaction.ParseFromFile("Content/DLC/DLCFaction.xml"));
            if (needsNodeInjection)
            {
                if (People.all == null)
                {
                    People.init();
                }
                else if (!People.PeopleWereGeneratedWithDLCAdditions)
                {
                    People.LoadInDLCPeople();
                }
                List <string> dlcList = BootLoadList.getDLCList();
                for (int index = 0; index < dlcList.Count; ++index)
                {
                    Computer.loadFromFile(dlcList[index]);
                }
                ComputerLoader.postAllLoadedActions();
            }
            Computer computer = Programs.getComputer(os, "ispComp");

            if (!computer.ports.Contains(443))
            {
                computer.ports.Add(443);
            }
            if (computer.ports.Contains(6881))
            {
                return;
            }
            computer.ports.Add(6881);
        }
Exemplo n.º 2
0
        public static void FixSavesWithTerribleHacks(object osObj)
        {
            OS       os        = (OS)osObj;
            Computer computer1 = Programs.getComputer(os, "mainHubAssets");

            if (computer1 != null)
            {
                Folder folder1 = computer1.files.root.searchForFolder("bin");
                if (folder1 != null)
                {
                    Folder folder2 = folder1.searchForFolder("Sequencer");
                    if (folder2 != null)
                    {
                        FileEntry fileEntry = folder2.searchForFile("Sequencer.exe");
                        if (fileEntry == null)
                        {
                            folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe"));
                        }
                        else
                        {
                            fileEntry.data = PortExploits.crackExeData[17];
                        }
                    }
                }
            }
            Computer computer2 = Programs.getComputer(os, "pacemakerSW_BE");

            if (computer2 != null)
            {
                Console.WriteLine("Searching for pacemaker comp");
                Folder folder1 = computer2.files.root.searchForFolder("projects");
                if (folder1 != null)
                {
                    Console.WriteLine("Searching for pacemaker projects");
                    Folder folder2 = folder1.searchForFolder("KellisBT");
                    if (folder2 != null)
                    {
                        Folder folder3 = folder2.searchForFolder("Tests");
                        if (folder3 != null)
                        {
                            Console.WriteLine("Searching for pacemaker file");
                            FileEntry fileEntry = folder3.searchForFile("PacemakerFirmware_Cycle_Test.dll");
                            if (fileEntry == null)
                            {
                                folder3.files.Add(new FileEntry(PortExploits.DangerousPacemakerFirmware, "PacemakerFirmware_Cycle_Test.dll"));
                            }
                            else
                            {
                                fileEntry.data = PortExploits.DangerousPacemakerFirmware;
                            }
                        }
                    }
                }
            }
            if (!os.HasLoadedDLCContent)
            {
                return;
            }
            List <Computer> computerList = new List <Computer>();

            if (Programs.getComputer(os, "dPets_MF").links.Count == 0)
            {
                ComputerLoader.postAllLoadedActions = (Action)null;
                List <string> dlcList = BootLoadList.getDLCList();
                for (int index = 0; index < dlcList.Count; ++index)
                {
                    Computer computer3 = (Computer)ComputerLoader.loadComputer(dlcList[index], true, true);
                    computerList.Add(computer3);
                }
                ComputerLoader.postAllLoadedActions();
            }
            for (int index = 0; index < computerList.Count; ++index)
            {
                Programs.getComputer(os, computerList[index].idName).links = computerList[index].links;
            }
            Folder folder = Programs.getComputer(os, "dPets_MF").files.root.searchForFolder("Database");
            bool   flag   = false;

            if (folder.files.Count > 0 && folder.files[0].data.Contains("DigiPet"))
            {
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    folder.files[index].data = folder.files[index].data.Replace("DigiPet", "Neopal");
                    if (folder.files[index].data.Contains("Minx"))
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    ;
                }
                DLCHubServer daemon = (DLCHubServer)Programs.getComputer(os, "dhs").getDaemon(typeof(DLCHubServer));
                daemon.navigatedTo();
                if (daemon.ActiveMissions.Count == 0)
                {
                    daemon.AddMission(os.currentMission, os.defaultUser.name, false);
                }
            }
            if (os.Flags.HasFlag("KaguyaTrialComplete") && !os.netMap.visibleNodes.Contains(os.netMap.nodes.IndexOf(Programs.getComputer(os, "dhs"))))
            {
                os.Flags.RemoveFlag("KaguyaTrialComplete");
            }
        }