Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. public void RefreshPlayerList(byte[] Pattern, string PatternMask)
  2. {
  3. // List<uint> RetList = new List<uint>();
  4. int SigSize = PatternMask.Length;
  5.  
  6. MemoryRegion = new List<MEMORY_BASIC_INFORMATION>();
  7. MemInfo(RPM.GetHandle());
  8. for (int i = 0; i < MemoryRegion.Count; i++)
  9. {
  10.  
  11. byffy = new byte[MemoryRegion[i].RegionSize];
  12. NativeMethods.ReadProcessMemory(RPM.GetHandle(), (uint)MemoryRegion[i].BaseAddress, byffy, MemoryRegion[i].RegionSize, out IntPtr BytesRead);
  13. //var result = byffy.AsParallel().Where(x => x == 1).ToList();
  14.  
  15. Parallel.For(0, byffy.Length - SigSize, new ParallelOptions { MaxDegreeOfParallelism = 4 }, (x, state) =>
  16. {
  17.  
  18. if (MaskCheck(x, Pattern, PatternMask))
  19. {
  20. uint UPlayer = (uint)(MemoryRegion[i].BaseAddress.ToInt32() + x) - 0xAFB; //Player
  21.  
  22. bool isInList = playlist.IndexOf((uint)UPlayer) != -1;
  23. if (!isInList)
  24. {
  25. playlist.Add(UPlayer);
  26.  
  27. listBox1.Items.Add("Added : PlayerIndex" + playlist.IndexOf(UPlayer) + " | Balance : " + playlist.Count);
  28.  
  29. }
  30.  
  31.  
  32. }
  33. // Thread.Sleep(1);
  34. //Task.Delay(1);
  35. });
  36.  
  37.  
  38.  
  39.  
  40. // System.Threading.Thread.Sleep(1);
  41.  
  42. }
  43.  
  44. //return RetList;
  45. }
  46.  
  47.  
  48. gameManager.RefreshPlayerList(new byte[] { 0x50, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 }, "xx??xxxx?");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement