public static void CreateFromWireless(string package, out Exploit exploit, out string host, out int port) { string _host = string.Empty; int _port = 0; ManualResetEvent doneinit = new ManualResetEvent(false); exploit = new Exploit((serial) => { ConnectionFinder.PlayerInfo info = ConnectionFinder.GetPlayerForWireless(); Console.WriteLine("Found: {0}", info); Socket debugsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); Socket logsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { debugsock.Connect(info.m_IPEndPoint.Address, (int)info.m_DebuggerPort); logsock.Connect(info.m_IPEndPoint); } catch (Exception) { Console.WriteLine("Unable to connect to {0}:{1}", info.m_IPEndPoint.Address, info.m_DebuggerPort); throw; } // get network connection _host = info.m_IPEndPoint.Address.ToString(); _port = VITADEFILER_PORT; // connect to console output (new Thread(() => { string line; using (StreamReader read = new StreamReader(new NetworkStream(logsock))) { try { while ((line = read.ReadLine()) != null) { if (line.Contains("kernel avail main") || line.Contains("Not in scene!")) { continue; // skip unity logs } /* if (line.StartsWith("\t")) { continue; // skip unity stack traces } */ int index = line.LastIndexOf('\0'); // Unity output has some crazy garbage in front of it, so get rid of that. if (index >= 0) { line = line.Substring(index); } Console.Error.WriteLine("[Vita] {0}", line); } } catch (Exception e) { Console.WriteLine(e.ToString()); // We want to know what went wrong. } } })).Start(); // ready for network connection doneinit.Set(); // return debug connection return new TcpConnection(debugsock); }, package, null); exploit.Connect(false, (text) => { Console.WriteLine("[Vita] {0}", text); }); Console.Error.WriteLine("Waiting for network connection..."); doneinit.WaitOne(); // suspend exploit.SuspendVM(); host = _host; port = _port; }
// Start is called before the first frame update void Start() { if (PersistentState.instance.hasMissionListBeenRefreshed) { int i = 0; foreach (RectTransform anchor in anchors) { Exploit exploit = Instantiate(exploitPrefab, anchor).GetComponent <Exploit>(); exploit.corpName = PersistentState.instance.availableMissions[i].corpName; exploit.corpID = PersistentState.instance.availableMissions[i].corpID; exploit.vulnerability = PersistentState.instance.availableMissions[i].vulnerability; i++; } } else { PersistentState.instance.availableMissions = new List <PersistentState.ExploitRecord>(); foreach (RectTransform anchor in anchors) { Exploit exploit = Instantiate(exploitPrefab, anchor).GetComponent <Exploit>(); exploit.RandomizeExploit(); PersistentState.ExploitRecord newRecord; newRecord.corpID = exploit.corpID; newRecord.corpName = exploit.corpName; newRecord.vulnerability = exploit.vulnerability; PersistentState.instance.availableMissions.Add(newRecord); } PersistentState.instance.hasMissionListBeenRefreshed = true; PersistentState.instance.SaveProgress(); } }
void GetExploitForPath(GameObject node, GameObject path) { List <Exploit> exploitList = new List <Exploit>(); if (StateController.CurrentNode.GetComponent <Node>().forwardTile) { exploitList = StateController.CurrentNode.GetComponent <Node>().forwardTile.GetComponent <Tile>().exploits; } if (node.name == "Left" && StateController.CurrentNode.GetComponent <Node>().leftTile) { List <Exploit> leftExploits = StateController.CurrentNode.GetComponent <Node>().leftTile.GetComponent <Tile>().exploits; for (int i = 0; i < leftExploits.Count; i++) { exploitList.Add(leftExploits[i]); } } if (node.name == "Right" && StateController.CurrentNode.GetComponent <Node>().rightTile) { List <Exploit> rightExploits = StateController.CurrentNode.GetComponent <Node>().rightTile.GetComponent <Tile>().exploits; for (int i = 0; i < rightExploits.Count; i++) { exploitList.Add(rightExploits[i]); } } Exploit exploit = exploitList[Random.Range(0, exploitList.Count)]; path.AddComponent <ClickablePath>(); path.GetComponent <ClickablePath>().SetupExploit(exploit, node.name); path.GetComponent <ClickablePath>().Node = node; }
Exploit ThroughBackyard() { Exploit e = new Exploit("Through Backyard"); e.encounters.Add(EncounterDict["Barbecue"]); e.encounters.Add(EncounterDict["PetDog"]); return(e); }
Exploit ThroughFrontyard() { Exploit e = new Exploit("Through Frontyard"); e.encounters.Add(EncounterDict["Adult"]); e.encounters.Add(EncounterDict["GuardDog"]); return(e); }
Exploit Park() { Exploit e = new Exploit("Park"); e.encounters.Add(EncounterDict["Flora"]); e.encounters.Add(EncounterDict["Fauna"]); return(e); }
Exploit IntoStore() { Exploit e = new Exploit("Into Store"); e.encounters.Add(EncounterDict["Aisles"]); e.encounters.Add(EncounterDict["Merchant"]); e.encounters.Add(EncounterDict["OlderKids"]); return(e); }
Exploit Wander() { Exploit e = new Exploit("Wander"); e.encounters.Add(EncounterDict["Bullies"]); e.encounters.Add(EncounterDict["Railroad"]); e.encounters.Add(EncounterDict["YardSale"]); return(e); }
Exploit ThroughHouse() { Exploit e = new Exploit("Through House"); e.encounters.Add(EncounterDict["PetCat"]); e.encounters.Add(EncounterDict["Pantry"]); e.encounters.Add(EncounterDict["Recruit"]); e.encounters.Add(EncounterDict["Parent"]); return(e); }
public void SetupExploit(Exploit e, string direction) { SpriteRenderer sprite = GetComponent <SpriteRenderer>(); sprite.sprite = Resources.Load <Sprite>("Sprites/sprite"); GameObject text = transform.GetChild(0).gameObject; TextMesh tMesh = text.GetComponent <TextMesh>(); tMesh.text = e.title + "\n" + direction + " Path"; tMesh.alignment = TextAlignment.Center; exploit = e; }
public static Exploit ParseExploit(int id) { Exploit exploit = new Exploit(id); HttpManager http = new HttpManager(Encoding.UTF8, UserAgents.GoogleBot21); http.RequestGET(exploit.Link); if (http.Result.Contains("")) { return null; } exploit.Title = http.Result.GetStringBetween("").Replace("| Inj3ct0r - exploit database : vulnerability : 0day : shellcode", string.Empty).HTMLDecodeSpecialChars().Trim(); exploit.Content = http.Result.GetStringBetween(openPreTag.HTMLDecodeSpecialChars(), closePreTag.HTMLDecodeSpecialChars()).Replace(openATag.HTMLDecodeSpecialChars() + " href='http://www.1337day.com/'>1337day.com", "1337day.com").HTMLDecodeSpecialChars().Trim(); exploit.Date = http.Result.GetStringBetween("# " + openATag.HTMLDecodeSpecialChars() + " href='http://www.1337day.com/'>1337day.com [", "]" + closePreTag.HTMLDecodeSpecialChars()).Trim(); return exploit; }
public static int Main() { // we should get into the catch block of DoWork() one time if (Exploit.DoExploit() == 1) { Console.WriteLine("PASS"); return(100); } else { Console.WriteLine("FAIL"); return(101); } }
public static Exploit ParseExploit(int id) { Exploit exploit = new Exploit(id); HttpManager http = new HttpManager(Encoding.UTF8, UserAgents.GoogleBot21); http.RequestGET(exploit.Link); if (http.Result.Contains("")) { return(null); } exploit.Title = http.Result.GetStringBetween("").Replace("| Inj3ct0r - exploit database : vulnerability : 0day : shellcode", string.Empty).HTMLDecodeSpecialChars().Trim(); exploit.Content = http.Result.GetStringBetween(openPreTag.HTMLDecodeSpecialChars(), closePreTag.HTMLDecodeSpecialChars()).Replace(openATag.HTMLDecodeSpecialChars() + " href='http://www.1337day.com/'>1337day.com", "1337day.com").HTMLDecodeSpecialChars().Trim(); exploit.Date = http.Result.GetStringBetween("# " + openATag.HTMLDecodeSpecialChars() + " href='http://www.1337day.com/'>1337day.com [", "]" + closePreTag.HTMLDecodeSpecialChars()).Trim(); return(exploit); }
static void Main(string[] args) { List<RealAxis> R = new List<RealAxis>(); List<DiscreteAxis> D = new List<DiscreteAxis>(); List<BinaryAxis> B = new List<BinaryAxis>(); for(int i = 0; i < 3; i++) { R.Add(new RealAxis(-32.768, 32.768)); } Space S = new Space(R, D, B); Map<Space, Individual, double> M = new Map<Space, Individual, double>(S, false, 0.5, ME2Functions.RandomIndividual, MapFunctions.MapNeighbors, ME2Functions.Ackley, ME2Functions.ApplyFitness, ME2Functions.RouletteSelection); Individual Best = M.MappedSpace.ElementAt(0); foreach(Individual potentialBest in M.MappedSpace) { if (potentialBest.Fitness > Best.Fitness) Best = potentialBest; } Console.WriteLine(Best); Explore<Space, Individual, double> E1 = new Explore<Space, Individual, double>(S, false, M.MappedSpace, ExploitFunctions.ExploitNeighbors, ME2Functions.NormalMutate, ME2Functions.Ackley, ME2Functions.ApplyFitness, ExploreFunctions.ApplyExplorePOM, ExploreFunctions.ExploreTP, ME2Functions.TotalFitness, 100); Best = E1.Optimized.ElementAt(0); foreach (Individual potentialBest in E1.Optimized) { if (potentialBest.Fitness > Best.Fitness) Best = potentialBest; } Console.WriteLine(Best); Exploit<Space, Individual, double> E2 = new Exploit<Space, Individual, double>(S, false, E1.Optimized, ExploitFunctions.ExploitNeighbors, ME2Functions.NormalMutate, ME2Functions.Ackley, ME2Functions.ApplyFitness, ExploitFunctions.ApplyExploitPOM, ExploitFunctions.ExploitTP, ME2Functions.TotalFitness, 100); Best = E2.Optimized.First(); foreach (Individual potentialBest in E2.Optimized) { if (potentialBest.Fitness > Best.Fitness) Best = potentialBest; } Console.WriteLine(Best); }
public static void CreateFromUSB(string package, out Exploit exploit, out string host, out int port) { exploit = new Exploit(ConnectionFinder.GetConnectionForUSB, package, null); ManualResetEvent doneinit = new ManualResetEvent(false); string _host = string.Empty; int _port = 0; exploit.Connect(true, (text) => { if (text.StartsWith("XXVCMDXX:")) { #if DEBUG Console.Error.WriteLine("[Vita] {0}", text); #endif string[] cmd = text.Trim().Split(':'); switch (cmd[1]) { case "IP": _host = cmd[2]; _port = Int32.Parse(cmd[3]); Console.Error.WriteLine("Found Vita network at {0}:{1}", _host, _port); break; case "DONE": Console.Error.WriteLine("Vita done initializing"); doneinit.Set(); break; default: Console.Error.WriteLine("Unrecognized startup command"); break; } } else { Console.Error.WriteLine("[Vita] {0}", text); } }); Console.Error.WriteLine("Waiting for app to finish launching..."); doneinit.WaitOne(); host = _host; port = _port; }
// Start is called before the first frame update void Start() { if (instance) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); Exploit targetExploit = FindObjectOfType <Exploit>(); if (targetExploit) { kbBudget = targetExploit.vulnerability; totalBudget = kbBudget; corpName = targetExploit.corpName; corpID = targetExploit.corpID; Destroy(targetExploit.gameObject); selectedPrograms = new GameObject[programSlots.Count]; selectedPlugins = new List <GameObject> [programSlots.Count]; pluginSlots = new List <GameObject> [programSlots.Count]; for (int i = 0; i < programSlots.Count; i++) { pluginSlots[i] = new List <GameObject>(); selectedPlugins[i] = new List <GameObject>(); } targetCorpName.text = "target: " + corpName; budgetDisplay.text = "maximum package size: " + totalBudget + " kb"; } } if (programSlots.Count > 0 && programSlots[0]) { programSlotEmptyImage = programSlots[0].sprite; } ManageRemoveButtons(); }
public static void CreateFromWireless(string package, out Exploit exploit, out string host, out int port) { string _host = string.Empty; int _port = 0; ManualResetEvent doneinit = new ManualResetEvent(false); exploit = new Exploit((serial) => { ConnectionFinder.PlayerInfo info = ConnectionFinder.GetPlayerForWireless(); Console.WriteLine("Found: {0}", info); Socket debugsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); Socket logsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { debugsock.Connect(info.m_IPEndPoint.Address, (int)info.m_DebuggerPort); logsock.Connect(info.m_IPEndPoint); } catch (Exception) { Console.WriteLine("Unable to connect to {0}:{1}", info.m_IPEndPoint.Address, info.m_DebuggerPort); throw; } // get network connection _host = info.m_IPEndPoint.Address.ToString(); _port = VITADEFILER_PORT; // connect to console output (new Thread(() => { string line; using (StreamReader read = new StreamReader(new NetworkStream(logsock))) { try { while ((line = read.ReadLine()) != null) { if (line.Contains("kernel avail main") || line.Contains("Not in scene!")) { continue; // skip unity logs } /* * if (line.StartsWith("\t")) * { * continue; // skip unity stack traces * } */ int index = line.LastIndexOf('\0'); // Unity output has some crazy garbage in front of it, so get rid of that. if (index >= 0) { line = line.Substring(index); } Console.Error.WriteLine("[Vita] {0}", line); } } catch (Exception e) { Console.WriteLine(e.ToString()); // We want to know what went wrong. } } })).Start(); // ready for network connection doneinit.Set(); // return debug connection return(new TcpConnection(debugsock)); }, package, null); exploit.Connect(false, (text) => { Console.WriteLine("[Vita] {0}", text); }); Console.Error.WriteLine("Waiting for network connection..."); doneinit.WaitOne(); // suspend exploit.SuspendVM(); host = _host; port = _port; }