public static List<TabStructure> FindTabStructures(Process p, Player player) { bool firstScan = ReadMemoryManager.TabStructureCount() == 0; List<TabStructure> structs = new List<TabStructure>(); foreach (var tpl in ReadMemoryManager.ScanProcess(p)) { int length = tpl.Item1.RegionSize; int baseAddress = tpl.Item1.BaseAddress; byte[] bytes = tpl.Item2; for (int i = 0; i < length - 20; i += 4) { int value = BitConverter.ToInt32(bytes, i); if (value > 0x40000 && value != baseAddress + i) { int messageptr = BitConverter.ToInt32(bytes, i + 4); int maxsize = BitConverter.ToInt32(bytes, i + 8); int size = BitConverter.ToInt32(bytes, i + 16); if (messageptr > 0x40000 && IsPowerOfTwo(maxsize) && size < maxsize && maxsize < 10000 && size >= 0 && maxsize > 0) { if ((baseAddress + i) == MemoryReader.ReadInt32(value)) { structs.Add(new TabStructure((uint)(baseAddress + i))); } } } } if (!firstScan) { System.Threading.Thread.Sleep(10); } } return structs; }
public static void ShowPlayer(Player player, string comm) { if (player == null) return; PlayerForm f = new PlayerForm(); f.player = player; ShowNotification(f, comm); }
public static Player parseLookPlayer(string lookMessage) { Regex levelRegex = new Regex("\\(Level ([0-9]+)\\)"); Regex vocationRegex = new Regex("(?:She|He) is (?:a|an) ([^.]+)"); Match levelMatch = levelRegex.Match(lookMessage); Match vocationMatch = vocationRegex.Match(lookMessage); if (!levelMatch.Success || !vocationMatch.Success) return null; Player player = new Player(); player.name = parseLookItem(lookMessage).Item1; player.level = int.Parse(levelMatch.Groups[1].Value); string vocation = vocationMatch.Groups[1].Value.ToLower(); player.SetVocation(vocation); if (lookMessage.Contains("He")) player.gender = Gender.Male; else player.gender = Gender.Female; if (SettingsManager.getSettingBool("GatherExtraPlayerInformation")) { player.GatherInformationOnline(false); } return player; }