Decompiled source of Extended Missions v0.1.0
BepInEx/plugins/ExtendedMissions/ExtendedMissions.CompromisedMail.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using ExtendedMissions.Missions; using ExtendedMissions.Utils; using MailConfig; using Microsoft.CodeAnalysis; using MissionConfig; using Newtonsoft.Json; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExtendedMissions.CompromisedMail")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0368f7e81ede4c9deb3363bc9e60daaa62d306ad")] [assembly: AssemblyProduct("ExtendedMissions.CompromisedMail")] [assembly: AssemblyTitle("ExtendedMissions.CompromisedMail")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ExtendedMissions.Registries { internal static class CompromisedMailUtils { internal sealed class CompromisedMailRecipient { public string PublicIp { get; set; } = string.Empty; public Computer Computer { get; set; } public string UserName { get; set; } = string.Empty; public Persona Persona { get; set; } } public static CompromisedMailRecipient? GetRandomRecipient(Router router, Random random) { List<CompromisedMailRecipient> list = new List<CompromisedMailRecipient>(); foreach (Computer computer in router.GetComputers(true)) { if (computer == null || computer.IsCctvOrSmartDevice()) { continue; } foreach (User user in computer.GetUsers(false)) { Persona persona = computer.GetPersona(user.nombreUsuario, false); if (persona != null && !string.IsNullOrEmpty(persona.GetMailAdress())) { list.Add(new CompromisedMailRecipient { PublicIp = ((Computer)router).GetPublicIP(), Computer = computer, UserName = user.nombreUsuario, Persona = persona }); } } } if (list.Count != 0) { return list[random.Next(list.Count)]; } return null; } internal static bool AttachmentMatches(string serialAttach, string attachmentName) { if (string.IsNullOrEmpty(serialAttach) || string.IsNullOrEmpty(attachmentName)) { return false; } try { Archivo val = JsonConvert.DeserializeObject<Archivo>(serialAttach); return val != null && ((Fichero)val).GetNombre().Equals(attachmentName, StringComparison.OrdinalIgnoreCase); } catch { return false; } } } public class CompromisedMailMission : ExtendedDirectMission<CompromisedMailMission, CompromisedMailMission.Data> { public class Data { public string SenderMail { get; set; } = string.Empty; public string RecipientComputerId { get; set; } = string.Empty; public string RecipientUserName { get; set; } = string.Empty; public string Subject { get; set; } = string.Empty; public string Body { get; set; } = string.Empty; public string? AttachmentName { get; set; } } public enum EmailSubjectType { Invoice, SecurityUpdate, QuarterlyReport, PolicyUpdate, AccountVerification, PaymentReceipt, NewLogin, SubscriptionRenewal } private const string CONDITION_KNOWN_RECIPIENT = "KNOWN_RECIPIENT"; private const string CONDITION_KNOWN_RECIPIENT_WITH_ATTACHMENT = "KNOWN_RECIPIENT_ATTACHMENT"; private const string CONDITION_DISCOVER_RECIPIENT = "DISCOVER_RECIPIENT"; private const string CONDITION_DISCOVER_RECIPIENT_WITH_ATTACHMENT = "DISCOVER_RECIPIENT_ATTACHMENT"; protected override string Title => "Compromised Mail"; protected override string Preview => "Recover real mail credentials from a compromised workstation and send the required message from that account."; protected override string Details => "Some jobs reveal the recipient mailbox directly. Others only give you the recipient workstation and username, forcing you to discover the real mailbox first."; protected override string Mail => "The client wants an email sent from a compromised employee account.\nThe subject must include $SUBJECT_TOKEN.\nThe message to be sent must be: $MESSAGE."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override int MinReputation => 1; protected override int MaxReputation => 2; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["KNOWN_RECIPIENT"] = "The sender workstation is at $SENDER_PUBLIC_IP with LAN address $SENDER_LOCAL_IP.\nThe sender username is $SENDER_USERNAME.\nThe recipient address is $TARGET_EMAIL.\nYou must recover the sender account credentials and send the message from that real account.", ["KNOWN_RECIPIENT_ATTACHMENT"] = "The sender workstation is at $SENDER_PUBLIC_IP with LAN address $SENDER_LOCAL_IP.\nThe sender username is $SENDER_USERNAME.\nThe recipient address is $TARGET_EMAIL.\nYou must recover the sender account credentials and send the message from that real account.\nYou must also attach a file named $ATTACHMENT_NAME.", ["DISCOVER_RECIPIENT"] = "The sender workstation is at $SENDER_PUBLIC_IP with LAN address $SENDER_LOCAL_IP.\nThe sender username is $SENDER_USERNAME.\nThe recipient workstation is at $RECIP_PUBLIC_IP with LAN address $RECIP_LOCAL_IP.\nThe recipient username is $RECIP_USERNAME.\nYou must discover the recipient mailbox from that second machine, then send the message from the real sender account.", ["DISCOVER_RECIPIENT_ATTACHMENT"] = "The sender workstation is at $SENDER_PUBLIC_IP with LAN address $SENDER_LOCAL_IP.\nThe sender username is $SENDER_USERNAME.\nThe recipient workstation is at $RECIP_PUBLIC_IP with LAN address $RECIP_LOCAL_IP.\nThe recipient username is $RECIP_USERNAME.\nYou must discover the recipient mailbox from that second machine, then send the message from the real sender account.\nYou must also attach a file named $ATTACHMENT_NAME." }; public override Archivo? GetMailAttachment(ActiveMission mission) { Data data = base.GetData(mission); if (data.AttachmentName == null) { return null; } return GenerationUtils.CreateMailAttachment(data.AttachmentName, string.Empty, true); } protected override PreparedMission<CompromisedMailMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[CompromisedMailMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); Router val = ExtendedDirectMission<CompromisedMailMission, Data>.SpawnMissionRouter(mission, random); Router router = ExtendedDirectMission<CompromisedMailMission, Data>.SpawnMissionRouter(mission, random); Computer randomMissionComputer = MissionUtils.GetRandomMissionComputer(val, mission.rep != 1); User randomUser = MissionUtils.GetRandomUser(randomMissionComputer, random, false); Persona persona = randomMissionComputer.GetPersona(randomUser.nombreUsuario, false); if (persona == null) { return null; } CompromisedMailUtils.CompromisedMailRecipient randomRecipient = CompromisedMailUtils.GetRandomRecipient(router, random); if (randomRecipient == null) { return null; } string mailAdress = persona.GetMailAdress(); string mailAdress2 = randomRecipient.Persona.GetMailAdress(); if (string.IsNullOrEmpty(mailAdress) || string.IsNullOrEmpty(mailAdress2) || mailAdress.Equals(mailAdress2, StringComparison.OrdinalIgnoreCase)) { return null; } int num = TypeHelpers.ToExtendedConditionId(mission.condition.condition); bool flag = num == base.GetConditionId("DISCOVER_RECIPIENT_ATTACHMENT") || num == base.GetConditionId("KNOWN_RECIPIENT_ATTACHMENT"); EmailSubjectType randomType = GetRandomType(random); string subject = GetSubject(randomType, random); string body = GetBody(randomType, random); string text = (flag ? GetAttachmentName(randomType) : string.Empty); string text2 = base.BuildMissionText(mission, language, new(string, string)[13] { ("$SENDER_PUBLIC_IP", StringExtensions.BoldString(((Computer)val).GetPublicIP())), ("$SENDER_LOCAL_IP", StringExtensions.BoldString(randomMissionComputer.GetLocalIP())), ("$SENDER_USERNAME", StringExtensions.BoldString(randomUser.nombreUsuario)), ("$PUBLIC_IP", StringExtensions.BoldString(((Computer)val).GetPublicIP())), ("$LOCAL_IP", StringExtensions.BoldString(randomMissionComputer.GetLocalIP())), ("$USERNAME", StringExtensions.BoldString(randomUser.nombreUsuario)), ("$TARGET_EMAIL", StringExtensions.BoldString(mailAdress2)), ("$RECIP_PUBLIC_IP", StringExtensions.BoldString(randomRecipient.PublicIp)), ("$RECIP_LOCAL_IP", StringExtensions.BoldString(randomRecipient.Computer.GetLocalIP())), ("$RECIP_USERNAME", StringExtensions.BoldString(randomRecipient.UserName)), ("$SUBJECT_TOKEN", StringExtensions.BoldString(subject)), ("$BODY_TOKEN", StringExtensions.BoldString(body)), ("$ATTACHMENT_NAME", StringExtensions.BoldString(text)) }); return new PreparedMission<CompromisedMailMission, Data> { MissionData = new Data { SenderMail = mailAdress, RecipientComputerId = randomRecipient.Computer.GetID(), RecipientUserName = randomRecipient.UserName, Subject = subject, Body = body, AttachmentName = (flag ? text : null) }, TargetComputer = randomMissionComputer, KarmaType = (KarmaType)2, Text = text2 }; } protected override bool ValidateMission(ActiveMission mission, string message, Archivo attachment) { Data data = base.GetData(mission); Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(data.RecipientComputerId, true, (Router)null); if (remoteComputer == null) { return false; } User user = remoteComputer.GetUser(data.RecipientUserName); if (user == null) { return false; } Persona persona = remoteComputer.GetPersona(user.nombreUsuario, false); if (persona == null) { return false; } string text = default(string); UserMail mailAccount = Database.Singleton.GetMailAccount(persona.GetMailAdress(), ref text, (Router)null, true); if (mailAccount == null) { return false; } foreach (Mail email in mailAccount.emails) { if (!email.otherMail.Equals(data.SenderMail, StringComparison.OrdinalIgnoreCase)) { continue; } foreach (MailMessage message2 in email.messages) { if (!string.IsNullOrEmpty(message2.titulo) && message2.titulo.Equals(data.Subject, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(message2.mensaje) && message2.mensaje.Equals(data.Body, StringComparison.OrdinalIgnoreCase) && (data.AttachmentName == null || CompromisedMailUtils.AttachmentMatches(message2.serialAttach, data.AttachmentName))) { return true; } } } return false; } private static string GetSubject(EmailSubjectType type, Random random) { return type switch { EmailSubjectType.Invoice => GetRandom(random, new string[4] { "Invoice for your recent purchase", "Your invoice is ready", "Billing statement attached", "Invoice details for your order" }), EmailSubjectType.SecurityUpdate => GetRandom(random, new string[4] { "Important: Security update required", "Critical security notice", "Action needed: Security update", "Security alert for your account" }), EmailSubjectType.QuarterlyReport => GetRandom(random, new string[4] { "Your quarterly financial report", "Q report is now available", "Quarterly performance summary", "Financial report attached" }), EmailSubjectType.PolicyUpdate => GetRandom(random, new string[4] { "Policy update notification", "Important changes to our policy", "Updated terms and policies", "Please review our updated policy" }), EmailSubjectType.AccountVerification => GetRandom(random, new string[4] { "Action required: Account verification", "Verify your account now", "Account verification needed", "Confirm your account details" }), EmailSubjectType.PaymentReceipt => GetRandom(random, new string[4] { "Payment receipt confirmation", "Your payment was successful", "Receipt for your transaction", "Payment confirmation" }), EmailSubjectType.NewLogin => GetRandom(random, new string[4] { "New login detected on your account", "Suspicious login alert", "New sign-in notification", "Login activity notice" }), EmailSubjectType.SubscriptionRenewal => GetRandom(random, new string[4] { "Subscription renewal notice", "Your subscription is expiring", "Renewal reminder", "Subscription update" }), _ => "Notification", }; } private static string GetAttachmentName(EmailSubjectType type) { Clock singleton = ClockServer.Singleton; return type switch { EmailSubjectType.Invoice => $"invoice_{singleton.currentTime:yyyy_MM_dd}.pdf", EmailSubjectType.SecurityUpdate => "security_update_instructions.pdf", EmailSubjectType.QuarterlyReport => $"financial_report_Q{GetQuarter(singleton.currentTime)}_{singleton.currentTime:yyyy}.xlsx", EmailSubjectType.PolicyUpdate => "policy_changes.docx", EmailSubjectType.AccountVerification => "account_verification_form.pdf", EmailSubjectType.PaymentReceipt => "receipt_" + Guid.NewGuid().ToString().Substring(0, 8) + ".pdf", EmailSubjectType.NewLogin => "login_activity_report.pdf", EmailSubjectType.SubscriptionRenewal => "subscription_details.pdf", _ => "attachment.pdf", }; } private static int GetQuarter(DateTime dt) { return (dt.Month - 1) / 3 + 1; } private static string GetBody(EmailSubjectType type, Random random) { return type switch { EmailSubjectType.Invoice => GetRandom(random, new string[3] { "Thank you for your purchase. Please find your invoice attached.", "Your invoice is attached for your records.", "Please review the attached invoice for your recent order." }), EmailSubjectType.SecurityUpdate => GetRandom(random, new string[3] { "We released a security update. Please follow the attached instructions.", "Immediate action is required. See attached security details.", "Review the attached document to secure your account." }), EmailSubjectType.QuarterlyReport => GetRandom(random, new string[3] { "Your quarterly report is attached for review.", "Please find the financial report attached.", "Review the attached quarterly performance summary." }), EmailSubjectType.PolicyUpdate => GetRandom(random, new string[3] { "Our policies have changed. See the attached document.", "Please review the updated policy attached.", "Important policy changes are included in the attachment." }), EmailSubjectType.AccountVerification => GetRandom(random, new string[3] { "Please verify your account using the attached form.", "Account verification is required. See attachment.", "Complete the attached form to verify your account." }), EmailSubjectType.PaymentReceipt => GetRandom(random, new string[3] { "Your payment has been processed successfully.", "Please find your receipt attached.", "Payment confirmed. Receipt is included." }), EmailSubjectType.NewLogin => GetRandom(random, new string[3] { "A new login was detected. Review the attached report.", "Please confirm this login activity.", "See attached details for recent login activity." }), EmailSubjectType.SubscriptionRenewal => GetRandom(random, new string[3] { "Your subscription will renew soon.", "Please review your subscription details.", "Renewal information is attached." }), _ => "Please see the attachment.", }; } private static string GetRandom(Random random, string[] values) { return values[random.Next(values.Length)]; } private static EmailSubjectType GetRandomType(Random random) { Array values = Enum.GetValues(typeof(EmailSubjectType)); return (EmailSubjectType)values.GetValue(random.Next(values.Length)); } } } namespace ExtendedMissions.CustomMissions.CompromisedMail { [BepInPlugin("nl.pvanhalm.plugins.greyhack.extended-missions.compromised-mail", "Extended Missions - Compromised Mail", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class CompromisedMailPlugin : BaseUnityPlugin { public const string PluginGuid = "nl.pvanhalm.plugins.greyhack.extended-missions.compromised-mail"; public const string PluginName = "Extended Missions - Compromised Mail"; public const string PluginVersion = "0.1.0"; private void Awake() { } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/ExtendedMissions/ExtendedMissions.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using CompressString; using ExtendedMissions.Missions; using ExtendedMissions.Registries; using ExtendedMissions.Texts; using ExtendedMissions.Utils; using HarmonyLib; using JsonConverters; using MailConfig; using Microsoft.CodeAnalysis; using MissionConfig; using NetworkMessages; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ServiceConfig; using UnityEngine; using Util; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("ExtendedMissions.Tests")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExtendedMissions")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0368f7e81ede4c9deb3363bc9e60daaa62d306ad")] [assembly: AssemblyProduct("ExtendedMissions")] [assembly: AssemblyTitle("ExtendedMissions")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } public abstract class ExtendedMission<TInstance> : IExtendedMission where TInstance : ExtendedMission<TInstance>, new() { public int MissionTypeId { get; } public abstract MissionRegistrationTarget RegistrationTarget { get; } public static TInstance Instance { get; } = new TInstance(); protected static string StaticKey { get { Attribute attribute2 = typeof(TInstance).Assembly.GetTypes().FirstOrDefault((Type type) => type.GetCustomAttributes().Any((Attribute attribute) => attribute.GetType().FullName == "BepInEx.BepInPlugin"))?.GetCustomAttributes().FirstOrDefault((Attribute attribute) => attribute.GetType().FullName == "BepInEx.BepInPlugin"); string text = attribute2?.GetType().GetProperty("GUID")?.GetValue(attribute2) as string; if (string.IsNullOrWhiteSpace(text)) { return typeof(TInstance).FullName ?? typeof(TInstance).Name; } return text + "." + typeof(TInstance).Name; } } public ExtendedMission() { MissionTypeId = MissionTypeRegistry.Instance.Reserve(StaticKey); } } public enum FileType { Unknown, Binary, Image, Pdf, Script, Text } namespace ExtendedMissions { [BepInPlugin("nl.pvanhalm.plugins.greyhack.extended-missions", "Extended Missions", "0.1.1")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "nl.pvanhalm.plugins.greyhack.extended-missions"; public const string PluginName = "Extended Missions"; public const string PluginVersion = "0.1.1"; private static Action<string>? logMessage; private static bool initialized; internal static string? ConfigPath => Paths.ConfigPath; internal static void LogMessage(string text) { logMessage?.Invoke(text); } public static void Initialize() { if (!initialized) { if (string.IsNullOrWhiteSpace(ConfigPath)) { throw new InvalidOperationException("Config path must be set before initialization."); } initialized = true; Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); MissionRegistry.EnsureDiscovered(); MissionConfigUtils.UpdateMissionBuckets(); } } public static void Shutdown() { initialized = false; } private void OnEnable() { logMessage = ((BaseUnityPlugin)this).Logger.LogMessage; Initialize(); } private void OnDisable() { Shutdown(); } } } namespace ExtendedMissions.Texts { public static class MissionTexts { private const string NoneKey = "NONE"; private const string MissionOkKey = "MISSION_OK"; private const string MissionIntrFailedKey = "MISSION_INTR_FAILED"; private const string MissionNotCompletedKey = "MISSION_NO_COMPLETED"; private const string MissionAnyUserKey = "MISSION_ANY_USER"; private const string MissionSpecificUserKey = "MISSION_SPECIFIC_USER"; private const string MissionCredentialsKey = "MISSION_CREDENTIALS"; private const string MissionCredentialsTitleKey = "MISSION_CREDENTIALS_TITLE"; private const string MissionCredentialsContentKey = "MISSION_CREDENTIALS_CONTENT"; private const string MissionAcademicTitleKey = "MISSION_ACADEMIC_TITLE"; private const string MissionAcademicContentKey = "MISSION_ACADEMIC_CONTENT"; private const string MissionAcademicChangesKey = "MISSION_ACADEMIC_CHANGES"; private const string MissionTargetNotFoundKey = "MISSION_TARGET_NOT_FOUND"; private const string MissionModifyRegKey = "MISSION_MODIFY_REG"; private const string MissionClientRegKey = "MISSION_CLIENT_REG"; private const string MissionSubjectApprovedKey = "MISSION_SUBJECT_APPROVED"; private const string MissionSubjectImprovedKey = "MISSION_SUBJECT_IMPROVED"; private const string MissionAlreadyCompletedKey = "MISSION_ALREADY_COMPLETED"; private const string MissionWrongFileKey = "MISSION_WRONG_FILE"; private const string MissionErrorKey = "MISSION_ERROR"; private const string MissionLanIpKey = "MISSION_LAN_IP"; private const string MissionServicePcNotExistKey = "MISSION_SERVICE_PC_NOT_EXIST"; private const string MissionServiceWrongIpKey = "MISSION_SERVICE_WRONG_IP"; private const string MissionServiceStartKey = "MISSION_SERVICE_START"; private const string MissionServiceFailedIniKey = "MISSION_SERVICE_FAILED_INI"; private const string MissionAlreadyStartedKey = "MISSION_ALREADY_STARTED"; private const string MissionPoliceTitleKey = "MISSION_POLICE_TITLE"; private const string MissionPoliceContentKey = "MISSION_POLICE_CONTENT"; private const string MissionPoliceChangesKey = "MISSION_POLICE_CHANGES"; private const string MissionPoliceRemoveKey = "MISSION_POLICE_REMOVE"; private const string MissionPoliceAddChargeKey = "MISSION_POLICE_ADD_CHARGE"; private const string MissionPoliceRemoveChargeKey = "MISSION_POLICE_REMOVE_CHARGE"; private const string MissionPoliceModRegKey = "MISSION_POLICE_MODREG"; private const string MissionPoliceDetailRemoveChargeKey = "MISSION_POLICE_DETAIL_REMOVE_CHARGE"; private const string MissionPoliceDetailAddChargeKey = "MISSION_POLICE_DETAIL_ADD_CHARGE"; private const string MissionPoliceDetailDeleteKey = "MISSION_POLICE_DETAIL_DELETE"; private const string MissionFailedKey = "MISSION_FAILED"; private const string MissionDestroyPcTitleKey = "MISSION_DESTROY_PC_TITLE"; private const string MissionDestroyPcContentKey = "MISSION_DESTROY_PC_CONTENT"; private const string MissionDestroyPcKey = "MISSION_DESTROY_PC"; private const string MissionTipNoPortsKey = "MISSION_TIP_NOPORTS"; private const string MissionOkCouponKey = "MISSION_OK_COUPON"; private const string MissionOkNoCouponKey = "MISSION_OK_NO_COUPON"; private static string Get(string key, string language) { return TranslationManager.GetText(key, string.Empty); } public static string None(string language) { return Get("NONE", language); } public static string MissionOk(string language) { return Get("MISSION_OK", language); } public static string MissionIntrFailed(string language) { return Get("MISSION_INTR_FAILED", language); } public static string MissionNotCompleted(string language) { return Get("MISSION_NO_COMPLETED", language); } public static string MissionAnyUser(string language) { return Get("MISSION_ANY_USER", language); } public static string MissionSpecificUser(string language) { return Get("MISSION_SPECIFIC_USER", language); } public static string MissionCredentials(string language) { return Get("MISSION_CREDENTIALS", language); } public static string MissionCredentialsTitle(string language) { return Get("MISSION_CREDENTIALS_TITLE", language); } public static string MissionCredentialsContent(string language) { return Get("MISSION_CREDENTIALS_CONTENT", language); } public static string MissionAcademicTitle(string language) { return Get("MISSION_ACADEMIC_TITLE", language); } public static string MissionAcademicContent(string language) { return Get("MISSION_ACADEMIC_CONTENT", language); } public static string MissionAcademicChanges(string language) { return Get("MISSION_ACADEMIC_CHANGES", language); } public static string MissionTargetNotFound(string language) { return Get("MISSION_TARGET_NOT_FOUND", language); } public static string MissionModifyReg(string language) { return Get("MISSION_MODIFY_REG", language); } public static string MissionClientReg(string language) { return Get("MISSION_CLIENT_REG", language); } public static string MissionSubjectApproved(string language) { return Get("MISSION_SUBJECT_APPROVED", language); } public static string MissionSubjectImproved(string language) { return Get("MISSION_SUBJECT_IMPROVED", language); } public static string MissionAlreadyCompleted(string language) { return Get("MISSION_ALREADY_COMPLETED", language); } public static string MissionWrongFile(string language) { return Get("MISSION_WRONG_FILE", language); } public static string MissionError(string language) { return Get("MISSION_ERROR", language); } public static string MissionLanIp(string language) { return Get("MISSION_LAN_IP", language); } public static string MissionServicePcNotExist(string language) { return Get("MISSION_SERVICE_PC_NOT_EXIST", language); } public static string MissionServiceWrongIp(string language) { return Get("MISSION_SERVICE_WRONG_IP", language); } public static string MissionServiceStart(string language) { return Get("MISSION_SERVICE_START", language); } public static string MissionServiceFailedIni(string language) { return Get("MISSION_SERVICE_FAILED_INI", language); } public static string MissionAlreadyStarted(string language) { return Get("MISSION_ALREADY_STARTED", language); } public static string MissionPoliceTitle(string language) { return Get("MISSION_POLICE_TITLE", language); } public static string MissionPoliceContent(string language) { return Get("MISSION_POLICE_CONTENT", language); } public static string MissionPoliceChanges(string language) { return Get("MISSION_POLICE_CHANGES", language); } public static string MissionPoliceRemove(string language) { return Get("MISSION_POLICE_REMOVE", language); } public static string MissionPoliceAddCharge(string language) { return Get("MISSION_POLICE_ADD_CHARGE", language); } public static string MissionPoliceRemoveCharge(string language) { return Get("MISSION_POLICE_REMOVE_CHARGE", language); } public static string MissionPoliceModReg(string language) { return Get("MISSION_POLICE_MODREG", language); } public static string MissionPoliceDetailRemoveCharge(string language) { return Get("MISSION_POLICE_DETAIL_REMOVE_CHARGE", language); } public static string MissionPoliceDetailAddCharge(string language) { return Get("MISSION_POLICE_DETAIL_ADD_CHARGE", language); } public static string MissionPoliceDetailDelete(string language) { return Get("MISSION_POLICE_DETAIL_DELETE", language); } public static string MissionFailed(string language) { return Get("MISSION_FAILED", language); } public static string MissionDestroyPcTitle(string language) { return Get("MISSION_DESTROY_PC_TITLE", language); } public static string MissionDestroyPcContent(string language) { return Get("MISSION_DESTROY_PC_CONTENT", language); } public static string MissionDestroyPc(string language) { return Get("MISSION_DESTROY_PC", language); } public static string MissionTipNoPorts(string language) { return Get("MISSION_TIP_NOPORTS", language); } public static string MissionOkCoupon(string language) { return Get("MISSION_OK_COUPON", language); } public static string MissionOkNoCoupon(string language) { return Get("MISSION_OK_NO_COUPON", language); } } } namespace ExtendedMissions.Patches { [HarmonyPatch(typeof(PlayerMissions), "AddMission", new Type[] { typeof(DirectMission), typeof(PlayerComputer) })] internal class PlayerMissions_AddMission { private static bool Prefix(DirectMission mission, PlayerComputer playerComputer, ref string __result, PlayerMissions __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected I4, but got Unknown if (mission == null) { return true; } int num = (int)mission.missionType; if (num < MissionTypeRegistry.Instance.RangeStart) { return true; } if (!MissionRegistry.TryGet<IExtendedDirectMission>(num, out IExtendedDirectMission mission2) || mission2 == null) { return true; } string language = ((Computer)playerComputer).GetLanguage(); string text = mission2.AddMission(mission, language, __instance); if (string.IsNullOrEmpty(text)) { return false; } __result = text; Database.Singleton.SyncMissionsPlayer(__instance, playerComputer); return false; } } [HarmonyPatch(typeof(PlayerMissions), "CheckMission")] internal class PlayerMissions_CheckMission { private static void Postfix(string message, Archivo attach, string idMission, ref bool missionOk, ref bool isTutorial, ref TypeMissionDirect typeMissionDirect, ref string __result, PlayerMissions __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown if (missionOk || !string.IsNullOrEmpty(__result)) { return; } DebugLogger.Log("[PlayerMissions] [CheckMission] [Postfix] Check if mission was completed, not a base game mission"); ActiveMission activeMission = __instance.GetActiveMission(idMission); if (activeMission != null) { if (MissionRegistry.TryGet<IExtendedDirectMission>((int)activeMission.typeMission, out IExtendedDirectMission mission) && mission != null) { string text = mission.CheckMission(activeMission, message, attach, string.Empty, ref missionOk); __result = text ?? string.Empty; } else { DebugLogger.Log("[PlayerMissions] [CheckMission] [Postfix] Mission outside of mod"); } } } } [HarmonyPatch(typeof(DirectMissionConverter), "ReadJson", new Type[] { typeof(JsonReader), typeof(Type), typeof(object), typeof(JsonSerializer) })] internal class DirectMissionConverter_ReadJson { private static bool Prefix(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer, DirectMissionConverter __instance, ref object? __result) { JObject val = JObject.Load(reader); int? num = (int?)val["typeMission"]; if (!num.HasValue) { DebugLogger.Log("[DirectMissionConverter] [ReadJson] [Prefix] Missing typeMission, returning null"); __result = null; return false; } switch (num.Value) { case 0: __result = ((JToken)val).ToObject<TutorialMission>(serializer); return false; case 1: __result = ((JToken)val).ToObject<CredentialMission>(serializer); return false; case 2: __result = ((JToken)val).ToObject<AcademicMission>(serializer); return false; case 3: __result = ((JToken)val).ToObject<PoliceRecordMission>(serializer); return false; case 4: __result = ((JToken)val).ToObject<DestroyComputerMission>(serializer); return false; case 5: __result = ((JToken)val).ToObject<StealFileMission>(serializer); return false; case 6: __result = ((JToken)val).ToObject<DeleteFileMission>(serializer); return false; case 7: __result = ((JToken)val).ToObject<FindHackerMission>(serializer); return false; case 8: __result = ((JToken)val).ToObject<FindEvidenceMission>(serializer); return false; case 9: __result = ((JToken)val).ToObject<ProceduralMission>(serializer); return false; default: { DebugLogger.Log("[DirectMissionConverter] [ReadJson] [Prefix] Serializing Mission Types"); __result = null; if (MissionRegistry.TryGet<IExtendedDirectMission>(num.Value, out IExtendedDirectMission mission) && mission != null) { __result = mission.ReadMissionFromJson(num.Value, val, serializer); } return false; } } } } [HarmonyPatch(typeof(MissionsHelperServer), "AcceptMissionServerRpc", new Type[] { typeof(string), typeof(string) })] internal class MissionHelperServer_AcceptMissionServerRpc { public static bool Prefix(string missionID, string shopNetID, MissionsHelperServer __instance) { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown DebugLogger.Log("[PlayerMissions] [AcceptMissionServerRPC] [Prefix] Check for custom accept mission logic"); PlayerComputer computer = ((HelperServer)__instance).player.GetComputer(); string text = MissionTexts.MissionError(string.Empty); Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(shopNetID, true, (Router)null); if (remoteComputer == null || !__instance.IsMissionShop(remoteComputer)) { ((HelperServer)__instance).CloseConnection(-1, text, false); return false; } string address = remoteComputer.GetAdmin().GetUserMail().address; bool flag = computer.IsForceMinRep(); List<DirectMission> orCreateDirectMissions = __instance.GetOrCreateDirectMissions(remoteComputer, flag); DirectMission val = DirectMission.DeleteMission(missionID, orCreateDirectMissions); if (val == null) { ((HelperServer)__instance).CloseConnection(-1, text, false); return false; } HelperAccount mailAccount = computer.GetPlayerConfigOS().GetMailAccount(); if (mailAccount == null) { ((HelperServer)__instance).CloseConnection(-1, "You must register an email account in order to accept a mission.", false); return false; } UserMail mailAccount2 = Database.Singleton.GetMailAccount(mailAccount.userName, ref text, (Router)null, true); if (!string.IsNullOrEmpty(text)) { ((HelperServer)__instance).CloseConnection(-1, "Unable to accept mission: " + text, false); return false; } if (val.isProceduralOffer) { __instance.dmissions.AddProceduralMission(val, computer); __instance.SendProceduralStarterMail(val, mailAccount2, address); return false; } string text2 = __instance.dmissions.AddMission(val, computer); string iD = val.ID; Archivo val2 = null; if (MissionRegistry.TryGet<IExtendedDirectMission>(val.missionType.ToMissionTypeId(), out IExtendedDirectMission mission) && mission != null) { ActiveMission activeMission = __instance.GetPlayerMissions().GetActiveMission(iD); val2 = mission.GetMailAttachment(activeMission); } mailAccount2.RecibirMail("Mission Contract", text2, address, iD, "", val2, true, false, false); byte[] array = StringCompressor.Zip(JsonConvert.SerializeObject((object)mailAccount2)); MessageClient val3 = new MessageClient((IdClient)87); ((Message)val3).AddString(new List<string> { address, "Mission Contract" }); ((Message)val3).AddByte(array); ((HelperServer)__instance).player.SendData(val3); return false; } } [HarmonyPatch(typeof(MissionGen), "GetProceduralArchetypeTextID")] internal class MissionGen_GetProceduralArchetypeTextID { private static bool Prefix(Archetype archetype, ref string __result) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown int rawArcheType = (int)archetype; if (rawArcheType < ProceduralArchetypesRegistry.Instance.RangeStart) { return true; } IExtendedProceduralMission extendedProceduralMission = MissionRegistry.GetByTarget<IExtendedProceduralMission>(MissionRegistrationTarget.Procedural).FirstOrDefault((IExtendedProceduralMission p) => p.ArcheTypeId == rawArcheType); if (extendedProceduralMission == null) { return true; } __result = extendedProceduralMission.ArcheTypeTextId; return false; } } [HarmonyPatch(typeof(MissionGen), "GetProceduralDetailTextID")] internal class MissionGen_GetProceduralDetailTextID { private static bool Prefix(Archetype archetype, ref string __result) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown int rawArcheType = (int)archetype; if (rawArcheType < ProceduralArchetypesRegistry.Instance.RangeStart) { return true; } IExtendedProceduralMission extendedProceduralMission = MissionRegistry.GetByTarget<IExtendedProceduralMission>(MissionRegistrationTarget.Procedural).FirstOrDefault((IExtendedProceduralMission p) => p.ArcheTypeId == rawArcheType); if (extendedProceduralMission == null) { return true; } __result = extendedProceduralMission.ArcheTypeDetailTextId; return false; } } [HarmonyPatch(typeof(CacheText), "Configure")] internal class XmlGlobal_CacheText_Configure { private static void Postfix(List<TextAsset> origTextFiles, TextAsset origDefaultFile, List<TextAsset> origCommands, List<TextAsset> origExploitParts, List<TextAsset> origConfigGeneration, List<TextAsset> forceDefaultCommand) { Plugin.LogMessage("Initializing Mission Data"); Plugin.LogMessage("> Reading Current Mission Data"); List<DirectMissionPreview> list = ReadDirectMissionConfig("DirectMissions"); List<DirectMissionPreview> list2 = ReadDirectMissionConfig("DirectMissionsPolice"); List<Mission> list3 = ReadWorldMissionConfig("MissionKarma"); List<Mission> list4 = ReadWorldMissionConfig("MissionKarmaBlack"); List<Mission> list5 = ReadWorldMissionConfig("MissionKarmaWhite"); List<Mission> list6 = ReadWorldMissionConfig("MissionHidden"); ProcMissionsConfig val = ReadProceduralMissionConfig("MissionProcedural"); list.AddRange(GetDirectMissionConfigs(DirectMissionTarget.Hackshop)); list2.AddRange(GetDirectMissionConfigs(DirectMissionTarget.Police)); list3.AddRange(GetWorldMissionConfigs(WorldMissionTarget.Grey)); list4.AddRange(GetWorldMissionConfigs(WorldMissionTarget.Black)); list5.AddRange(GetWorldMissionConfigs(WorldMissionTarget.White)); list6.AddRange(GetWorldMissionConfigs(WorldMissionTarget.Hidden)); val.archetypes.AddRange(GetProceduralMissionConfigs()); Plugin.LogMessage("< Writing Mission Data to Game"); CacheText.configGeneration["DirectMissions"] = JsonConvert.SerializeObject((object)list, (Formatting)1); CacheText.configGeneration["DirectMissionsPolice"] = JsonConvert.SerializeObject((object)list2, (Formatting)1); CacheText.configGeneration["MissionKarma"] = JsonConvert.SerializeObject((object)list3, (Formatting)1); CacheText.configGeneration["MissionKarmaBlack"] = JsonConvert.SerializeObject((object)list4, (Formatting)1); CacheText.configGeneration["MissionKarmaWhite"] = JsonConvert.SerializeObject((object)list5, (Formatting)1); CacheText.configGeneration["MissionHidden"] = JsonConvert.SerializeObject((object)list6, (Formatting)1); CacheText.configGeneration["MissionProcedural"] = JsonConvert.SerializeObject((object)val, (Formatting)1); Plugin.LogMessage("Initializing Language Data"); Plugin.LogMessage("> Reading Current Language Data [ENG]"); ContentTexts val2 = ReadConfig<ContentTexts>("GameTexts_en"); foreach (ITranslatableMission item in MissionRegistry.GetAll<ITranslatableMission>()) { item.RegisterTranslations(val2.content); } Plugin.LogMessage("< Writing Language Data to Game [ENG]"); CacheText.configGeneration["GameTexts_en"] = JsonConvert.SerializeObject((object)val2, (Formatting)1); } private static IEnumerable<DirectMissionPreview> GetDirectMissionConfigs(DirectMissionTarget target) { return from mission in MissionRegistry.GetByTarget<IExtendedDirectMission>((MissionRegistrationTarget)target) select mission.MissionConfig(); } private static IEnumerable<Mission> GetWorldMissionConfigs(WorldMissionTarget target) { return from mission in MissionRegistry.GetByTarget<IExtendedWorldMission>((MissionRegistrationTarget)target) select mission.MissionConfig() into mission where mission != null select (mission); } private static IEnumerable<ArchetypeConfig> GetProceduralMissionConfigs() { return from mission in MissionRegistry.GetByTarget<IExtendedProceduralMission>(MissionRegistrationTarget.Procedural) select mission.ProceduralMissionConfig() into mission where mission != null select (mission); } private static List<DirectMissionPreview> ReadDirectMissionConfig(string key) { return ReadConfig<List<DirectMissionPreview>>(key); } private static List<Mission> ReadWorldMissionConfig(string key) { return ReadConfig<List<Mission>>(key); } private static ProcMissionsConfig ReadProceduralMissionConfig(string key) { return ReadConfig<ProcMissionsConfig>(key); } private static TCollection ReadConfig<TCollection>(string key) where TCollection : class, new() { if (!CacheText.configGeneration.TryGetValue(key, out var value)) { return new TCollection(); } return JsonConvert.DeserializeObject<TCollection>(value) ?? new TCollection(); } } } namespace ExtendedMissions.Registries { public enum MissionRegistrationTarget { Hackshop, Procedural, Police, GreyHat, BlackHat, WhiteHat, Hidden } internal static class MissionRegistry { private static readonly Dictionary<int, IExtendedMission> MissionsByType = new Dictionary<int, IExtendedMission>(); private static readonly HashSet<Type> DiscoveredMissionTypes = new HashSet<Type>(); internal static IReadOnlyCollection<IExtendedMission> All { get { EnsureDiscovered(); return (IReadOnlyCollection<IExtendedMission>)(object)MissionsByType.Values.ToArray(); } } internal static void EnsureDiscovered() { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { foreach (Type loadableMissionType in GetLoadableMissionTypes(assemblies[i])) { if (DiscoveredMissionTypes.Add(loadableMissionType)) { IExtendedMission extendedMission = ResolveMissionInstance(loadableMissionType); if (extendedMission != null) { Register(extendedMission); } } } } } internal static IReadOnlyCollection<TMission> GetAll<TMission>() where TMission : class, IExtendedMission { EnsureDiscovered(); return (IReadOnlyCollection<TMission>)(object)MissionsByType.Values.OfType<TMission>().ToArray(); } internal static IReadOnlyCollection<TMission> GetByTarget<TMission>(MissionRegistrationTarget target) where TMission : class, IExtendedMission { EnsureDiscovered(); if (target == MissionRegistrationTarget.Procedural) { return (IReadOnlyCollection<TMission>)(object)MissionsByType.Values.OfType<IExtendedProceduralMission>().OfType<TMission>().ToArray(); } return (IReadOnlyCollection<TMission>)(object)(from mission in MissionsByType.Values.OfType<TMission>() where mission.RegistrationTarget == target select mission).ToArray(); } internal static void Register(IExtendedMission mission) { if (mission == null) { throw new ArgumentNullException("mission"); } if (MissionsByType.TryGetValue(mission.MissionTypeId, out IExtendedMission value)) { if (value != mission) { throw new InvalidOperationException($"Mission type id '{mission.MissionTypeId}' is already registered by '{value.GetType().FullName}'."); } } else { MissionsByType.Add(mission.MissionTypeId, mission); } } internal static bool TryGet<TMission>(int missionTypeId, out TMission? mission) where TMission : class, IExtendedMission { EnsureDiscovered(); if (MissionsByType.TryGetValue(missionTypeId, out IExtendedMission value) && value is TMission val) { mission = val; return true; } mission = null; return false; } internal static IEnumerable<Type> GetLoadableMissionTypes(Assembly assembly) { Type[] source; try { source = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { source = ex.Types.Where((Type type) => type != null).Cast<Type>().ToArray(); } return source.Where((Type type) => !type.IsAbstract && !type.IsInterface && !type.ContainsGenericParameters && typeof(IExtendedMission).IsAssignableFrom(type)); } private static IExtendedMission? ResolveMissionInstance(Type type) { PropertyInfo property = type.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy); if (property != null && typeof(IExtendedMission).IsAssignableFrom(property.PropertyType)) { return property.GetValue(null) as IExtendedMission; } return Activator.CreateInstance(type) as IExtendedMission; } } internal sealed class MissionConditionRegistry : Registry { public static readonly MissionConditionRegistry Instance = new MissionConditionRegistry(); public override int RangeStart => 1001; public override string Name => "MissionConditionRegistry"; } internal sealed class MissionTypeRegistry : Registry { public static readonly MissionTypeRegistry Instance = new MissionTypeRegistry(); public override int RangeStart => 1001; public override string Name => "MissionTypeRegistry"; } internal sealed class ProceduralArchetypesRegistry : Registry { public static readonly ProceduralArchetypesRegistry Instance = new ProceduralArchetypesRegistry(); public override int RangeStart => 1001; public override string Name => "ProceduralArcheTypes"; } internal abstract class Registry { private Dictionary<string, int> entries = new Dictionary<string, int>(); private readonly string registryFilePath; private readonly string invalidRegistryFilePath; public abstract int RangeStart { get; } public abstract string Name { get; } public Registry() { if (string.IsNullOrWhiteSpace(Name)) { throw new ArgumentException("Registry name is required."); } registryFilePath = Path.Combine(Plugin.ConfigPath, "Extended Missions".Replace(" ", "_") + "." + Name + ".json"); invalidRegistryFilePath = Path.Combine(Plugin.ConfigPath, "Extended Missions".Replace(" ", "_") + "." + Name + ".invalid.json"); } public int Reserve(string key) { if (string.IsNullOrWhiteSpace(key)) { throw new ArgumentException("key is required."); } if (RangeStart < 0) { throw new ArgumentOutOfRangeException("RangeStart"); } EnsureRegistryLoaded(); if (entries.TryGetValue(key, out var value)) { return value; } int num = FindNextFreeId(); entries.Add(key, num); Save(); return num; } private int FindNextFreeId() { for (int i = RangeStart; i <= int.MaxValue; i++) { if (!entries.ContainsValue(i)) { return i; } } throw new InvalidOperationException("[" + Name + "] Registration full"); } private void EnsureRegistryLoaded() { if (entries != null) { return; } if (!File.Exists(registryFilePath)) { entries = new Dictionary<string, int>(); return; } try { JObject val = JsonConvert.DeserializeObject<JObject>(File.ReadAllText(registryFilePath)); object obj; if (val == null) { obj = null; } else { JToken obj2 = val["entries"]; obj = ((obj2 != null) ? obj2.ToObject<Dictionary<string, int>>() : null); } if (obj == null) { obj = new Dictionary<string, int>(); } entries = (Dictionary<string, int>)obj; } catch (Exception ex) { PreserveInvalidRegistryFile(); DebugLogger.Log($"[{Name}] Failed to load registry '{registryFilePath}': {ex}"); throw new InvalidOperationException("[" + Name + "]: '" + registryFilePath + "' is invalid. A copy was preserved at '" + invalidRegistryFilePath + "'.", ex); } } private void PreserveInvalidRegistryFile() { try { File.Copy(registryFilePath, invalidRegistryFilePath, overwrite: true); } catch (Exception arg) { DebugLogger.Log($"[{Name}] Failed to preserve invalid registry copy: {arg}"); } } private void Save() { string directoryName = Path.GetDirectoryName(registryFilePath); if (!string.IsNullOrEmpty(directoryName)) { Directory.CreateDirectory(directoryName); } Dictionary<string, object> dictionary = new Dictionary<string, object> { ["entries"] = entries ?? new Dictionary<string, int>() }; File.WriteAllText(registryFilePath, JsonConvert.SerializeObject((object)dictionary, (Formatting)1)); } } public enum KarmaMissionTarget { Black = 4, White = 5, Grey = 3 } public abstract class ExtendedKarmaMission<TInstance> : ExtendedWorldMission<TInstance>, IExtendedWorldMission, IExtendedMission, ITranslatableMission where TInstance : ExtendedKarmaMission<TInstance>, new() { public abstract KarmaMissionTarget MissionTarget { get; } public override MissionRegistrationTarget RegistrationTarget => (MissionRegistrationTarget)MissionTarget; } } namespace ExtendedMissions.Utils { internal static class MissionConfigUtils { private const byte MISSION_BUCKET_NO_MISSION_PERCENTAGE = 50; public static Dictionary<string, int>? DefaultIPGroupManagerMissionBuckets; public static void EnsureMissionBucketsLoaded() { if (DefaultIPGroupManagerMissionBuckets == null && IPGroupManager.MissionCounts != null && IPGroupManager.MissionCounts.Count != 0) { DefaultIPGroupManagerMissionBuckets = new Dictionary<string, int>(); DictionaryExtensions.AddRange<string, int>(DefaultIPGroupManagerMissionBuckets, IPGroupManager.MissionCounts); } } public static void UpdateMissionBuckets() { EnsureMissionBucketsLoaded(); if (DefaultIPGroupManagerMissionBuckets != null) { int num = DefaultIPGroupManagerMissionBuckets["HIDDEN"] + MissionRegistry.GetByTarget<IExtendedWorldMission>(MissionRegistrationTarget.Hidden).Count; IPGroupManager.MissionCounts["HIDDEN"] = num; int num2 = DefaultIPGroupManagerMissionBuckets["GREY"] + MissionRegistry.GetByTarget<IExtendedWorldMission>(MissionRegistrationTarget.GreyHat).Count; IPGroupManager.MissionCounts["GREY"] = num2; int num3 = DefaultIPGroupManagerMissionBuckets["BLACK"] + MissionRegistry.GetByTarget<IExtendedWorldMission>(MissionRegistrationTarget.BlackHat).Count; IPGroupManager.MissionCounts["BLACK"] = num3; int num4 = DefaultIPGroupManagerMissionBuckets["WHITE"] + MissionRegistry.GetByTarget<IExtendedWorldMission>(MissionRegistrationTarget.WhiteHat).Count; IPGroupManager.MissionCounts["WHITE"] = num4; int num5 = DefaultIPGroupManagerMissionBuckets["PROCEDURAL"] + MissionRegistry.GetByTarget<IExtendedProceduralMission>(MissionRegistrationTarget.Procedural).Count; IPGroupManager.MissionCounts["PROCEDURAL"] = num5; float num6 = 0.5f; IPGroupManager.MissionCounts["NOMISSION"] = Mathf.CeilToInt((float)(num + num2 + num3 + num4 + num5) * num6); } } } public static class GenerationUtils { public static Archivo CreateMailAttachment(string name, string content, bool isBinary) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Archivo val = new Archivo(name, content, "Unknown", (TypeFile)0, true, false); val.SetBinario(isBinary); return val; } } public static class MissionUtils { public static Computer GetRandomMissionComputer(Router router, bool includeWithoutServices = false) { LanPcInfo randomComputer = router.GetRandomComputer(!includeWithoutServices); return router.GetComputer(randomComputer.localIp, false); } public static User GetRandomUser(Computer computer, Random random, bool includeRoot = false) { List<User> users = computer.GetUsers(includeRoot); return users[random.Next(users.Count)]; } } public static class RandomUtils { public static Random CreateRandom() { return new Random(Guid.NewGuid().GetHashCode()); } } public static class TypeHelpers { public static int ToExtendedConditionId(this ConditionTypeDirect condition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Expected I4, but got Unknown return (int)condition; } public static ConditionTypeDirect ToBaseCondition(this int conditionId) { return (ConditionTypeDirect)conditionId; } public static TypeMissionDirect ToBaseType(this int missionTypeId) { return (TypeMissionDirect)missionTypeId; } public static int ToMissionTypeId(this TypeMissionDirect missionType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Expected I4, but got Unknown return (int)missionType; } } public static class GameHelpers { public static User GetPlayerUser(this PlayerComputer pc) { List<User> users = ((Computer)pc).GetUsers(false); if (users == null || users.Count == 0) { throw new InvalidOperationException("Player computer does not have a playable user account."); } return users[0]; } public static User GetRepUser(this PlayerComputer pc) { List<User> users = ((Computer)pc).GetUsers(true); if (users != null && users.Count > 1) { return users[1]; } return pc.GetPlayerUser(); } } public static class DebugLogger { public static void Log(string text) { } } public static class DateTimeUtils { public static DateTime ParseFormat(string input, string format) { return DateTime.ParseExact(input, format, CultureInfo.InvariantCulture); } } } namespace ExtendedMissions.Missions { public enum WorldMissionTarget { Black = 4, White = 5, Grey = 3, Hidden = 6 } public abstract class ExtendedWorldMission<TInstance> : ExtendedMission<TInstance>, IExtendedWorldMission, IExtendedMission, ITranslatableMission where TInstance : ExtendedWorldMission<TInstance>, new() { private readonly List<ComputerMission> computerMissions = new List<ComputerMission>(); private readonly List<PreGenNpc> generatedNpcData = new List<PreGenNpc>(); private readonly Dictionary<string, string> translations = new Dictionary<string, string>(); protected virtual string StarterText => string.Empty; protected abstract int RewardTier { get; } public Mission? MissionConfig() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) string starterTextID = (string.IsNullOrEmpty(StarterText) ? "" : RegisterTranslation("starter", StarterText)); Mission val = new Mission(); Mission val2 = val; val2.missionType = (TypeMission)(ExtendedMission<TInstance>.Instance.RegistrationTarget switch { MissionRegistrationTarget.BlackHat => 2, MissionRegistrationTarget.WhiteHat => 3, MissionRegistrationTarget.GreyHat => 1, MissionRegistrationTarget.Hidden => 0, MissionRegistrationTarget.Procedural => 5, _ => 1, }); val.computers = new List<ComputerMission>(computerMissions); val.preGenNpcs = new List<PreGenNpc>(generatedNpcData); val.starterTextID = starterTextID; val.rewardTier = RewardTier; return val; } protected int AddComputerMission(int networkIndex = 0, int? cloneNpcIndex = null, TipoRed? networkType = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ComputerMission val = new ComputerMission { computerIndexNet = networkIndex, cloneNpcPcIdx = cloneNpcIndex.GetValueOrDefault(-1) }; if (networkType.HasValue) { val.tipoRed = networkType.Value; val.isRandomTipoRed = false; } computerMissions.Add(val); return computerMissions.Count - 1; } protected void AddChatLogMissionItem(int computerIndex, string text, bool isEvidence = false) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown if (computerIndex < 0 || computerIndex >= computerMissions.Count) { throw new IndexOutOfRangeException("computerIndex is outside of the computer count"); } List<MissionItem> mission = computerMissions[computerIndex].GetMission(); string iD = RegisterTranslation($"mission_item.{computerIndex}_{mission.Count}.text", text); mission.Add(new MissionItem((TypeItem)0) { ID = iD, isEvidence = isEvidence }); } protected void AddTextFileMissionItem(int computerIndex, string text, bool isEvidence = false) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown if (computerIndex < 0 || computerIndex >= computerMissions.Count) { throw new IndexOutOfRangeException("computerIndex is outside of the computer count"); } List<MissionItem> mission = computerMissions[computerIndex].GetMission(); string iD = RegisterTranslation($"mission_item.{computerIndex}_{mission.Count}.text", text); mission.Add(new MissionItem((TypeItem)3) { ID = iD, isEvidence = isEvidence }); } protected void AddFirewallMissionItem(int computerIndex, int? port = null, Action action = 1) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown if (computerIndex < 0 || computerIndex >= computerMissions.Count) { throw new IndexOutOfRangeException("computerIndex is outside of the computer count"); } computerMissions[computerIndex].GetMission().Add((MissionItem)new FirewallItem { port = port.GetValueOrDefault(-1), statusPort = (Status)(port.HasValue ? 1 : 0), action = action, statusDestIP = (Status)0, statusSourceIP = (Status)0 }); } protected void AddSystemLogMissionItem(int computerIndex, int targetComputerIndex, int port, StatusLog action, bool wasSuccessful = false) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown if (computerIndex < 0 || computerIndex >= computerMissions.Count) { throw new IndexOutOfRangeException("computerIndex is outside of the computer count"); } computerMissions[computerIndex].GetMission().Add((MissionItem)new SystemLogItem { action = action, port = port, toComputerIdx = targetComputerIndex, isReceivingConn = wasSuccessful }); } protected void AddMailMissionItem(int computerIndex, string text, string subjectText, int? targetNpcIndex = null) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown if (computerIndex < 0 || computerIndex >= computerMissions.Count) { throw new IndexOutOfRangeException("computerIndex is outside of the computer count"); } List<MissionItem> mission = computerMissions[computerIndex].GetMission(); string iD = RegisterTranslation($"mission_item.{computerIndex}_{mission.Count}.text", text); string titleID = RegisterTranslation($"mission_item.{computerIndex}_{mission.Count}.subject", subjectText); mission.Add((MissionItem)new MailConversItem { ID = iD, titleID = titleID, useNetworkNpcSender = !targetNpcIndex.HasValue, forceNpcReceive = true, indexNpc = targetNpcIndex.GetValueOrDefault(-1) }); } protected void AddServiceMissionItem(int computerIndex, ServicioID service, bool allowMultiple = false) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if (computerIndex < 0 || computerIndex >= computerMissions.Count) { throw new IndexOutOfRangeException("computerIndex is outside of the computer count"); } computerMissions[computerIndex].GetMission().Add((MissionItem)new ServiceItem { servicio = service, allowDuplicates = allowMultiple }); } protected int AddGeneratedNpc(bool isVictim = false, bool isGuilty = false, string? forcedPass = null) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown generatedNpcData.Add(new PreGenNpc { isVictim = isVictim, isGuilty = isGuilty, isBlackmailed = false, isVictimNotified = false, isForcedPass = (forcedPass != null), forcedPass = forcedPass }); return generatedNpcData.Count - 1; } protected string RegisterTranslation(string key, string value) { string translationKey = GetTranslationKey(key); translations[translationKey] = value; return translationKey; } protected string GetTranslationKey(string key) { return ExtendedMission<TInstance>.StaticKey + ".translations." + key; } public void RegisterTranslations(IDictionary<string, string> targetTranslations) { DebugLogger.Log("> Initializing " + GetType().Name + " Procedural Mission Translations"); foreach (KeyValuePair<string, string> translation in translations) { targetTranslations[translation.Key] = translation.Value; } } } internal interface IExtendedDirectMission : IExtendedMission, ITranslatableMission { Archivo? GetMailAttachment(ActiveMission mission); string? AddMission(DirectMission mission, string language, PlayerMissions playerMissions); string? CheckMission(ActiveMission mission, string message, Archivo attachment, string language, ref bool missionOk); object? ReadMissionFromJson(int missionTypeId, JObject jObject, JsonSerializer serializer); DirectMissionPreview MissionConfig(); } internal interface IExtendedMission { int MissionTypeId { get; } MissionRegistrationTarget RegistrationTarget { get; } } internal interface IExtendedProceduralMission : ITranslatableMission, IExtendedMission { int ArcheTypeId { get; } string ArcheTypeTextId { get; } string ArcheTypeDetailTextId { get; } ArchetypeConfig ProceduralMissionConfig(); } internal interface IExtendedWorldMission : IExtendedMission, ITranslatableMission { Mission? MissionConfig(); } internal interface ITranslatableMission : IExtendedMission { void RegisterTranslations(IDictionary<string, string> translations); } public enum DirectMissionTarget { Hackshop = 0, Police = 2 } public abstract class ExtendedDirectMission<TInstance, TData> : ExtendedMission<TInstance>, IExtendedDirectMission, IExtendedMission, ITranslatableMission where TInstance : ExtendedDirectMission<TInstance, TData>, new() { protected sealed class StoredMissionData : ActiveMission { [JsonProperty] public TData Data { get; set; } [JsonConstructor] private StoredMissionData() { } public StoredMissionData(int missionTypeId, string targetComputerId, int reputation, KarmaType karmaType, TData data) : base(missionTypeId.ToBaseType(), targetComputerId, reputation, karmaType) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Data = data; } } protected class PreparedMission { public Computer TargetComputer { get; set; } public KarmaType KarmaType { get; set; } public TData MissionData { get; set; } public string Text { get; set; } = string.Empty; } private readonly Dictionary<string, string> translations = new Dictionary<string, string>(StringComparer.Ordinal); private readonly Dictionary<string, MissionCondition> conditionsByTag = new Dictionary<string, MissionCondition>(StringComparer.Ordinal); private readonly DirectMissionPreview missionPreview; public override MissionRegistrationTarget RegistrationTarget => (MissionRegistrationTarget)DirectMissionBoard; protected abstract DirectMissionTarget DirectMissionBoard { get; } protected abstract string Title { get; } protected abstract string Preview { get; } protected abstract string Mail { get; } protected virtual string Details => MissionTexts.None(string.Empty); protected virtual int MinReputation => 0; protected virtual int MaxReputation => 2; protected virtual Dictionary<string, string>? Conditions => null; protected ExtendedDirectMission() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown List<MissionCondition> list = new List<MissionCondition>(); if (Conditions != null) { foreach (KeyValuePair<string, string> condition in Conditions) { int conditionId = ReserveCondition(condition.Key); MissionCondition val = new MissionCondition { condition = conditionId.ToBaseCondition(), textID = RegisterTranslation(condition.Key, condition.Value) }; list.Add(val); conditionsByTag[condition.Key] = val; } } missionPreview = new DirectMissionPreview { titleID = Title, previewID = Preview, previewDetailsID = Details, missionType = base.MissionTypeId.ToBaseType(), contentID = Mail, minRep = MinReputation, maxRep = MaxReputation, conditions = list }; } public virtual Archivo? GetMailAttachment(ActiveMission mission) { return null; } protected abstract PreparedMission? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions); public string? AddMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (mission.missionType.ToMissionTypeId() != base.MissionTypeId) { return null; } PreparedMission preparedMission = PrepareMission(mission, language, playerMissions); if (preparedMission == null) { return null; } playerMissions.missions.Add(mission.ID, Store(preparedMission.TargetComputer.GetID(), mission.rep, preparedMission.KarmaType, preparedMission.MissionData)); return preparedMission.Text; } protected abstract bool ValidateMission(ActiveMission mission, string message, Archivo attachment); public string? CheckMission(ActiveMission mission, string message, Archivo attachment, string language, ref bool missionOk) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (mission.typeMission.ToMissionTypeId() != base.MissionTypeId) { return null; } missionOk = ValidateMission(mission, message, attachment); if (!missionOk && IsSoftLocked(mission)) { return MissionTexts.MissionFailed(language); } if (!missionOk) { return MissionTexts.MissionNotCompleted(language); } return MissionTexts.MissionOk(language); } protected virtual bool IsSoftLocked(ActiveMission mission) { return false; } public virtual object? ReadMissionFromJson(int missionTypeId, JObject jObject, JsonSerializer serializer) { if (missionTypeId != base.MissionTypeId) { return null; } return ((JToken)jObject).ToObject<StoredMissionData>(serializer); } public DirectMissionPreview MissionConfig() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown return new DirectMissionPreview { titleID = missionPreview.titleID, previewID = missionPreview.previewID, previewDetailsID = missionPreview.previewDetailsID, missionType = missionPreview.missionType, contentID = missionPreview.contentID, minRep = missionPreview.minRep, maxRep = missionPreview.maxRep, conditions = missionPreview.conditions }; } public void RegisterTranslations(IDictionary<string, string> targetTranslations) { foreach (KeyValuePair<string, string> translation in translations) { targetTranslations[translation.Key] = translation.Value; } } protected ActiveMission Store(string targetComputerId, int reputation, KarmaType karmaType, TData data) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) return (ActiveMission)(object)new StoredMissionData(base.MissionTypeId, targetComputerId, reputation, karmaType, data); } protected TData GetData(ActiveMission mission) { return ((StoredMissionData)(object)mission).Data; } public static Router SpawnMissionRouter(DirectMission mission, Random random) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) List<TipoRed> listTipoRedComun = OS.GetListTipoRedComun(); TipoRed val = listTipoRedComun[random.Next(listTipoRedComun.Count)]; return ServerMap.Singleton.SpawnRouter(val, mission.GetAccessType(), (Mission)null, false, "", (GenerationProfile)0); } protected string BuildMissionText(DirectMission mission, string language, params (string Token, string Value)[] replacements) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder = stringBuilder.AppendLine(TranslationManager.GetText(mission.contentID, language)); stringBuilder = stringBuilder.AppendLine(TranslationManager.GetText(mission.condition.textID, language)); for (int i = 0; i < replacements.Length; i++) { (string, string) tuple = replacements[i]; stringBuilder = stringBuilder.Replace(tuple.Item1, tuple.Item2); } return stringBuilder.ToString(); } protected string RegisterTranslation(string key, string value) { string translationKey = GetTranslationKey(key); translations[translationKey] = value; return translationKey; } protected int GetConditionId(string tag) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected I4, but got Unknown if (!conditionsByTag.TryGetValue(tag, out MissionCondition value)) { return -1; } return (int)value.condition; } protected static int ReserveCondition(string tag) { return MissionConditionRegistry.Instance.Reserve(ExtendedMission<TInstance>.StaticKey + ".condition." + tag); } protected string GetTranslationKey(string key) { return ExtendedMission<TInstance>.StaticKey + ".translations." + key; } } public abstract class ExtendedHiddenMission<TInstance> : ExtendedWorldMission<TInstance>, IExtendedWorldMission, IExtendedMission, ITranslatableMission where TInstance : ExtendedHiddenMission<TInstance>, new() { public override MissionRegistrationTarget RegistrationTarget => MissionRegistrationTarget.Hidden; } public abstract class ExtendedProceduralMission<TInstance> : ExtendedMission<TInstance>, IExtendedProceduralMission, ITranslatableMission, IExtendedMission where TInstance : ExtendedProceduralMission<TInstance>, new() { public sealed class SupportChatLogBuilder { public string Text { get; set; } = ""; public string? Path { get; set; } } private readonly Dictionary<string, string> translations = new Dictionary<string, string>(StringComparer.Ordinal); private readonly ClosureConfig _closure = new ClosureConfig(); private readonly HeartConfig _heart = new HeartConfig(); private readonly List<TemplateOption> _starterTemplates = new List<TemplateOption>(); private readonly List<string> _groups = new List<string>(); public override MissionRegistrationTarget RegistrationTarget => MissionRegistrationTarget.Procedural; public int ArcheTypeId { get; private set; } public string ArcheTypeTextId { get; private set; } public string ArcheTypeDetailTextId { get; private set; } protected abstract string ArcheTypeText { get; } protected abstract string ArcheTypeDetailText { get; } public ExtendedProceduralMission() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown ArcheTypeId = ProceduralArchetypesRegistry.Instance.Reserve(ExtendedMission<TInstance>.StaticKey + ".ArcheType"); ArcheTypeTextId = RegisterTranslation("archetype.text", ArcheTypeText); ArcheTypeDetailTextId = RegisterTranslation("archetype.detail", ArcheTypeDetailText); } public ArchetypeConfig ProceduralMissionConfig() { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown if (_groups == null || _groups.Count == 0 || _starterTemplates == null || _starterTemplates.Count == 0 || _heart == null || _closure == null) { throw new Exception("Procedural mission is not initialized correctly"); } foreach (TemplateOption starterTemplate in _starterTemplates) { if (!_groups.Contains(starterTemplate.group)) { throw new Exception("StarterTemplate group '" + starterTemplate.group + "' is not part of _groups"); } } foreach (string group in _groups) { if (!_starterTemplates.Any((TemplateOption template) => template.group == group)) { throw new Exception("Group: '" + group + "' has no starter template"); } } return new ArchetypeConfig { archetype = (Archetype)ArcheTypeId, closure = _closure, groups = _groups, heart = _heart, starters = _starterTemplates }; } protected void AddGroup(string name) { if (_groups.Contains(name)) { throw new Exception("Group with name '" + name + "' already exists"); } _groups.Add(name); } protected void AddGroupStarter(string name, string emailText, List<EvidenceFunction> evidences) { string name2 = name; if (!_groups.Contains(name2)) { throw new Exception("Group with name '" + name2 + "' doesn't exist - Add it first"); } int num = _starterTemplates.Count((TemplateOption template) => template.group == name2); _starterTemplates.Add(CreateTemplateOption($"starter.{name2}_{num}", name2, emailText, evidences, string.Empty, null, null, generateSupportChatLog: false, string.Empty, null, null)); } private VerbConfig GetOrAddVerb(Verb verb) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown VerbConfig val = ((IEnumerable<VerbConfig>)_heart.verbs).FirstOrDefault((Func<VerbConfig, bool>)((VerbConfig v) => v.verb == verb)); if (val != null) { return val; } val = new VerbConfig { verb = verb, modalities = new List<ModalityConfig>() }; _heart.verbs.Add(val); return val; } private ModalityConfig GetOrAddModality(VerbConfig verbConfig, Modality modality) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown ModalityConfig val = ((IEnumerable<ModalityConfig>)verbConfig.modalities).FirstOrDefault((Func<ModalityConfig, bool>)((ModalityConfig m) => m.modality == modality)); if (val != null) { return val; } val = new ModalityConfig { modality = modality, options = new List<TemplateOption>() }; verbConfig.modalities.Add(val); return val; } protected void AddFileHeartBeatEntry(Verb verb, string text, List<EvidenceFunction> evidences, FileType type = FileType.Text, string? fileName = null, string? path = null, SupportChatLogBuilder? supportChatLog = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) VerbConfig orAddVerb = GetOrAddVerb(verb); ModalityConfig orAddModality = GetOrAddModality(orAddVerb, (Modality)1); int count = orAddModality.options.Count; FileOptionSpec val = new FileOptionSpec(); bool flag = false; if (!string.IsNullOrEmpty(fileName)) { val.fileName = fileName; val.randomFileName = false; flag = true; } if (!string.IsNullOrEmpty(path)) { val.path = path; val.randomPath = false; flag = true; } switch (type) { case FileType.Binary: val.isBinary = true; flag = true; break; case FileType.Image: val.isImage = true; flag = true; break; case FileType.Pdf: val.isPdf = true; flag = true; break; case FileType.Script: val.isScript = true; flag = true; break; } TemplateOption item = CreateTemplateOption($"heart.{verb}.{orAddModality.modality}_{count}", string.Empty, text, evidences, string.Empty, flag ? val : null, null, supportChatLog != null, (supportChatLog != null) ? supportChatLog.Text : string.Empty, (supportChatLog == null) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = ((supportChatLog.Path != null) ? supportChatLog.Path : string.Empty), randomPath = (supportChatLog.Path == null) }, null); orAddModality.options.Add(item); } protected void AddChatLogHeartBeatEntry(Verb verb, string text, List<EvidenceFunction> evidences, string? path = null, SupportChatLogBuilder? supportChatLog = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) VerbConfig orAddVerb = GetOrAddVerb(verb); ModalityConfig orAddModality = GetOrAddModality(orAddVerb, (Modality)0); int count = orAddModality.options.Count; TemplateOption item = CreateTemplateOption($"heart.{verb}.{orAddModality.modality}_{count}", string.Empty, text, evidences, string.Empty, null, string.IsNullOrEmpty(path) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = path, randomPath = false }, supportChatLog != null, (supportChatLog != null) ? supportChatLog.Text : string.Empty, (supportChatLog == null) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = ((supportChatLog.Path != null) ? supportChatLog.Path : string.Empty), randomPath = (supportChatLog.Path == null) }, null); orAddModality.options.Add(item); } protected void AddMailHeartBeatEntry(Verb verb, string text, List<EvidenceFunction> evidences, string subjectText = "", SupportChatLogBuilder? supportChatLog = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) VerbConfig orAddVerb = GetOrAddVerb(verb); ModalityConfig orAddModality = GetOrAddModality(orAddVerb, (Modality)3); int count = orAddModality.options.Count; TemplateOption item = CreateTemplateOption($"heart.{verb}.{orAddModality.modality}_{count}", string.Empty, text, evidences, subjectText, null, null, supportChatLog != null, (supportChatLog != null) ? supportChatLog.Text : string.Empty, (supportChatLog == null) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = ((supportChatLog.Path != null) ? supportChatLog.Path : string.Empty), randomPath = (supportChatLog.Path == null) }, null); orAddModality.options.Add(item); } private CrossInfoSpec CreateCrossInfoSpec(string keyPrefix, CrossInfoPayloadType currentType, CrossInfoPayloadType nextType, CrossInfoNextMode nextMode, string nextText, List<EvidenceFunction> nextEvidences, FileOptionSpec? nextFileSpec, ChatLogPathSpec? nextChatLogPathSpec, SupportChatLogBuilder? nextSupportChatLog = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) return new CrossInfoSpec { currentType = currentType, nextType = nextType, nextMode = nextMode, nextOption = CreateTemplateOption(keyPrefix + ".next", string.Empty, nextText, nextEvidences, string.Empty, nextFileSpec, nextChatLogPathSpec, nextSupportChatLog != null, (nextSupportChatLog != null) ? nextSupportChatLog.Text : string.Empty, (nextSupportChatLog == null) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = ((nextSupportChatLog.Path != null) ? nextSupportChatLog.Path : string.Empty), randomPath = (nextSupportChatLog.Path == null) }, null) }; } protected void AddCrossInfoHeartBeatEntry(Verb verb, string text, List<EvidenceFunction> evidences, CrossInfoPayloadType currentType, CrossInfoPayloadType nextType, CrossInfoNextMode nextMode, string nextText, List<EvidenceFunction> nextEvidences, SupportChatLogBuilder? supportChatLog = null, SupportChatLogBuilder? nextsupportChatLog = null, FileOptionSpec? nextFileSpec = null, ChatLogPathSpec? nextChatLogPathSpec = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) VerbConfig orAddVerb = GetOrAddVerb(verb); ModalityConfig orAddModality = GetOrAddModality(orAddVerb, (Modality)2); int count = orAddModality.options.Count; TemplateOption item = CreateTemplateOption($"heart.{verb}.{orAddModality.modality}_{count}", string.Empty, text, evidences, string.Empty, null, null, supportChatLog != null, (supportChatLog != null) ? supportChatLog.Text : string.Empty, (supportChatLog == null) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = ((supportChatLog.Path != null) ? supportChatLog.Path : string.Empty), randomPath = (supportChatLog.Path == null) }, CreateCrossInfoSpec($"heart.{verb}.{orAddModality.modality}_{count}.cross_info", currentType, nextType, nextMode, nextText, nextEvidences, nextFileSpec, nextChatLogPathSpec, nextsupportChatLog)); orAddModality.options.Add(item); } protected void AddClosureEntry(string group, ClosureEntryType type, string text, List<EvidenceFunction>? evidences = null, FileOptionSpec? fileSpec = null, ChatLogPathSpec? chatLogPathSpec = null, SupportChatLogBuilder? supportChatLog = null) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) string group2 = group; if (!_groups.Contains(group2)) { throw new Exception("Group with name '" + group2 + "' doesn't exist - Add it first"); } if (!_starterTemplates.Any((TemplateOption t) => t.group == group2)) { throw new Exception("Group with name '" + group2 + "' doesn't have a starter template yet - Add it first"); } int num = _closure.entries.Count((ClosureEntry entry) => entry.option.group == group2); _closure.entries.Add(new ClosureEntry { type = type, option = CreateTemplateOption($"closure.{group2}_{num}", group2, text, evidences ?? new List<EvidenceFunction>(), string.Empty, fileSpec, chatLogPathSpec, supportChatLog != null, (supportChatLog != null) ? supportChatLog.Text : string.Empty, (supportChatLog == null) ? ((ChatLogPathSpec)null) : new ChatLogPathSpec { path = ((supportChatLog.Path != null) ? supportChatLog.Path : string.Empty), randomPath = (supportChatLog.Path == null) }, null) }); } private TemplateOption CreateTemplateOption(string keyPrefix, string group, string text, List<EvidenceFunction> evidences, string emailTitleText, FileOptionSpec? fileSpec, ChatLogPathSpec? chatLogPathSpec, bool generateSupportChatLog, string supportChatLogText, ChatLogPathSpec? supportChatLogPathSpec, CrossInfoSpec? crossInfoSpec) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) string textId = RegisterTranslation(keyPrefix + ".text", text); string emailTitleTextId = (string.IsNullOrEmpty(emailTitleText) ? "" : RegisterTranslation(keyPrefix + ".email_title", emailTitleText)); string supportChatLogTextId = (string.IsNullOrEmpty(supportChatLogText) ? "" : RegisterTranslation(keyPrefix + ".support_chat_log", supportChatLogText)); return new TemplateOption { group = group, textId = textId, evidence = evidences, emailTitleTextId = emailTitleTextId, fileSpec = (FileOptionSpec)(((object)fileSpec) ?? ((object)new FileOptionSpec())), chatLogPathSpec = (ChatLogPathSpec)(((object)chatLogPathSpec) ?? ((object)new ChatLogPathSpec())), generateSupportChatLog = generateSupportChatLog, supportChatLogTextId = supportChatLogTextId, supportChatLogPathSpec = (ChatLogPathSpec)(((object)supportChatLogPathSpec) ?? ((object)new ChatLogPathSpec())), crossInfoSpec = crossInfoSpec }; } protected string RegisterTranslation(string key, string value) { string translationKey = GetTranslationKey(key); translations[translationKey] = value; return translationKey; } protected string GetTranslationKey(string key) { return ExtendedMission<TInstance>.StaticKey + ".translations." + key; } public void RegisterTranslations(IDictionary<string, string> targetTranslations) { DebugLogger.Log("> Initializing " + GetType().Name + " Procedural Mission Translations"); foreach (KeyValuePair<string, string> translation in translations) { targetTranslations[translation.Key] = translation.Value; } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/ExtendedMissions/ExtendedMissions.WebsiteDefacement.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using ExtendedMissions.Missions; using ExtendedMissions.Utils; using Microsoft.CodeAnalysis; using MissionConfig; using ServiceConfig; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("ExtendedMissions.Tests")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExtendedMissions.WebsiteDefacement")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0368f7e81ede4c9deb3363bc9e60daaa62d306ad")] [assembly: AssemblyProduct("ExtendedMissions.WebsiteDefacement")] [assembly: AssemblyTitle("ExtendedMissions.WebsiteDefacement")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ExtendedMissions.Registries { internal class ActivismCorporateWebsiteMission : ExtendedDirectMission<ActivismCorporateWebsiteMission, ActivismCorporateWebsiteMission.Data> { internal class Data { } private const string ByDomainConditionTag = "BY_DOMAIN"; private const string ByIpConditionTag = "BY_IP"; private const string HTML = "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>Corporate Exposure Notice</title>\r\n <style>\r\n html { width: 100%; height: 100%; margin: 0; background: linear-gradient(180deg, #160c0c 0%, #231111 55%, #1b1510 100%); }\r\n body { margin: 0; color: #ffe7e0; font: 14px \"Trebuchet MS\", \"Segoe UI\", Arial, sans-serif; }\r\n .wrap { max-width: 860px; margin: 40px auto; border: 1px solid #7c3d3d; background: #140b0b; box-shadow: 0 10px 25px rgba(0,0,0,0.45); }\r\n .inner { margin: 10px; border: 1px solid #9a5252; background: #1d1111; }\r\n .header { padding: 10px; background: linear-gradient(90deg, #3a1717 0%, #4a1f1f 100%); border-bottom: 1px solid #7c3d3d; font-size: 11px; letter-spacing: 1px; color: #ffb2a5; }\r\n .alert { margin: 12px 12px 0 12px; padding: 8px 10px; border: 1px solid #b35c52; background: #2b1414; color: #ffd1c8; text-align: center; font-size: 11px; letter-spacing: 1px; font-weight: bold; }\r\n .hero { padding: 20px; text-align: center; border-bottom: 1px solid #7c3d3d; background: linear-gradient(180deg, #241313 0%, #1b1010 100%); }\r\n .hero h1 { margin: 0; font-size: 26px; color: #ffffff; letter-spacing: 0.6px; text-transform: uppercase; }\r\n .hero p { margin: 10px 0 0 0; font-size: 13px; color: #ffd6ce; line-height: 1.45; }\r\n .section { padding: 16px; border-bottom: 1px solid #7c3d3d; }\r\n .section-title { font-size: 12px; color: #ff9b8c; margin-bottom: 8px; letter-spacing: 0.8px; }\r\n .line { font-size: 13px; margin-bottom: 6px; color: #ffe7e0; line-height: 1.45; }\r\n .quote-box { margin: 0 16px 16px 16px; padding: 12px; border: 1px solid #9a5252; background: #180d0d; color: #ffd7ce; font-size: 13px; line-height: 1.5; text-align: center; }\r\n .footer { padding: 10px; text-align: center; font-size: 11px; color: #d99a90; }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"wrap\">\r\n <div class=\"inner\">\r\n <div class=\"header\">PUBLIC ACCESS NODE // CORPORATE ACCOUNTABILITY MESSAGE</div>\r\n\r\n <div class=\"alert\">THIS PAGE HAS BEEN REPURPOSED TO CHALLENGE CORPORATE POWER</div>\r\n\r\n <div class=\"hero\">\r\n <h1>No More Corporate Silence</h1>\r\n <p>This message applies to every storefront, bank terminal, restaurant chain, and supermarket aisle. Wherever profit overrides people, accountability must follow.</p>\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">ACROSS ALL INDUSTRIES</div>\r\n <div class=\"line\">- Shops: pricing pressure, supplier squeeze, and worker underpayment hidden behind friendly branding.</div>\r\n <div class=\"line\">- Banks: fees, leverage, and risk shifted onto customers while gains remain private.</div>\r\n <div class=\"line\">- Restaurants: long hours, low wages, and unstable work normalized as \"industry standard\".</div>\r\n <div class=\"line\">- Supermarkets: cost-cutting that impacts workers and suppliers while shelves stay full.</div>\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">THE PATTERN</div>\r\n <div class=\"line\">- Polished interfaces, loyalty programs, and marketing campaigns conceal structural imbalance.</div>\r\n <div class=\"line\">- Decisions are centralized, consequences are distributed to workers and customers.</div>\r\n <div class=\"line\">- When profit rises, responsibility is deferred; when losses occur, the public absorbs them.</div>\r\n </div>\r\n\r\n <div class=\"quote-box\">\r\n They call it business. We call it extraction.<br>\r\n They call it efficiency. We call it disposable lives.<br>\r\n They call it growth. We call it power without accountability.\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">WHAT PEOPLE CAN DO</div>\r\n <div class=\"line\">- Ask questions, compare sources, and refuse blind trust in branding.</div>\r\n <div class=\"line\">- Support fair labor, transparent pricing, and ethical operations.</div>\r\n <div class=\"line\">- Share information and hold institutions accountable through visibility.</div>\r\n </div>\r\n\r\n <div class=\"footer\">people over profit // awareness across all sectors</div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>"; private int MissionConditionWebsiteByDomain => base.GetConditionId("BY_DOMAIN"); protected override string Title => "Corporate Website Exposure"; protected override string Preview => "Expose a target website by replacing its content with an activism message."; protected override string Mail => "The client wants to expose a website.\nOperate on /Public/htdocs/website.html."; protected override string Details => "The client wants to expose a website by replacing its content with an activism message. The required HTML page is attached to the contract mail."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["BY_DOMAIN"] = "Target the website identified by domain $TARGET.", ["BY_IP"] = "Target the website hosted at public IP $TARGET." }; public override Archivo? GetMailAttachment(ActiveMission mission) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Archivo val = new Archivo("website.html", "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>Corporate Exposure Notice</title>\r\n <style>\r\n html { width: 100%; height: 100%; margin: 0; background: linear-gradient(180deg, #160c0c 0%, #231111 55%, #1b1510 100%); }\r\n body { margin: 0; color: #ffe7e0; font: 14px \"Trebuchet MS\", \"Segoe UI\", Arial, sans-serif; }\r\n .wrap { max-width: 860px; margin: 40px auto; border: 1px solid #7c3d3d; background: #140b0b; box-shadow: 0 10px 25px rgba(0,0,0,0.45); }\r\n .inner { margin: 10px; border: 1px solid #9a5252; background: #1d1111; }\r\n .header { padding: 10px; background: linear-gradient(90deg, #3a1717 0%, #4a1f1f 100%); border-bottom: 1px solid #7c3d3d; font-size: 11px; letter-spacing: 1px; color: #ffb2a5; }\r\n .alert { margin: 12px 12px 0 12px; padding: 8px 10px; border: 1px solid #b35c52; background: #2b1414; color: #ffd1c8; text-align: center; font-size: 11px; letter-spacing: 1px; font-weight: bold; }\r\n .hero { padding: 20px; text-align: center; border-bottom: 1px solid #7c3d3d; background: linear-gradient(180deg, #241313 0%, #1b1010 100%); }\r\n .hero h1 { margin: 0; font-size: 26px; color: #ffffff; letter-spacing: 0.6px; text-transform: uppercase; }\r\n .hero p { margin: 10px 0 0 0; font-size: 13px; color: #ffd6ce; line-height: 1.45; }\r\n .section { padding: 16px; border-bottom: 1px solid #7c3d3d; }\r\n .section-title { font-size: 12px; color: #ff9b8c; margin-bottom: 8px; letter-spacing: 0.8px; }\r\n .line { font-size: 13px; margin-bottom: 6px; color: #ffe7e0; line-height: 1.45; }\r\n .quote-box { margin: 0 16px 16px 16px; padding: 12px; border: 1px solid #9a5252; background: #180d0d; color: #ffd7ce; font-size: 13px; line-height: 1.5; text-align: center; }\r\n .footer { padding: 10px; text-align: center; font-size: 11px; color: #d99a90; }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"wrap\">\r\n <div class=\"inner\">\r\n <div class=\"header\">PUBLIC ACCESS NODE // CORPORATE ACCOUNTABILITY MESSAGE</div>\r\n\r\n <div class=\"alert\">THIS PAGE HAS BEEN REPURPOSED TO CHALLENGE CORPORATE POWER</div>\r\n\r\n <div class=\"hero\">\r\n <h1>No More Corporate Silence</h1>\r\n <p>This message applies to every storefront, bank terminal, restaurant chain, and supermarket aisle. Wherever profit overrides people, accountability must follow.</p>\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">ACROSS ALL INDUSTRIES</div>\r\n <div class=\"line\">- Shops: pricing pressure, supplier squeeze, and worker underpayment hidden behind friendly branding.</div>\r\n <div class=\"line\">- Banks: fees, leverage, and risk shifted onto customers while gains remain private.</div>\r\n <div class=\"line\">- Restaurants: long hours, low wages, and unstable work normalized as \"industry standard\".</div>\r\n <div class=\"line\">- Supermarkets: cost-cutting that impacts workers and suppliers while shelves stay full.</div>\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">THE PATTERN</div>\r\n <div class=\"line\">- Polished interfaces, loyalty programs, and marketing campaigns conceal structural imbalance.</div>\r\n <div class=\"line\">- Decisions are centralized, consequences are distributed to workers and customers.</div>\r\n <div class=\"line\">- When profit rises, responsibility is deferred; when losses occur, the public absorbs them.</div>\r\n </div>\r\n\r\n <div class=\"quote-box\">\r\n They call it business. We call it extraction.<br>\r\n They call it efficiency. We call it disposable lives.<br>\r\n They call it growth. We call it power without accountability.\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">WHAT PEOPLE CAN DO</div>\r\n <div class=\"line\">- Ask questions, compare sources, and refuse blind trust in branding.</div>\r\n <div class=\"line\">- Support fair labor, transparent pricing, and ethical operations.</div>\r\n <div class=\"line\">- Share information and hold institutions accountable through visibility.</div>\r\n </div>\r\n\r\n <div class=\"footer\">people over profit // awareness across all sectors</div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>", "Unknown", (TypeFile)0, true, true); val.SetBinario(false); return val; } protected override PreparedMission<ActivismCorporateWebsiteMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[ActivismCorporateWebsiteMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); IEnumerable<KeyValuePair<TipoRed, List<Servicio>>> source = XmlGlobal.Singleton.tipoServidor.publicServices.Where(delegate(KeyValuePair<TipoRed, List<Servicio>> s) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (s.Value.Any((Servicio service) => (int)service.ID == 2)) { TipoRed[] array = new TipoRed[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return ((IEnumerable<TipoRed>)(object)array).Contains(s.Key); } return false; }); TipoRed key = source.ElementAt(random.Next(source.Count())).Key; Router val = ServerMap.Singleton.SpawnRouter(key, mission.GetAccessType(), (Mission)null, false, "", (GenerationProfile)0); Computer httpTarget = GetHttpTarget(val, random); if (httpTarget == null) { return null; } string text = ((TypeHelpers.ToExtendedConditionId(mission.condition.condition) == MissionConditionWebsiteByDomain) ? val.GetDomain() : ((Computer)val).GetPublicIP()); string text2 = base.BuildMissionText(mission, language, new(string, string)[1] { ("$TARGET", StringExtensions.BoldString(text)) }); return new PreparedMission<ActivismCorporateWebsiteMission, Data> { TargetComputer = httpTarget, KarmaType = (KarmaType)2, MissionData = new Data(), Text = text2 }; } protected override bool ValidateMission(ActiveMission activeMission, string message, Archivo attachment) { Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(activeMission.targetComputerID, true, (Router)null); if (remoteComputer == null) { return false; } if (!remoteComputer.ExisteServicio((ServicioID)2)) { return false; } Archivo archivo = remoteComputer.GetFileSystem().GetArchivo("/Public/htdocs/website.html", true, 0); if (archivo == null || archivo.IsBinario()) { return false; } return archivo.GetContenido() == "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>Corporate Exposure Notice</title>\r\n <style>\r\n html { width: 100%; height: 100%; margin: 0; background: linear-gradient(180deg, #160c0c 0%, #231111 55%, #1b1510 100%); }\r\n body { margin: 0; color: #ffe7e0; font: 14px \"Trebuchet MS\", \"Segoe UI\", Arial, sans-serif; }\r\n .wrap { max-width: 860px; margin: 40px auto; border: 1px solid #7c3d3d; background: #140b0b; box-shadow: 0 10px 25px rgba(0,0,0,0.45); }\r\n .inner { margin: 10px; border: 1px solid #9a5252; background: #1d1111; }\r\n .header { padding: 10px; background: linear-gradient(90deg, #3a1717 0%, #4a1f1f 100%); border-bottom: 1px solid #7c3d3d; font-size: 11px; letter-spacing: 1px; color: #ffb2a5; }\r\n .alert { margin: 12px 12px 0 12px; padding: 8px 10px; border: 1px solid #b35c52; background: #2b1414; color: #ffd1c8; text-align: center; font-size: 11px; letter-spacing: 1px; font-weight: bold; }\r\n .hero { padding: 20px; text-align: center; border-bottom: 1px solid #7c3d3d; background: linear-gradient(180deg, #241313 0%, #1b1010 100%); }\r\n .hero h1 { margin: 0; font-size: 26px; color: #ffffff; letter-spacing: 0.6px; text-transform: uppercase; }\r\n .hero p { margin: 10px 0 0 0; font-size: 13px; color: #ffd6ce; line-height: 1.45; }\r\n .section { padding: 16px; border-bottom: 1px solid #7c3d3d; }\r\n .section-title { font-size: 12px; color: #ff9b8c; margin-bottom: 8px; letter-spacing: 0.8px; }\r\n .line { font-size: 13px; margin-bottom: 6px; color: #ffe7e0; line-height: 1.45; }\r\n .quote-box { margin: 0 16px 16px 16px; padding: 12px; border: 1px solid #9a5252; background: #180d0d; color: #ffd7ce; font-size: 13px; line-height: 1.5; text-align: center; }\r\n .footer { padding: 10px; text-align: center; font-size: 11px; color: #d99a90; }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"wrap\">\r\n <div class=\"inner\">\r\n <div class=\"header\">PUBLIC ACCESS NODE // CORPORATE ACCOUNTABILITY MESSAGE</div>\r\n\r\n <div class=\"alert\">THIS PAGE HAS BEEN REPURPOSED TO CHALLENGE CORPORATE POWER</div>\r\n\r\n <div class=\"hero\">\r\n <h1>No More Corporate Silence</h1>\r\n <p>This message applies to every storefront, bank terminal, restaurant chain, and supermarket aisle. Wherever profit overrides people, accountability must follow.</p>\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">ACROSS ALL INDUSTRIES</div>\r\n <div class=\"line\">- Shops: pricing pressure, supplier squeeze, and worker underpayment hidden behind friendly branding.</div>\r\n <div class=\"line\">- Banks: fees, leverage, and risk shifted onto customers while gains remain private.</div>\r\n <div class=\"line\">- Restaurants: long hours, low wages, and unstable work normalized as \"industry standard\".</div>\r\n <div class=\"line\">- Supermarkets: cost-cutting that impacts workers and suppliers while shelves stay full.</div>\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">THE PATTERN</div>\r\n <div class=\"line\">- Polished interfaces, loyalty programs, and marketing campaigns conceal structural imbalance.</div>\r\n <div class=\"line\">- Decisions are centralized, consequences are distributed to workers and customers.</div>\r\n <div class=\"line\">- When profit rises, responsibility is deferred; when losses occur, the public absorbs them.</div>\r\n </div>\r\n\r\n <div class=\"quote-box\">\r\n They call it business. We call it extraction.<br>\r\n They call it efficiency. We call it disposable lives.<br>\r\n They call it growth. We call it power without accountability.\r\n </div>\r\n\r\n <div class=\"section\">\r\n <div class=\"section-title\">WHAT PEOPLE CAN DO</div>\r\n <div class=\"line\">- Ask questions, compare sources, and refuse blind trust in branding.</div>\r\n <div class=\"line\">- Support fair labor, transparent pricing, and ethical operations.</div>\r\n <div class=\"line\">- Share information and hold institutions accountable through visibility.</div>\r\n </div>\r\n\r\n <div class=\"footer\">people over profit // awareness across all sectors</div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>"; } private static Computer? GetHttpTarget(Router router, Random random) { List<Computer> list = new List<Computer>(); if (((Computer)router).ExisteServicio((ServicioID)2)) { list.Add((Computer)(object)router); } list.AddRange(from computer in router.GetComputers(true) where computer != null && computer.ExisteServicio((ServicioID)2) select computer); if (list.Count == 0) { return null; } return list[random.Next(list.Count)]; } } internal class HackerCompromiseWebsiteMission : ExtendedDirectMission<HackerCompromiseWebsiteMission, HackerCompromiseWebsiteMission.Data> { internal class Data { } private const string ByDomainConditionTag = "BY_DOMAIN"; private const string ByIpConditionTag = "BY_IP"; private const string HTML = "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>System Breach Notice</title>\r\n <style type=\"text/css\">\r\n html {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n background: #050805;\r\n }\r\n\r\n body {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n color: #7CFFB2;\r\n font: 13px \"Courier New\", monospace;\r\n }\r\n\r\n .scroll-root {\r\n width: 100%;\r\n height: 100%;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n box-sizing: border-box;\r\n padding: 20px 0;\r\n }\r\n\r\n .page {\r\n width: 860px;\r\n max-width: 95%;\r\n margin: 0 auto 18px auto;\r\n border: 1px solid #1f5f3f;\r\n background: #020403;\r\n box-shadow: 0 0 20px rgba(0,255,150,0.15);\r\n }\r\n\r\n .shell {\r\n margin: 10px;\r\n border: 1px solid #2c8f63;\r\n background: #040807;\r\n }\r\n\r\n .top {\r\n padding: 8px 12px;\r\n border-bottom: 1px solid #1f5f3f;\r\n background: #06120d;\r\n color: #63ff9e;\r\n font-size: 11px;\r\n letter-spacing: 1px;\r\n }\r\n\r\n .warning {\r\n margin: 12px;\r\n padding: 6px;\r\n border: 1px solid #2c8f63;\r\n text-align: center;\r\n font-size: 11px;\r\n }\r\n\r\n .hero {\r\n margin: 12px;\r\n padding: 14px;\r\n border: 1px solid #2c8f63;\r\n text-align: center;\r\n }\r\n\r\n .hero img {\r\n display: block;\r\n margin: 0 auto 10px auto;\r\n border: 1px solid #2c8f63;\r\n padding: 4px;\r\n }\r\n\r\n .headline {\r\n margin: 0;\r\n font-size: 20px;\r\n text-transform: uppercase;\r\n }\r\n\r\n .subhead {\r\n margin: 6px 0;\r\n font-size: 11px;\r\n color: #55d98f;\r\n }\r\n\r\n .hero-copy {\r\n margin: 8px 0 0 0;\r\n font-size: 12px;\r\n line-height: 1.4;\r\n }\r\n\r\n .section-title {\r\n margin: 0 12px 6px 12px;\r\n font-size: 11px;\r\n color: #55d98f;\r\n }\r\n\r\n .panel {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #1f5f3f;\r\n background: #010201;\r\n padding: 10px;\r\n }\r\n\r\n .line {\r\n margin: 0 0 6px 0;\r\n font-size: 12px;\r\n }\r\n\r\n .terminal {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #1f5f3f;\r\n background: #000000;\r\n padding: 10px;\r\n font-size: 11px;\r\n color: #8affc1;\r\n white-space: pre-wrap;\r\n line-height: 1.4;\r\n }\r\n\r\n .footer {\r\n margin: 0 12px 12px 12px;\r\n border-top: 1px solid #1f5f3f;\r\n padding-top: 8px;\r\n text-align: center;\r\n font-size: 10px;\r\n color: #4ed488;\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"scroll-root\">\r\n <div class=\"page\">\r\n <div class=\"shell\">\r\n <div class=\"top\">[REMOTE ACCESS TERMINAL] // SESSION ACTIVE</div>\r\n\r\n <div class=\"warning\">!!! SYSTEM COMPROMISED !!!</div>\r\n\r\n <div class=\"hero\">\r\n <img src=\"gecko.png\" width=\"84\" height=\"84\">\r\n <p class=\"headline\">Hacked by Gecko Crew</p>\r\n <p class=\"subhead\">-- WE WERE HERE --</p>\r\n <p class=\"hero-copy\">Root access obtained. Surface replaced. Signal delivered. Your defenses failed under minimal resistance.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">BREACH NOTES</p>\r\n <div class=\"panel\">\r\n <p class=\"line\">- Unauthorized access gained via weak entry point.</p>\r\n <p class=\"line\">- Frontend replaced for visibility.</p>\r\n <p class=\"line\">- System integrity cannot be trusted.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">EXPOSED LOG SNIPPET</p>\r\n <div class=\"terminal\">\r\n [22:14:03] connection accepted :: 192.168.0.42\r\n [22:14:05] auth bypass :: success\r\n [22:14:07] privilege escalation :: root\r\n [22:14:12] reading /config/admin.json\r\n [22:14:15] dumping credentials... done\r\n [22:14:18] injecting payload :: index.html\r\n [22:14:21] overwrite complete\r\n [22:14:22] session closed\r\n </div>\r\n\r\n <div class=\"footer\">gecko crew // persistence is temporary</div>\r\n </div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>"; private int MissionConditionWebsiteByDomain => base.GetConditionId("BY_DOMAIN"); protected override string Title => "Compromise a Target Website"; protected override string Preview => "Compromise a target website by replacing its content with a hacker notice."; protected override string Mail => "The client wants to compromise a website.\nOperate on /Public/htdocs/website.html."; protected override string Details => "The client wants to compromise a website by replacing its content with a message from the Gecko Crew. The required HTML page is attached to the contract mail."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["BY_DOMAIN"] = "Target the website identified by domain $TARGET.", ["BY_IP"] = "Target the website hosted at public IP $TARGET." }; public override Archivo? GetMailAttachment(ActiveMission mission) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Archivo val = new Archivo("website.html", "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>System Breach Notice</title>\r\n <style type=\"text/css\">\r\n html {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n background: #050805;\r\n }\r\n\r\n body {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n color: #7CFFB2;\r\n font: 13px \"Courier New\", monospace;\r\n }\r\n\r\n .scroll-root {\r\n width: 100%;\r\n height: 100%;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n box-sizing: border-box;\r\n padding: 20px 0;\r\n }\r\n\r\n .page {\r\n width: 860px;\r\n max-width: 95%;\r\n margin: 0 auto 18px auto;\r\n border: 1px solid #1f5f3f;\r\n background: #020403;\r\n box-shadow: 0 0 20px rgba(0,255,150,0.15);\r\n }\r\n\r\n .shell {\r\n margin: 10px;\r\n border: 1px solid #2c8f63;\r\n background: #040807;\r\n }\r\n\r\n .top {\r\n padding: 8px 12px;\r\n border-bottom: 1px solid #1f5f3f;\r\n background: #06120d;\r\n color: #63ff9e;\r\n font-size: 11px;\r\n letter-spacing: 1px;\r\n }\r\n\r\n .warning {\r\n margin: 12px;\r\n padding: 6px;\r\n border: 1px solid #2c8f63;\r\n text-align: center;\r\n font-size: 11px;\r\n }\r\n\r\n .hero {\r\n margin: 12px;\r\n padding: 14px;\r\n border: 1px solid #2c8f63;\r\n text-align: center;\r\n }\r\n\r\n .hero img {\r\n display: block;\r\n margin: 0 auto 10px auto;\r\n border: 1px solid #2c8f63;\r\n padding: 4px;\r\n }\r\n\r\n .headline {\r\n margin: 0;\r\n font-size: 20px;\r\n text-transform: uppercase;\r\n }\r\n\r\n .subhead {\r\n margin: 6px 0;\r\n font-size: 11px;\r\n color: #55d98f;\r\n }\r\n\r\n .hero-copy {\r\n margin: 8px 0 0 0;\r\n font-size: 12px;\r\n line-height: 1.4;\r\n }\r\n\r\n .section-title {\r\n margin: 0 12px 6px 12px;\r\n font-size: 11px;\r\n color: #55d98f;\r\n }\r\n\r\n .panel {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #1f5f3f;\r\n background: #010201;\r\n padding: 10px;\r\n }\r\n\r\n .line {\r\n margin: 0 0 6px 0;\r\n font-size: 12px;\r\n }\r\n\r\n .terminal {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #1f5f3f;\r\n background: #000000;\r\n padding: 10px;\r\n font-size: 11px;\r\n color: #8affc1;\r\n white-space: pre-wrap;\r\n line-height: 1.4;\r\n }\r\n\r\n .footer {\r\n margin: 0 12px 12px 12px;\r\n border-top: 1px solid #1f5f3f;\r\n padding-top: 8px;\r\n text-align: center;\r\n font-size: 10px;\r\n color: #4ed488;\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"scroll-root\">\r\n <div class=\"page\">\r\n <div class=\"shell\">\r\n <div class=\"top\">[REMOTE ACCESS TERMINAL] // SESSION ACTIVE</div>\r\n\r\n <div class=\"warning\">!!! SYSTEM COMPROMISED !!!</div>\r\n\r\n <div class=\"hero\">\r\n <img src=\"gecko.png\" width=\"84\" height=\"84\">\r\n <p class=\"headline\">Hacked by Gecko Crew</p>\r\n <p class=\"subhead\">-- WE WERE HERE --</p>\r\n <p class=\"hero-copy\">Root access obtained. Surface replaced. Signal delivered. Your defenses failed under minimal resistance.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">BREACH NOTES</p>\r\n <div class=\"panel\">\r\n <p class=\"line\">- Unauthorized access gained via weak entry point.</p>\r\n <p class=\"line\">- Frontend replaced for visibility.</p>\r\n <p class=\"line\">- System integrity cannot be trusted.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">EXPOSED LOG SNIPPET</p>\r\n <div class=\"terminal\">\r\n [22:14:03] connection accepted :: 192.168.0.42\r\n [22:14:05] auth bypass :: success\r\n [22:14:07] privilege escalation :: root\r\n [22:14:12] reading /config/admin.json\r\n [22:14:15] dumping credentials... done\r\n [22:14:18] injecting payload :: index.html\r\n [22:14:21] overwrite complete\r\n [22:14:22] session closed\r\n </div>\r\n\r\n <div class=\"footer\">gecko crew // persistence is temporary</div>\r\n </div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>", "Unknown", (TypeFile)0, true, true); val.SetBinario(false); return val; } protected override PreparedMission<HackerCompromiseWebsiteMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[HackerCompromiseWebsiteMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); IEnumerable<KeyValuePair<TipoRed, List<Servicio>>> source = XmlGlobal.Singleton.tipoServidor.publicServices.Where((KeyValuePair<TipoRed, List<Servicio>> s) => s.Value.Any((Servicio service) => (int)service.ID == 2)); TipoRed key = source.ElementAt(random.Next(source.Count())).Key; Router val = ServerMap.Singleton.SpawnRouter(key, mission.GetAccessType(), (Mission)null, false, "", (GenerationProfile)0); Computer httpTarget = GetHttpTarget(val, random); if (httpTarget == null) { return null; } string text = ((TypeHelpers.ToExtendedConditionId(mission.condition.condition) == MissionConditionWebsiteByDomain) ? val.GetDomain() : ((Computer)val).GetPublicIP()); string text2 = base.BuildMissionText(mission, language, new(string, string)[1] { ("$TARGET", StringExtensions.BoldString(text)) }); return new PreparedMission<HackerCompromiseWebsiteMission, Data> { TargetComputer = httpTarget, KarmaType = (KarmaType)1, MissionData = new Data(), Text = text2 }; } protected override bool ValidateMission(ActiveMission activeMission, string message, Archivo attachment) { Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(activeMission.targetComputerID, true, (Router)null); if (remoteComputer == null) { return false; } if (!remoteComputer.ExisteServicio((ServicioID)2)) { return false; } Archivo archivo = remoteComputer.GetFileSystem().GetArchivo("/Public/htdocs/website.html", true, 0); if (archivo == null || archivo.IsBinario()) { return false; } return archivo.GetContenido() == "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>System Breach Notice</title>\r\n <style type=\"text/css\">\r\n html {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n background: #050805;\r\n }\r\n\r\n body {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n color: #7CFFB2;\r\n font: 13px \"Courier New\", monospace;\r\n }\r\n\r\n .scroll-root {\r\n width: 100%;\r\n height: 100%;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n box-sizing: border-box;\r\n padding: 20px 0;\r\n }\r\n\r\n .page {\r\n width: 860px;\r\n max-width: 95%;\r\n margin: 0 auto 18px auto;\r\n border: 1px solid #1f5f3f;\r\n background: #020403;\r\n box-shadow: 0 0 20px rgba(0,255,150,0.15);\r\n }\r\n\r\n .shell {\r\n margin: 10px;\r\n border: 1px solid #2c8f63;\r\n background: #040807;\r\n }\r\n\r\n .top {\r\n padding: 8px 12px;\r\n border-bottom: 1px solid #1f5f3f;\r\n background: #06120d;\r\n color: #63ff9e;\r\n font-size: 11px;\r\n letter-spacing: 1px;\r\n }\r\n\r\n .warning {\r\n margin: 12px;\r\n padding: 6px;\r\n border: 1px solid #2c8f63;\r\n text-align: center;\r\n font-size: 11px;\r\n }\r\n\r\n .hero {\r\n margin: 12px;\r\n padding: 14px;\r\n border: 1px solid #2c8f63;\r\n text-align: center;\r\n }\r\n\r\n .hero img {\r\n display: block;\r\n margin: 0 auto 10px auto;\r\n border: 1px solid #2c8f63;\r\n padding: 4px;\r\n }\r\n\r\n .headline {\r\n margin: 0;\r\n font-size: 20px;\r\n text-transform: uppercase;\r\n }\r\n\r\n .subhead {\r\n margin: 6px 0;\r\n font-size: 11px;\r\n color: #55d98f;\r\n }\r\n\r\n .hero-copy {\r\n margin: 8px 0 0 0;\r\n font-size: 12px;\r\n line-height: 1.4;\r\n }\r\n\r\n .section-title {\r\n margin: 0 12px 6px 12px;\r\n font-size: 11px;\r\n color: #55d98f;\r\n }\r\n\r\n .panel {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #1f5f3f;\r\n background: #010201;\r\n padding: 10px;\r\n }\r\n\r\n .line {\r\n margin: 0 0 6px 0;\r\n font-size: 12px;\r\n }\r\n\r\n .terminal {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #1f5f3f;\r\n background: #000000;\r\n padding: 10px;\r\n font-size: 11px;\r\n color: #8affc1;\r\n white-space: pre-wrap;\r\n line-height: 1.4;\r\n }\r\n\r\n .footer {\r\n margin: 0 12px 12px 12px;\r\n border-top: 1px solid #1f5f3f;\r\n padding-top: 8px;\r\n text-align: center;\r\n font-size: 10px;\r\n color: #4ed488;\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"scroll-root\">\r\n <div class=\"page\">\r\n <div class=\"shell\">\r\n <div class=\"top\">[REMOTE ACCESS TERMINAL] // SESSION ACTIVE</div>\r\n\r\n <div class=\"warning\">!!! SYSTEM COMPROMISED !!!</div>\r\n\r\n <div class=\"hero\">\r\n <img src=\"gecko.png\" width=\"84\" height=\"84\">\r\n <p class=\"headline\">Hacked by Gecko Crew</p>\r\n <p class=\"subhead\">-- WE WERE HERE --</p>\r\n <p class=\"hero-copy\">Root access obtained. Surface replaced. Signal delivered. Your defenses failed under minimal resistance.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">BREACH NOTES</p>\r\n <div class=\"panel\">\r\n <p class=\"line\">- Unauthorized access gained via weak entry point.</p>\r\n <p class=\"line\">- Frontend replaced for visibility.</p>\r\n <p class=\"line\">- System integrity cannot be trusted.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">EXPOSED LOG SNIPPET</p>\r\n <div class=\"terminal\">\r\n [22:14:03] connection accepted :: 192.168.0.42\r\n [22:14:05] auth bypass :: success\r\n [22:14:07] privilege escalation :: root\r\n [22:14:12] reading /config/admin.json\r\n [22:14:15] dumping credentials... done\r\n [22:14:18] injecting payload :: index.html\r\n [22:14:21] overwrite complete\r\n [22:14:22] session closed\r\n </div>\r\n\r\n <div class=\"footer\">gecko crew // persistence is temporary</div>\r\n </div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>"; } private static Computer? GetHttpTarget(Router router, Random random) { List<Computer> list = new List<Computer>(); if (((Computer)router).ExisteServicio((ServicioID)2)) { list.Add((Computer)(object)router); } list.AddRange(from computer in router.GetComputers(true) where computer != null && computer.ExisteServicio((ServicioID)2) select computer); if (list.Count == 0) { return null; } return list[random.Next(list.Count)]; } } internal class PoliceSeizeWebsiteMission : ExtendedDirectMission<PoliceSeizeWebsiteMission, PoliceSeizeWebsiteMission.Data> { internal class Data { } private const string ByDomainConditionTag = "BY_DOMAIN"; private const string ByIpConditionTag = "BY_IP"; private const string HTML = "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>Police Seizure Notice</title>\r\n <style type=\"text/css\">\r\n html {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n background: linear-gradient(180deg, #1f3550 0%, #223f63 60%, #2a4c75 100%);\r\n }\r\n\r\n body {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n color: #dbe8f4;\r\n font: 14px \"Trebuchet MS\", \"Segoe UI\", Arial, sans-serif;\r\n }\r\n\r\n .scroll-root {\r\n width: 100%;\r\n height: 100%;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n box-sizing: border-box;\r\n padding: 20px 0;\r\n }\r\n\r\n .page {\r\n width: 860px;\r\n max-width: 95%;\r\n margin: 0 auto 18px auto;\r\n border: 1px solid #3f5f84;\r\n background: #0f1f33;\r\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);\r\n }\r\n\r\n .shell {\r\n margin: 10px;\r\n border: 1px solid #4b6d92;\r\n background: #142842;\r\n }\r\n\r\n .top {\r\n padding: 9px 12px;\r\n border-bottom: 1px solid #3f5f84;\r\n background: #1d3758;\r\n color: #b9d5f2;\r\n font-size: 11px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .alert-bar {\r\n margin: 12px 12px 0 12px;\r\n padding: 8px 10px;\r\n border: 1px solid #8e4b56;\r\n background: linear-gradient(180deg, #6e2933 0%, #58212a 100%);\r\n color: #ffd8dc;\r\n text-align: center;\r\n font-size: 11px;\r\n letter-spacing: 1px;\r\n font-weight: bold;\r\n }\r\n\r\n .hero {\r\n margin: 12px;\r\n padding: 16px;\r\n border: 1px solid #4f759b;\r\n background: linear-gradient(180deg, #1b3453 0%, #162d49 100%);\r\n text-align: center;\r\n }\r\n\r\n .headline {\r\n margin: 0;\r\n font-size: 22px;\r\n color: #dcecff;\r\n letter-spacing: 0.7px;\r\n }\r\n\r\n .subhead {\r\n margin: 6px 0 0 0;\r\n color: #9bc1ea;\r\n font-size: 12px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .hero-copy {\r\n margin: 10px 0 0 0;\r\n color: #c0d7ee;\r\n font-family: inherit;\r\n font-size: 12px;\r\n line-height: 1.45;\r\n }\r\n\r\n .section-title {\r\n margin: 0 12px 8px 12px;\r\n color: #9bc1ea;\r\n font-size: 12px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .panel {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #496d94;\r\n background: #132840;\r\n padding: 10px 12px;\r\n }\r\n\r\n .line {\r\n margin: 0 0 7px 0;\r\n color: #c1d8ee;\r\n font-size: 12px;\r\n line-height: 1.4;\r\n }\r\n\r\n .line:last-child {\r\n margin-bottom: 0;\r\n }\r\n\r\n .grid {\r\n margin: 0 12px 12px 12px;\r\n text-align: center;\r\n }\r\n\r\n .card {\r\n display: inline-block;\r\n vertical-align: top;\r\n width: 31%;\r\n min-width: 180px;\r\n margin: 0 4px 8px 4px;\r\n border: 1px solid #496d94;\r\n border-top-width: 3px;\r\n background: #18314d;\r\n padding: 10px 8px;\r\n box-sizing: border-box;\r\n text-align: left;\r\n }\r\n\r\n .card-1 {\r\n border-top-color: #7aa0c8;\r\n }\r\n\r\n .card-2 {\r\n border-top-color: #d57a84;\r\n }\r\n\r\n .card-3 {\r\n border-top-color: #8bb890;\r\n }\r\n\r\n .card-tag {\r\n margin: 0 0 6px 0;\r\n font-size: 9px;\r\n letter-spacing: 0.8px;\r\n font-weight: bold;\r\n color: #9fc4e8;\r\n }\r\n\r\n .card-name {\r\n margin: 0;\r\n color: #e0eeff;\r\n font-size: 14px;\r\n }\r\n\r\n .card-info {\r\n margin: 6px 0 0 0;\r\n color: #bdd2e7;\r\n font-size: 12px;\r\n line-height: 1.35;\r\n }\r\n\r\n .footer {\r\n margin: 0 12px 12px 12px;\r\n border-top: 1px solid #4f759b;\r\n padding-top: 8px;\r\n color: #9dbbd8;\r\n font-size: 10px;\r\n text-align: center;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n .card {\r\n display: block;\r\n width: auto;\r\n margin: 0 0 8px 0;\r\n }\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"scroll-root\">\r\n <div class=\"page\">\r\n <div class=\"shell\">\r\n <div class=\"top\">CITY POLICE NETWORK // ENFORCEMENT ACTION NOTICE</div>\r\n\r\n <div class=\"alert-bar\">RESTRICTED ACCESS // DIGITAL PROPERTY SEIZED</div>\r\n\r\n <div class=\"hero\">\r\n <img src=\"badge.png\" width=\"74\" height=\"74\" style=\"display:block;margin:0 auto 10px auto;\">\r\n <p class=\"headline\">This Site Has Been Seized</p>\r\n <p class=\"subhead\">By Order of the City Police Department</p>\r\n <p class=\"hero-copy\">Access to this service has been suspended as part of an active police action. The domain, content, and associated digital assets are currently under official control pending investigation, evidence review, and further municipal procedure.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">STATUS NOTICE</p>\r\n <div class=\"panel\">\r\n <p class=\"line\">- This page is no longer operated by its prior owners or administrators.</p>\r\n <p class=\"line\">- All connected systems, records, and hosted materials may be subject to examination.</p>\r\n <p class=\"line\">- Unauthorized attempts to restore, alter, or bypass this notice may result in additional charges.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">ENFORCEMENT DETAILS</p>\r\n <div class=\"grid\">\r\n <div class=\"card card-1\">\r\n <p class=\"card-tag\">ACTION</p>\r\n <p class=\"card-name\">Service Frozen</p>\r\n <p class=\"card-info\">Public access has been disabled while the department secures relevant digital property and linked infrastructure.</p>\r\n </div>\r\n <div class=\"card card-2\">\r\n <p class=\"card-tag\">LEGAL STATUS</p>\r\n <p class=\"card-name\">Under Investigation</p>\r\n <p class=\"card-info\">Records and materials connected to this page are being retained for official review and possible criminal proceedings.</p>\r\n </div>\r\n <div class=\"card card-3\">\r\n <p class=\"card-tag\">CONTACT</p>\r\n <p class=\"card-name\">Police Records Desk</p>\r\n <p class=\"card-info\">Authorized parties may contact the department through standard municipal channels for verified case-related inquiries.</p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"footer\">Official municipal portal // Verified law enforcement notice</div>\r\n </div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>"; private int MissionConditionWebsiteByDomain => base.GetConditionId("BY_DOMAIN"); protected override string Title => "Website Seizure Notice"; protected override string Preview => "Seize a target website by replacing its content with a police notice."; protected override string Mail => "The client wants to seize a website.\nOperate on /Public/htdocs/website.html."; protected override string Details => "The client wants to seize a website by replacing its content with a police notice. The required HTML page is attached to the contract mail."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)2; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["BY_DOMAIN"] = "Target the website identified by domain $TARGET.", ["BY_IP"] = "Target the website hosted at public IP $TARGET." }; public override Archivo? GetMailAttachment(ActiveMission mission) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Archivo val = new Archivo("website.html", "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>Police Seizure Notice</title>\r\n <style type=\"text/css\">\r\n html {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n background: linear-gradient(180deg, #1f3550 0%, #223f63 60%, #2a4c75 100%);\r\n }\r\n\r\n body {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n color: #dbe8f4;\r\n font: 14px \"Trebuchet MS\", \"Segoe UI\", Arial, sans-serif;\r\n }\r\n\r\n .scroll-root {\r\n width: 100%;\r\n height: 100%;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n box-sizing: border-box;\r\n padding: 20px 0;\r\n }\r\n\r\n .page {\r\n width: 860px;\r\n max-width: 95%;\r\n margin: 0 auto 18px auto;\r\n border: 1px solid #3f5f84;\r\n background: #0f1f33;\r\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);\r\n }\r\n\r\n .shell {\r\n margin: 10px;\r\n border: 1px solid #4b6d92;\r\n background: #142842;\r\n }\r\n\r\n .top {\r\n padding: 9px 12px;\r\n border-bottom: 1px solid #3f5f84;\r\n background: #1d3758;\r\n color: #b9d5f2;\r\n font-size: 11px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .alert-bar {\r\n margin: 12px 12px 0 12px;\r\n padding: 8px 10px;\r\n border: 1px solid #8e4b56;\r\n background: linear-gradient(180deg, #6e2933 0%, #58212a 100%);\r\n color: #ffd8dc;\r\n text-align: center;\r\n font-size: 11px;\r\n letter-spacing: 1px;\r\n font-weight: bold;\r\n }\r\n\r\n .hero {\r\n margin: 12px;\r\n padding: 16px;\r\n border: 1px solid #4f759b;\r\n background: linear-gradient(180deg, #1b3453 0%, #162d49 100%);\r\n text-align: center;\r\n }\r\n\r\n .headline {\r\n margin: 0;\r\n font-size: 22px;\r\n color: #dcecff;\r\n letter-spacing: 0.7px;\r\n }\r\n\r\n .subhead {\r\n margin: 6px 0 0 0;\r\n color: #9bc1ea;\r\n font-size: 12px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .hero-copy {\r\n margin: 10px 0 0 0;\r\n color: #c0d7ee;\r\n font-family: inherit;\r\n font-size: 12px;\r\n line-height: 1.45;\r\n }\r\n\r\n .section-title {\r\n margin: 0 12px 8px 12px;\r\n color: #9bc1ea;\r\n font-size: 12px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .panel {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #496d94;\r\n background: #132840;\r\n padding: 10px 12px;\r\n }\r\n\r\n .line {\r\n margin: 0 0 7px 0;\r\n color: #c1d8ee;\r\n font-size: 12px;\r\n line-height: 1.4;\r\n }\r\n\r\n .line:last-child {\r\n margin-bottom: 0;\r\n }\r\n\r\n .grid {\r\n margin: 0 12px 12px 12px;\r\n text-align: center;\r\n }\r\n\r\n .card {\r\n display: inline-block;\r\n vertical-align: top;\r\n width: 31%;\r\n min-width: 180px;\r\n margin: 0 4px 8px 4px;\r\n border: 1px solid #496d94;\r\n border-top-width: 3px;\r\n background: #18314d;\r\n padding: 10px 8px;\r\n box-sizing: border-box;\r\n text-align: left;\r\n }\r\n\r\n .card-1 {\r\n border-top-color: #7aa0c8;\r\n }\r\n\r\n .card-2 {\r\n border-top-color: #d57a84;\r\n }\r\n\r\n .card-3 {\r\n border-top-color: #8bb890;\r\n }\r\n\r\n .card-tag {\r\n margin: 0 0 6px 0;\r\n font-size: 9px;\r\n letter-spacing: 0.8px;\r\n font-weight: bold;\r\n color: #9fc4e8;\r\n }\r\n\r\n .card-name {\r\n margin: 0;\r\n color: #e0eeff;\r\n font-size: 14px;\r\n }\r\n\r\n .card-info {\r\n margin: 6px 0 0 0;\r\n color: #bdd2e7;\r\n font-size: 12px;\r\n line-height: 1.35;\r\n }\r\n\r\n .footer {\r\n margin: 0 12px 12px 12px;\r\n border-top: 1px solid #4f759b;\r\n padding-top: 8px;\r\n color: #9dbbd8;\r\n font-size: 10px;\r\n text-align: center;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n .card {\r\n display: block;\r\n width: auto;\r\n margin: 0 0 8px 0;\r\n }\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"scroll-root\">\r\n <div class=\"page\">\r\n <div class=\"shell\">\r\n <div class=\"top\">CITY POLICE NETWORK // ENFORCEMENT ACTION NOTICE</div>\r\n\r\n <div class=\"alert-bar\">RESTRICTED ACCESS // DIGITAL PROPERTY SEIZED</div>\r\n\r\n <div class=\"hero\">\r\n <img src=\"badge.png\" width=\"74\" height=\"74\" style=\"display:block;margin:0 auto 10px auto;\">\r\n <p class=\"headline\">This Site Has Been Seized</p>\r\n <p class=\"subhead\">By Order of the City Police Department</p>\r\n <p class=\"hero-copy\">Access to this service has been suspended as part of an active police action. The domain, content, and associated digital assets are currently under official control pending investigation, evidence review, and further municipal procedure.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">STATUS NOTICE</p>\r\n <div class=\"panel\">\r\n <p class=\"line\">- This page is no longer operated by its prior owners or administrators.</p>\r\n <p class=\"line\">- All connected systems, records, and hosted materials may be subject to examination.</p>\r\n <p class=\"line\">- Unauthorized attempts to restore, alter, or bypass this notice may result in additional charges.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">ENFORCEMENT DETAILS</p>\r\n <div class=\"grid\">\r\n <div class=\"card card-1\">\r\n <p class=\"card-tag\">ACTION</p>\r\n <p class=\"card-name\">Service Frozen</p>\r\n <p class=\"card-info\">Public access has been disabled while the department secures relevant digital property and linked infrastructure.</p>\r\n </div>\r\n <div class=\"card card-2\">\r\n <p class=\"card-tag\">LEGAL STATUS</p>\r\n <p class=\"card-name\">Under Investigation</p>\r\n <p class=\"card-info\">Records and materials connected to this page are being retained for official review and possible criminal proceedings.</p>\r\n </div>\r\n <div class=\"card card-3\">\r\n <p class=\"card-tag\">CONTACT</p>\r\n <p class=\"card-name\">Police Records Desk</p>\r\n <p class=\"card-info\">Authorized parties may contact the department through standard municipal channels for verified case-related inquiries.</p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"footer\">Official municipal portal // Verified law enforcement notice</div>\r\n </div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>", "Unknown", (TypeFile)0, true, true); val.SetBinario(false); return val; } protected override PreparedMission<PoliceSeizeWebsiteMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[PoliceSeizeWebsiteMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); IEnumerable<KeyValuePair<TipoRed, List<Servicio>>> source = XmlGlobal.Singleton.tipoServidor.publicServices.Where((KeyValuePair<TipoRed, List<Servicio>> s) => s.Value.Any((Servicio service) => (int)service.ID == 2)); TipoRed key = source.ElementAt(random.Next(source.Count())).Key; Router val = ServerMap.Singleton.SpawnRouter(key, mission.GetAccessType(), (Mission)null, false, "", (GenerationProfile)0); Computer httpTarget = GetHttpTarget(val, random); if (httpTarget == null) { return null; } string text = ((TypeHelpers.ToExtendedConditionId(mission.condition.condition) == MissionConditionWebsiteByDomain) ? val.GetDomain() : ((Computer)val).GetPublicIP()); string text2 = base.BuildMissionText(mission, language, new(string, string)[1] { ("$TARGET", StringExtensions.BoldString(text)) }); return new PreparedMission<PoliceSeizeWebsiteMission, Data> { TargetComputer = httpTarget, KarmaType = (KarmaType)3, MissionData = new Data(), Text = text2 }; } protected override bool ValidateMission(ActiveMission activeMission, string message, Archivo attachment) { Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(activeMission.targetComputerID, true, (Router)null); if (remoteComputer == null) { return false; } if (!remoteComputer.ExisteServicio((ServicioID)2)) { return false; } Archivo archivo = remoteComputer.GetFileSystem().GetArchivo("/Public/htdocs/website.html", true, 0); if (archivo == null || archivo.IsBinario()) { return false; } return archivo.GetContenido() == "<!doctype html>\r\n <html>\r\n <head>\r\n <meta charset=\"utf-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <title>Police Seizure Notice</title>\r\n <style type=\"text/css\">\r\n html {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n background: linear-gradient(180deg, #1f3550 0%, #223f63 60%, #2a4c75 100%);\r\n }\r\n\r\n body {\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n color: #dbe8f4;\r\n font: 14px \"Trebuchet MS\", \"Segoe UI\", Arial, sans-serif;\r\n }\r\n\r\n .scroll-root {\r\n width: 100%;\r\n height: 100%;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n box-sizing: border-box;\r\n padding: 20px 0;\r\n }\r\n\r\n .page {\r\n width: 860px;\r\n max-width: 95%;\r\n margin: 0 auto 18px auto;\r\n border: 1px solid #3f5f84;\r\n background: #0f1f33;\r\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);\r\n }\r\n\r\n .shell {\r\n margin: 10px;\r\n border: 1px solid #4b6d92;\r\n background: #142842;\r\n }\r\n\r\n .top {\r\n padding: 9px 12px;\r\n border-bottom: 1px solid #3f5f84;\r\n background: #1d3758;\r\n color: #b9d5f2;\r\n font-size: 11px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .alert-bar {\r\n margin: 12px 12px 0 12px;\r\n padding: 8px 10px;\r\n border: 1px solid #8e4b56;\r\n background: linear-gradient(180deg, #6e2933 0%, #58212a 100%);\r\n color: #ffd8dc;\r\n text-align: center;\r\n font-size: 11px;\r\n letter-spacing: 1px;\r\n font-weight: bold;\r\n }\r\n\r\n .hero {\r\n margin: 12px;\r\n padding: 16px;\r\n border: 1px solid #4f759b;\r\n background: linear-gradient(180deg, #1b3453 0%, #162d49 100%);\r\n text-align: center;\r\n }\r\n\r\n .headline {\r\n margin: 0;\r\n font-size: 22px;\r\n color: #dcecff;\r\n letter-spacing: 0.7px;\r\n }\r\n\r\n .subhead {\r\n margin: 6px 0 0 0;\r\n color: #9bc1ea;\r\n font-size: 12px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .hero-copy {\r\n margin: 10px 0 0 0;\r\n color: #c0d7ee;\r\n font-family: inherit;\r\n font-size: 12px;\r\n line-height: 1.45;\r\n }\r\n\r\n .section-title {\r\n margin: 0 12px 8px 12px;\r\n color: #9bc1ea;\r\n font-size: 12px;\r\n letter-spacing: 0.8px;\r\n }\r\n\r\n .panel {\r\n margin: 0 12px 12px 12px;\r\n border: 1px solid #496d94;\r\n background: #132840;\r\n padding: 10px 12px;\r\n }\r\n\r\n .line {\r\n margin: 0 0 7px 0;\r\n color: #c1d8ee;\r\n font-size: 12px;\r\n line-height: 1.4;\r\n }\r\n\r\n .line:last-child {\r\n margin-bottom: 0;\r\n }\r\n\r\n .grid {\r\n margin: 0 12px 12px 12px;\r\n text-align: center;\r\n }\r\n\r\n .card {\r\n display: inline-block;\r\n vertical-align: top;\r\n width: 31%;\r\n min-width: 180px;\r\n margin: 0 4px 8px 4px;\r\n border: 1px solid #496d94;\r\n border-top-width: 3px;\r\n background: #18314d;\r\n padding: 10px 8px;\r\n box-sizing: border-box;\r\n text-align: left;\r\n }\r\n\r\n .card-1 {\r\n border-top-color: #7aa0c8;\r\n }\r\n\r\n .card-2 {\r\n border-top-color: #d57a84;\r\n }\r\n\r\n .card-3 {\r\n border-top-color: #8bb890;\r\n }\r\n\r\n .card-tag {\r\n margin: 0 0 6px 0;\r\n font-size: 9px;\r\n letter-spacing: 0.8px;\r\n font-weight: bold;\r\n color: #9fc4e8;\r\n }\r\n\r\n .card-name {\r\n margin: 0;\r\n color: #e0eeff;\r\n font-size: 14px;\r\n }\r\n\r\n .card-info {\r\n margin: 6px 0 0 0;\r\n color: #bdd2e7;\r\n font-size: 12px;\r\n line-height: 1.35;\r\n }\r\n\r\n .footer {\r\n margin: 0 12px 12px 12px;\r\n border-top: 1px solid #4f759b;\r\n padding-top: 8px;\r\n color: #9dbbd8;\r\n font-size: 10px;\r\n text-align: center;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n .card {\r\n display: block;\r\n width: auto;\r\n margin: 0 0 8px 0;\r\n }\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <div class=\"scroll-root\">\r\n <div class=\"page\">\r\n <div class=\"shell\">\r\n <div class=\"top\">CITY POLICE NETWORK // ENFORCEMENT ACTION NOTICE</div>\r\n\r\n <div class=\"alert-bar\">RESTRICTED ACCESS // DIGITAL PROPERTY SEIZED</div>\r\n\r\n <div class=\"hero\">\r\n <img src=\"badge.png\" width=\"74\" height=\"74\" style=\"display:block;margin:0 auto 10px auto;\">\r\n <p class=\"headline\">This Site Has Been Seized</p>\r\n <p class=\"subhead\">By Order of the City Police Department</p>\r\n <p class=\"hero-copy\">Access to this service has been suspended as part of an active police action. The domain, content, and associated digital assets are currently under official control pending investigation, evidence review, and further municipal procedure.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">STATUS NOTICE</p>\r\n <div class=\"panel\">\r\n <p class=\"line\">- This page is no longer operated by its prior owners or administrators.</p>\r\n <p class=\"line\">- All connected systems, records, and hosted materials may be subject to examination.</p>\r\n <p class=\"line\">- Unauthorized attempts to restore, alter, or bypass this notice may result in additional charges.</p>\r\n </div>\r\n\r\n <p class=\"section-title\">ENFORCEMENT DETAILS</p>\r\n <div class=\"grid\">\r\n <div class=\"card card-1\">\r\n <p class=\"card-tag\">ACTION</p>\r\n <p class=\"card-name\">Service Frozen</p>\r\n <p class=\"card-info\">Public access has been disabled while the department secures relevant digital property and linked infrastructure.</p>\r\n </div>\r\n <div class=\"card card-2\">\r\n <p class=\"card-tag\">LEGAL STATUS</p>\r\n <p class=\"card-name\">Under Investigation</p>\r\n <p class=\"card-info\">Records and materials connected to this page are being retained for official review and possible criminal proceedings.</p>\r\n </div>\r\n <div class=\"card card-3\">\r\n <p class=\"card-tag\">CONTACT</p>\r\n <p class=\"card-name\">Police Records Desk</p>\r\n <p class=\"card-info\">Authorized parties may contact the department through standard municipal channels for verified case-related inquiries.</p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"footer\">Official municipal portal // Verified law enforcement notice</div>\r\n </div>\r\n </div>\r\n </div>\r\n </body>\r\n </html>"; } private static Computer? GetHttpTarget(Router router, Random random) { List<Computer> list = new List<Computer>(); if (((Computer)router).ExisteServicio((ServicioID)2)) { list.Add((Computer)(object)router); } list.AddRange(from computer in router.GetComputers(true) where computer != null && computer.ExisteServicio((ServicioID)2) select computer); if (list.Count == 0) { return null; } return list[random.Next(list.Count)]; } } internal class TrollingWebsiteMission : ExtendedDirectMission<TrollingWebsiteMission, TrollingWebsiteMission.Data> { internal class Data { public int TextID { get; set; } = -1; } private const string ByDomainConditionTag = "BY_DOMAIN"; private const string ByIpConditionTag = "BY_IP"; private string[] Messages = new string[5] { "This website has been trolled by a mysterious hacker. All your base are belong to us.", "Congratulations! You've been visited by the troll of the internet. Share this with 10 friends or your website will be forever trolled.", "This website is now under new management. Please direct all complaints to the new owner: The Internet Troll.", "You've been trolled! Don't worry, it's just a prank bro.", "This website has been upgraded with premium troll content. Enjoy the enhanced trolling experience!" }; private int MissionConditionWebsiteByDomain => base.GetConditionId("BY_DOMAIN"); protected override string Title => "Website Trolling"; protected override string Preview => "Troll a target website by appending the content with a humorous message."; protected override string Mail => "The client wants to troll a website.\\nOperate on /Public/htdocs/website.html.\\nAppend the following message: \"$MESSAGE\""; protected override string Details => "The client wants to troll a website by appending its content with a humorous message. The required message is attached to the contract mail."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["BY_DOMAIN"] = "Target the website identified by domain $TARGET.", ["BY_IP"] = "Target the website hosted at public IP $TARGET." }; protected override PreparedMission<TrollingWebsiteMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[PoliceSeizeWebsiteMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); IEnumerable<KeyValuePair<TipoRed, List<Servicio>>> source = XmlGlobal.Singleton.tipoServidor.publicServices.Where((KeyValuePair<TipoRed, List<Servicio>> s) => s.Value.Any((Servicio service) => (int)service.ID == 2)); TipoRed key = source.ElementAt(random.Next(source.Count())).Key; Router val = ServerMap.Singleton.SpawnRouter(key, mission.GetAccessType(), (Mission)null, false, "", (GenerationProfile)0); Computer httpTarget = GetHttpTarget(val, random); if (httpTarget == null) { return null; } string text = ((TypeHelpers.ToExtendedConditionId(mission.condition.condition) == MissionConditionWebsiteByDomain) ? val.GetDomain() : ((Computer)val).GetPublicIP()); int num = random.Next(Messages.Length); string text2 = base.BuildMissionText(mission, language, new(string, string)[2] { ("$TARGET", StringExtensions.BoldString(text)), ("$MESSAGE", StringExtensions.BoldString(Messages[num])) }); return new PreparedMission<TrollingWebsiteMission, Data> { TargetComputer = httpTarget, KarmaType = (KarmaType)3, MissionData = new Data { TextID = num }, Text = text2 }; } protected override bool ValidateMission(ActiveMission activeMission, string message, Archivo attachment) { Data data = base.GetData(activeMission); if (data == null) { return false; } Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(activeMission.targetComputerID, true, (Router)null); if (remoteComputer == null) { return false; } if (!remoteComputer.ExisteServicio((ServicioID)2)) { return false; } Archivo archivo = remoteComputer.GetFileSystem().GetArchivo("/Public/htdocs/website.html", true, 0); if (archivo == null || archivo.IsBinario()) { return false; } return archivo.GetContenido().Contains(Messages[data.TextID]); } private static Computer? GetHttpTarget(Router router, Random random) { List<Computer> list = new List<Computer>(); if (((Computer)router).ExisteServicio((ServicioID)2)) { list.Add((Computer)(object)router); } list.AddRange(from computer in router.GetComputers(true) where computer != null && computer.ExisteServicio((ServicioID)2) select computer); if (list.Count == 0) { return null; } return list[random.Next(list.Count)]; } } } namespace ExtendedMissions.CustomMissions.WebsiteDefacement { [BepInPlugin("nl.pvanhalm.plugins.greyhack.extended-missions.website-defacement", "Extended Missions - Website Defacement", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class WebsiteDefacementPlugin : BaseUnityPlugin { public const string PluginGuid = "nl.pvanhalm.plugins.greyhack.extended-missions.website-defacement"; public const string PluginName = "Extended Missions - Website Defacement"; public const string PluginVersion = "0.1.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/ExtendedMissions/ExtendedMissions.ChangePassword.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using ExtendedMissions.Missions; using ExtendedMissions.Utils; using Microsoft.CodeAnalysis; using MissionConfig; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExtendedMissions.ChangePassword")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0368f7e81ede4c9deb3363bc9e60daaa62d306ad")] [assembly: AssemblyProduct("ExtendedMissions.ChangePassword")] [assembly: AssemblyTitle("ExtendedMissions.ChangePassword")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ExtendedMissions.Registries { public class ChangePasswordMission : ExtendedDirectMission<ChangePasswordMission, ChangePasswordMission.Data> { public class Data { public string TargetUser { get; set; } = string.Empty; public string OriginalPassword { get; set; } = string.Empty; public string? RequiredPassword { get; set; } } private const string CONDITION_RECOVERY_EXACT_KEY = "RECOVERY_EXACT"; private const string CONDITION_RECOVERY_ANY_KEY = "RECOVERY_ANY"; private const string CONDITION_SABOTAGE_EXACT_KEY = "SABOTAGE_EXACT"; private const string CONDITION_ANY_CHANGE_KEY = "ANY_CHANGE"; protected override string Title => "Change a password"; protected override string Preview => "Alter a target account by setting a new required password."; protected override string Details => "Different contracts may require an exact password reset or simply locking the user out by changing the password."; protected override string Mail => "The client needs a password changed on a remote workstation.\n\nThe target public IP is $PUBLIC_IP and the LAN address is $LOCAL_IP.\nThe target username is $USERNAME."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override int MinReputation => 1; protected override int MaxReputation => 1; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["RECOVERY_EXACT"] = "This is an account recovery job. Change the password to exactly $NEW_PASSWORD.", ["RECOVERY_ANY"] = "This is an account recovery job. Change the password to any new value. And return the new password to the client.", ["SABOTAGE_EXACT"] = "The client wants the user locked out. Change the password to exactly $NEW_PASSWORD.", ["ANY_CHANGE"] = "The client only cares that the current password stops working. Change the password to any new value." }; protected override PreparedMission<ChangePasswordMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[ChangePasswordMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); Router val = ExtendedDirectMission<ChangePasswordMission, Data>.SpawnMissionRouter(mission, random); Computer randomMissionComputer = MissionUtils.GetRandomMissionComputer(val, mission.rep != 1); User randomUser = MissionUtils.GetRandomUser(randomMissionComputer, random, false); string passPlano = randomUser.GetPassPlano(); int num = TypeHelpers.ToExtendedConditionId(mission.condition.condition); bool flag = num == base.GetConditionId("RECOVERY_EXACT") || num == base.GetConditionId("SABOTAGE_EXACT"); string text = (flag ? GenerateRequiredPassword(random, passPlano) : string.Empty); KarmaType val2 = ((num == base.GetConditionId("RECOVERY_EXACT")) ? ((KarmaType)3) : ((num != base.GetConditionId("RECOVERY_ANY")) ? ((KarmaType)1) : ((KarmaType)3))); KarmaType karmaType = val2; base.BuildMissionText(mission, language, new(string, string)[4] { ("$PUBLIC_IP", StringExtensions.BoldString(((Computer)val).GetPublicIP())), ("$LOCAL_IP", StringExtensions.BoldString(randomMissionComputer.GetLocalIP())), ("$USERNAME", StringExtensions.BoldString(randomUser.nombreUsuario)), ("$NEW_PASSWORD", StringExtensions.BoldString(text)) }); return new PreparedMission<ChangePasswordMission, Data> { TargetComputer = randomMissionComputer, KarmaType = karmaType, MissionData = new Data { TargetUser = randomUser.nombreUsuario, OriginalPassword = passPlano, RequiredPassword = (flag ? text : null) } }; } protected override bool ValidateMission(ActiveMission mission, string message, Archivo attachment) { Data data = base.GetData(mission); Computer remoteComputer = ServerMap.Singleton.GetRemoteComputer(mission.targetComputerID, true, (Router)null); if (remoteComputer == null) { return false; } User user = remoteComputer.GetUser(data.TargetUser); if (user == null) { return false; } if (!remoteComputer.IsFilePasswordOk()) { return false; } if (data.RequiredPassword != null && user.GetPassPlano().Equals(data.RequiredPassword, StringComparison.Ordinal)) { return true; } return !user.GetPassPlano().Equals(data.OriginalPassword, StringComparison.Ordinal); } private static string GenerateRequiredPassword(Random random, string originalPassword) { string text; do { text = WordGenerator.GetNextWord((word)3, random) + random.Next(10, 100); } while (text.Equals(originalPassword, StringComparison.Ordinal)); return text; } } } namespace ExtendedMissions.CustomMissions.ChangePassword { [BepInPlugin("nl.pvanhalm.plugins.greyhack.extended-missions.change-password", "Extended Missions - Change Password", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ChangePasswordPlugin : BaseUnityPlugin { public const string PluginGuid = "nl.pvanhalm.plugins.greyhack.extended-missions.change-password"; public const string PluginName = "Extended Missions - Change Password"; public const string PluginVersion = "0.1.0"; private void Awake() { } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/ExtendedMissions/ExtendedMissions.UploadFile.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using ExtendedMissions.Missions; using ExtendedMissions.Utils; using Microsoft.CodeAnalysis; using MissionConfig; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExtendedMissions.UploadFile")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0368f7e81ede4c9deb3363bc9e60daaa62d306ad")] [assembly: AssemblyProduct("ExtendedMissions.UploadFile")] [assembly: AssemblyTitle("ExtendedMissions.UploadFile")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ExtendedMissions.Registries { public class UploadFileMission : ExtendedDirectMission<UploadFileMission, UploadFileMission.Data> { public class Data { public string Path { get; set; } = string.Empty; public string Content { get; set; } = string.Empty; } private const string CONDITION_SPECIFIC_USER_HOME_KEY = "SPECIFIC_USER"; private const string CONDITION_SPECIFIC_PATH_KEY = "SPECIFIC_PATH"; private const string FILE_NAME = "suspicious-file.so"; protected override string Title => "Upload a file"; protected override string Preview => "The client wants you to upload a file to a remote PC."; protected override string Mail => "The client wants you to upload a file to a remote PC.\n\nThe remote IP of the victim is $PUBLIC_IP and the LAN address is $LOCAL_IP."; protected override string Details => "The client wants you to upload a file to a remote PC. The required file is attached to the contract mail."; private string FileContent { get; set; } = string.Empty; protected override int MinReputation => 0; protected override int MaxReputation => 0; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["SPECIFIC_USER"] = "Client wants you to upload the file to the home directory of $TARGET.", ["SPECIFIC_PATH"] = "Client wants you to upload the file to $TARGET." }; public override Archivo? GetMailAttachment(ActiveMission mission) { return GenerationUtils.CreateMailAttachment("suspicious-file.so", FileContent, true); } public UploadFileMission() { FileContent = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); } protected override PreparedMission<UploadFileMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[UploadFileMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); Router val = ExtendedDirectMission<UploadFileMission, Data>.SpawnMissionRouter(mission, random); Computer randomMissionComputer = MissionUtils.GetRandomMissionComputer(val, false); string text = ""; string path = ""; if (TypeHelpers.ToExtendedConditionId(mission.condition.condition) == base.GetConditionId("SPECIFIC_USER")) { text = MissionUtils.GetRandomUser(randomMissionComputer, random, false).nombreUsuario; path = "/home/" + text + "/suspicious-file.so"; } else if (TypeHelpers.ToExtendedConditionId(mission.condition.condition) == base.GetConditionId("SPECIFIC_PATH")) { text = GetRandomPath(randomMissionComputer, random); path = text + "suspicious-file.so"; } string text2 = base.BuildMissionText(mission, language, new(string, string)[3] { ("$PUBLIC_IP", StringExtensions.BoldString(((Computer)val).GetPublicIP())), ("$LOCAL_IP", StringExtensions.BoldString(randomMissionComputer.GetLocalIP())), ("$TARGET", StringExtensions.BoldString(text)) }); return new PreparedMission<UploadFileMission, Data> { TargetComputer = randomMissionComputer, KarmaType = (KarmaType)2, MissionData = new Data { Path = path, Content = FileContent }, Text = text2 }; } private string GetRandomPath(Computer computer, Random random) { Carpeta val = computer.GetFileSystem().GetCarpetaRaiz(); string text = "/"; while (true) { List<Carpeta> carpetas = val.GetCarpetas(); if (carpetas.Count == 0 || random.NextDouble() < 0.5) { break; } val = carpetas[random.Next(carpetas.Count)]; text = text + ((Fichero)val).nombre + "/"; } return text; } protected override bool ValidateMission(ActiveMission mission, string message, Archivo attachment) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) Data data = base.GetData(mission); Archivo archivo = ServerMap.Singleton.GetRemoteComputer(mission.targetComputerID, true, (Router)null).GetFileSystem().GetArchivo(data.Path, true, 0); if (archivo == null) { return false; } if (!archivo.IsBinario()) { return false; } if ((int)((Fichero)archivo).typeFile != 0) { return false; } if (archivo.GetContenido() != data.Content) { return false; } return true; } } } namespace ExtendedMissions.CustomMissions.UploadFile { [BepInPlugin("nl.pvanhalm.plugins.greyhack.extended-missions.upload-file", "Extended Missions - Upload File", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class UploadFilePlugin : BaseUnityPlugin { public const string PluginGuid = "nl.pvanhalm.plugins.greyhack.extended-missions.upload-file"; public const string PluginName = "Extended Missions - Upload File"; public const string PluginVersion = "0.1.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/ExtendedMissions/ExtendedMissions.SendMoney.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using ExtendedMissions.CustomMissions.SendMoney; using ExtendedMissions.Missions; using ExtendedMissions.Utils; using HarmonyLib; using Microsoft.CodeAnalysis; using MissionConfig; using NetworkMessages; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExtendedMissions.SendMoney")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+0368f7e81ede4c9deb3363bc9e60daaa62d306ad")] [assembly: AssemblyProduct("ExtendedMissions.SendMoney")] [assembly: AssemblyTitle("ExtendedMissions.SendMoney")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ExtendedMissions.Registries { public class SendMoneyMission : ExtendedDirectMission<SendMoneyMission, SendMoneyMission.Data> { public class Data { public string FromAccount { get; set; } = string.Empty; public string ToAccount { get; set; } = string.Empty; public string LastTransactionDate { get; set; } = string.Empty; public int Amount { get; set; } public bool Precise { get; set; } } private const string CONDITION_AT_LEAST_KEY = "AT_LEAST"; private const string CONDITION_PRECISE_KEY = "PRECISE"; protected override string Title => "Wire Money"; protected override string Preview => "The client wants you to wire some money from a bank account."; protected override string Details => "It is necessary that you infiltrate in the network to gather the bank account credentials."; protected override string Mail => "The client wants you to wire some money from a bank account.\n\nThe remote ip of the victim is $PUBLIC_IP and the LAN address where the bank credentials of $USERNAME are located is $LOCAL_IP.\n\nThe money should be wired to $RECEIVER."; protected override DirectMissionTarget DirectMissionBoard => (DirectMissionTarget)0; protected override int MinReputation => 0; protected override int MaxReputation => 1; protected override Dictionary<string, string>? Conditions => new Dictionary<string, string> { ["AT_LEAST"] = "Client wants to receive at least: $$AMOUNT.", ["PRECISE"] = "Client wants to receive precisely: $$AMOUNT." }; protected override PreparedMission<SendMoneyMission, Data>? PrepareMission(DirectMission mission, string language, PlayerMissions playerMissions) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) DebugLogger.Log("[SendMoneyMission] Add Mission to User"); Random random = RandomUtils.CreateRandom(); Router val = ExtendedDirectMission<SendMoneyMission, Data>.SpawnMissionRouter(mission, random); Router obj = ExtendedDirectMission<SendMoneyMission, Data>.SpawnMissionRouter(mission, random); bool flag = TypeHelpers.ToExtendedConditionId(mission.condition.condition) == base.GetConditionId("PRECISE"); Computer randomMissionComputer = MissionUtils.GetRandomMissionComputer(obj, false); User randomUser = MissionUtils.GetRandomUser(randomMissionComputer, random, false); Persona persona = randomMissionComputer.GetPersona(randomUser.nombreUsuario, false); int num = (flag ? random.Next(500, 2500) : random.Next(100, 1000)); Computer randomMissionComputer2 = MissionUtils.GetRandomMissionComputer(val, mission.rep > 0); User randomUser2 = MissionUtils.GetRandomUser(randomMissionComputer2, random, false); Persona persona2 = randomMissionComputer2.GetPersona(randomUser2.nombreUsuario, false); string text = default(string); Database.Singleton.GetBankAccount(persona2.GetUserBank().userName, ref text).Ingreso("Unknown", "Job payout", Mathf.CeilToInt(RandomExtensions.Next(random, (float)num * 1.15f, (float)(num * 2))), true, "", false); string nombreUsuario = randomUser2.nombreUsuario; string userName = persona2.GetUserBank().userName; string text2 = base.BuildMissionText(mission, language, new(string, string)[5] { ("$PUBLIC_IP", StringExtensions.BoldString(((Computer)val).GetPublicIP())), ("$LOCAL_IP", StringExtensions.BoldString(randomMissionComputer2.GetLocalIP())), ("$USERNAME", StringExtensions.BoldString(nombreUsuario)), ("$RECEIVER", StringExtensions.BoldString(persona.GetUserBank().userName)), ("$AMOUNT", StringExtensions.BoldString(num.ToString())) }); BankAccount bankAccount = Database.Singleton.GetBankAccount(persona.GetUserBank().userName, ref text); Transaccion val2 = null; foreach (Transaccion transaccione in bankAccount.transacciones) { if (val2 == null) { val2 = transaccione; continue; } DateTime dateTime = DateTimeUtils.ParseFormat(val2.fecha, "dd/MMM/yyyy - HH:mm"); if (!(DateTimeUtils.ParseFormat(transaccione.fecha, "dd/MMM/yyyy - HH:mm") < dateTime)) { val2 = transaccione; } } return new PreparedMission<SendMoneyMission, Data> { TargetComputer = randomMissionComputer2, KarmaType = (KarmaType)2, MissionData = new Data { FromAccount = userName, ToAccount = persona.GetUserBank().userName, LastTransactionDate = (val2?.fecha ?? "01/Jan/1975 - 00:00"), Amount = num, Precise = flag }, Text = text2 }; } protected override bool ValidateMission(ActiveMission mission, string message, Archivo attachment) { Data data = base.GetData(mission); string text = default(string); BankAccount bankAccount = Database.Singleton.GetBankAccount(data.ToAccount, ref text); DateTime dateTime = DateTimeUtils.ParseFormat(data.LastTransactionDate, "dd/MMM/yyyy - HH:mm"); foreach (Transaccion transaccione in bankAccount.transacciones) { if (DateTimeUtils.ParseFormat(transaccione.fecha, "dd/MMM/yyyy - HH:mm") <= dateTime || transaccione.cuenta != data.FromAccount) { continue; } if (data.Precise) { if (transaccione.cantidad != data.Amount) { continue; } } else if (transaccione.cantidad < data.Amount) { continue; } return true; } return false; } protected override bool IsSoftLocked(ActiveMission mission) { Data data = base.GetData(mission); string text = default(string); return (double)Database.Singleton.GetBankAccount(data.FromAccount, ref text).GetMoney() < (double)data.Amount * 1.15; } } } namespace ExtendedMissions.CustomMissions.SendMoney { [BepInPlugin("nl.pvanhalm.plugins.greyhack.extended-missions.send-money", "Extended Missions - Send Money", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SendMoneyPlugin : BaseUnityPlugin { public const string PluginGuid = "nl.pvanhalm.plugins.greyhack.extended-missions.send-money"; public const string PluginName = "Extended Missions - Send Money"; public const string PluginVersion = "0.1.0"; internal static ManualLogSource? Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); } } } namespace ExtendedMissions.Patches.Bugs { [HarmonyPatch(typeof(BankHelperServer), "BankTransactionServerRpc", new Type[] { typeof(string), typeof(int), typeof(string), typeof(string), typeof(int) })] public class Fix_From_Field_Transactions { public static bool Prefix(string fromAccountPass, int amount, string fromAccount, string toAccount, int windowPID, BankHelperServer __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown ManualLogSource? logger = SendMoneyPlugin.Logger; if (logger != null) { logger.LogMessage((object)"Patching bug #560 [When transferring money from User to User, the accounts do not show up correctly]"); } MessageClient val = new MessageClient((IdClient)30); ((Message)val).AddInt(windowPID); if (fromAccount.Equals(toAccount)) { ((Message)val).AddString("The target account can not be the same as the source account."); ((HelperServer)__instance).player.SendData(val); return false; } string text = default(string); BankAccount bankAccount = Database.Singleton.GetBankAccount(fromAccount, fromAccountPass, ref text); if (!string.IsNullOrEmpty(text)) { ((Message)val).AddString(text); ((HelperServer)__instance).player.SendData(val); return false; } BankAccount bankAccount2 = Database.Singleton.GetBankAccount(toAccount, ref text); if (!string.IsNullOrEmpty(text)) { ((Message)val).AddString(text); ((HelperServer)__instance).player.SendData(val); return false; } float money = bankAccount.GetMoney(); if (amount <= 0 || money < (float)amount) { ((Message)val).AddString("Error: Insufficient funds in the account"); ((HelperServer)__instance).player.SendData(val); return false; } int feeAmount = TransactionsPanel.GetFeeAmount(amount); int num = amount - feeAmount; bool num2 = __instance.UpdateBankLogs(bankAccount.origBankAddress, bankAccount, bankAccount2, num, windowPID); bool flag = __instance.UpdateBankLogs(bankAccount2.origBankAddress, bankAccount, bankAccount2, num, windowPID); if (num2 && flag && !bankAccount.isPlayer && bankAccount2.isPlayer && ((HelperServer)__instance).player.GetComputer().GetUserBank() != null && !__instance.bankTraceSystem.AddBank(bankAccount.origBankAddress, fromAccount)) { ((Message)val).AddString("Error: Too many transactions have been made in a short period of time, please wait a few moments before making another transaction."); ((HelperServer)__instance).player.SendData(val); return false; } bankAccount.Ingreso(fromAccount, "Transaction fee", -feeAmount, true, "", false); bankAccount.Ingreso(fromAccount, "Money transfer", -num, true, "", false); bankAccount2.Ingreso(fromAccount, "Money transfer", num, true, "", false); byte[] array = Database.Singleton.BankTransaction(bankAccount, bankAccount2); val = new MessageClient((IdClient)29); ((Message)val).AddString("Transaction successful"); ((Message)val).AddByte(array); ((Message)val).AddInt(windowPID); ((HelperServer)__instance).player.SendData(val); return false; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }