예제 #1
0
        public dynamic GetValue <T>(string s)
        {
            try
            {
                if (_structs.ContainsKey(s))
                {
                    Dictionary <int, int[]> structDetails = _structs[s];
                    int   bufferSize = structDetails.ElementAt(0).Key;
                    int[] offsets    = structDetails.ElementAt(0).Value;

                    IntPtr memoryLocation = Base.GetPtr(_basePTR, offsets);

                    byte[] buffer = Memory.ReadBytes(memoryLocation.ToInt64(), bufferSize);
                    switch (Core.GetGenericType(new Dictionary <int, T>()))
                    {
                    case "string":
                        return(Memory.ReadOld <T>(memoryLocation.ToInt64(), 32));


                    default:
                        return(Memory.Read <T>(memoryLocation.ToInt64()));
                    }
                }
                return((T)Convert.ChangeType("0", typeof(T)));
            }
            catch
            {
                return((T)Convert.ChangeType(null, typeof(T)));
            }
        }
        private static IntPtr FindActiveObject(string objName)
        {
            int           limit    = 350;
            StringBuilder objNames = new StringBuilder();
            IntPtr        output   = IntPtr.Zero;

            if (!Memory.isRunning())
            {
                return(output);
            }
            for (int curObject = 0x1; curObject < limit; curObject++)
            {
                List <int> newStruct = new List <int>()
                {
                    0x18
                };
                List <int> depth = Enumerable.Repeat(0x8, curObject).ToList();
                newStruct.AddRange(depth);
                newStruct.AddRange(new int[] { 0x10, 0x60, 0x0 });

                long newAddr = Base.GetPtr(gameObjectManager, newStruct.ToArray()).ToInt64();

                string objectName = Memory.ReadOld <string>(newAddr, 9);
                objNames.AppendLine(objectName);
                if (objectName.ToLower() == objName.ToLower())
                {
                    newStruct.RemoveAt(newStruct.Count() - 1);
                    newStruct.RemoveAt(newStruct.Count() - 1);
                    output = Base.GetPtr(gameObjectManager, newStruct.ToArray());
                    return(output);
                }
            }
            return(output);
        }
 public static void Init()
 {
     try
     {
         gameObjectManager = Base.GetPtr(new IntPtr(Memory.ImageBase().ToInt64() + GOM), new int[] { });
         GameWorld();
         FTPCamera();
         LocalGameWorld();
         RegisteredPlayers();
     }
     catch { }
 }
 public static int PlayerCount()
 {
     try
     {
         IntPtr countAddr = Base.GetPtr(registeredPlayers, playerCountStruct);
         return(Memory.Read <int>(countAddr.ToInt64()));
     }
     catch
     {
         return(0);
     }
 }
        private static List <EFTPlayer> AllPlayers()
        {
            List <EFTPlayer> users = new List <EFTPlayer>();
            int limit = PlayerCount();

            for (int i = 0x0; i < limit; i++)
            {
                IntPtr playerObjAddr  = Base.GetPtr(registeredPlayers, new int[] { 0x10, 0x20 + i * 0x8 });
                IntPtr playerNameAddr = Base.GetPtr(playerObjAddr, new int[] { 0x398, 0x28, 0x10, 0x14 });

                EFTPlayer member = new EFTPlayer(playerObjAddr);
                users.Add(member);
            }
            return(users);
        }
예제 #6
0
        public void SetValue(string s, dynamic value)
        {
            try
            {
                if (_structs.ContainsKey(s))
                {
                    Dictionary <int, int[]> structDetails = _structs[s];
                    int   bufferSize = structDetails.ElementAt(0).Key;
                    int[] offsets    = structDetails.ElementAt(0).Value;

                    IntPtr memoryLocation = Base.GetPtr(_basePTR, offsets);
                    Memory.WriteBytes(memoryLocation.ToInt64(), value);
                }
            }
            catch { }
        }
예제 #7
0
        public string Username()
        {
            IntPtr playerNameAddr = Base.GetPtr(_baseAddr, new int[] { 0x398, 0x28, 0x10, 0x14 });

            byte[]      usernameBytes = Memory.ReadBytes(playerNameAddr.ToInt64(), 32);
            List <byte> clearBytes    = new List <byte>();

            for (int i = 0; i < usernameBytes.Count(); i++)
            {
                if (usernameBytes[i] == 0x0 && usernameBytes[i + 1] == 0x0)
                {
                    break;
                }
                clearBytes.Add(usernameBytes[i]);
            }
            if (clearBytes.Count() % 2 != 0)
            {
                clearBytes.Add(0x00);
            }
            return(Encoding.Unicode.GetString(clearBytes.ToArray()));
        }
예제 #8
0
        public Int64 GetPointer(string s)
        {
            try
            {
                if (_structs.ContainsKey(s))
                {
                    Dictionary <int, int[]> structDetails = _structs[s];
                    int   bufferSize = structDetails.ElementAt(0).Key;
                    int[] offsets    = structDetails.ElementAt(0).Value;

                    IntPtr memoryLocation = Base.GetPtr(_basePTR, offsets);

                    return(memoryLocation.ToInt64());
                }
                return(0x0);
            }
            catch
            {
                return(0x0);
            }
        }
 public static IntPtr RegisteredPlayers()
 {
     registeredPlayers = new IntPtr(0x0);
     registeredPlayers = Base.GetPtr(localGameWorld, registeredPlayerStruct);
     return(registeredPlayers);
 }
 public static IntPtr LocalGameWorld()
 {
     localGameWorld = new IntPtr(0x0);
     localGameWorld = Base.GetPtr(gameWorld, localGameWorldStruct);
     return(localGameWorld);
 }
예제 #11
0
        private bool WorldToScreen(UE.Vector3 _Enemy, out UE.Vector3 _Screen)
        {
            _Screen = new UE.Vector3(0, 0, 0);
            Numerics.Matrix4x4 temp = Numerics.Matrix4x4.Transpose(Memory.Read <Numerics.Matrix4x4>(Base.GetPtr(EFTCore.fpsCamera, new int[] { 0x30, 0x18, 0xC0 }).ToInt64()));

            UE.Vector3 translationVector = new UE.Vector3(temp.M41, temp.M42, temp.M43);
            UE.Vector3 up    = new UE.Vector3(temp.M21, temp.M22, temp.M23);
            UE.Vector3 right = new UE.Vector3(temp.M11, temp.M12, temp.M13);

            float w = D3DXVec3Dot(translationVector, _Enemy) + temp.M44;

            if (w < 0.098f)
            {
                return(false);
            }

            float y = D3DXVec3Dot(up, _Enemy) + temp.M24;
            float x = D3DXVec3Dot(right, _Enemy) + temp.M14;

            _Screen.x = (this.Width / 2) * (1f + x / w);
            _Screen.y = (this.Height / 2) * (1f - y / w);
            _Screen.z = w;

            return(true);
        }