Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Memory;
  8.  
  9. namespace ConsoleApp1
  10. {
  11.     class Program
  12.     {
  13.         static private List<Entity> entities = new List<Entity>();
  14.  
  15.         static void Main(string[] args)
  16.         {
  17.             Mem MemLib = new Mem();
  18.             Task.Run(async () =>
  19.             {
  20.                 MemLib.OpenProcess("acs.exe");
  21.                 //(await MemLib.AoBScan("FF FF BF 40 00 00 00 00 00 00 80 3F ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 31 8D 24 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 80 BF 32 31 8D 24 00 00 00 00 F4 04 35 3F F4 04 35 BF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 01 00 00 00 ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 0A 00 00 00 ?? ??", true, true)).ToList().ForEach(x => Program.PrintValues(MemLib, x));
  22.                 (await MemLib.AoBScan("FF FF BF 40 ?? ?? ?? ?? ?? ?? 80 3F ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??", true, true)).ToList().ForEach(x => Program.PrintValues(MemLib, x));
  23.                 Console.WriteLine("End of search");
  24.                 //Console.ReadLine();
  25.             }).GetAwaiter().GetResult();
  26.             MoveAll(MemLib);
  27.         }
  28.  
  29.         static private void PrintValues(Mem MemLib, long address)
  30.         {
  31.             Console.WriteLine("Entity: " + address.ToString("x"));
  32.             float x = MemLib.readFloat((address + 0x0C).ToString("x"));
  33.             float y = MemLib.readFloat((address + 0x10).ToString("x"));
  34.             float z = MemLib.readFloat((address + 0x14).ToString("x"));
  35.             Console.WriteLine("X:" + x +",Y:"+y+",Z:"+z);
  36.             Entity entity = new Entity();
  37.             entity.Address = address;
  38.             entity.X = x;
  39.             entity.Y = y;
  40.             entity.Z = z;
  41.             entities.Add(entity);
  42.         }
  43.  
  44.         static private void MoveAll(Mem MemLib)
  45.         {
  46.             Console.WriteLine("Moving all entities:");
  47.             while (true)
  48.             {
  49.                 Console.WriteLine("Iteration:");
  50.                 System.Threading.Thread.Sleep(1000/60);
  51.                 entities.ForEach(entity => Move(MemLib, entity));
  52.             }
  53.         }
  54.  
  55.         static private void Move(Mem MemLib, Entity entity)
  56.         {
  57.             entity.X = entity.X + 0.5f;
  58.             //entity.Z = 0f;
  59.             //entity.Y = 11400f;
  60.             Console.WriteLine("X:" + entity.X + ",Y:" + entity.Y + ",Z:" + entity.Z);
  61.             MemLib.writeMemory((entity.Address + Entity.X_OFFSET).ToString("x"), "float", (entity.X).ToString());
  62.             //MemLib.writeMemory((entity.Address + Entity.Y_OFFSET).ToString("x"), "float", (entity.Y).ToString());
  63.             //MemLib.writeMemory((entity.Address + Entity.Z_OFFSET).ToString("x"), "float", (entity.Z).ToString());
  64.         }
  65.     }
  66.  
  67.     public class Entity {
  68.         public static long X_OFFSET = 0x0C;
  69.         public static long Y_OFFSET = 0x10;
  70.         public static long Z_OFFSET = 0x14;
  71.  
  72.         public long Address { get; set;}
  73.         public float X { get; set; }
  74.         public float Y { get; set; }
  75.         public float Z { get; set; }
  76.  
  77.     }
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement