Beispiel #1
0
 public T GetValue <T>(IMemoryOffset <T> offset)
 {
     using (IMemory <T> mem = this.GetMemory(offset))
     {
         return(mem.Value);
     }
 }
Beispiel #2
0
        public IMemory <T> GetMemory <T>(IMemoryOffset <T> offset)
        {
            IMemory <T> mem = injection.GetMemory <T>(this.baseOffset, offset);

            this.memories.Add(new WeakReference <IMemory>(mem));
            return(mem);
        }
        private static string GetString(IMemoryOffset offset)
        {
            Type   type     = offset.GetType();
            string typeName = type.Name;

            if (type.IsGenericType)
            {
                typeName  = typeName.Split('`')[0];
                typeName += "<";

                Type[] generics = type.GetGenericArguments();
                for (int i = 0; i < generics.Length; i++)
                {
                    if (i > 1)
                    {
                        typeName += ", ";
                    }

                    typeName += generics[i].Name;
                }

                typeName += ">";
            }

            string val = string.Empty;

            for (int i = 0; i < offset.Offsets.Length; i++)
            {
                if (i > 1)
                {
                    val += ", ";
                }

                val += offset.Offsets[i].ToString("X2");
            }

            return(typeName + " [" + val + "]");
        }
Beispiel #4
0
 public IMemory <T> GetMemory <T>(IMemoryOffset <T> offset)
 {
     return(InjectionService.Instance.GetMemory <T>(this, offset));
 }
 public T GetValue <T>(IMemoryOffset <T> offset)
 {
     throw new NotImplementedException();
 }
 public IMemory <T> GetMemory <T>(IMemoryOffset <T> offset)
 {
     throw new NotImplementedException();
 }
Beispiel #7
0
 /// <summary>
 /// Creates a two-way binding between this memory object and the given property.
 /// </summary>
 /// <param name="self">this.</param>
 /// <param name="offset">the offset to bind to.</param>
 /// <param name="owner">the object that owns the property.</param>
 /// <param name="propertyName">the property to bind.</param>
 public static void UnBind <T>(this IBaseMemoryOffset self, IMemoryOffset <T> offset, object owner, string propertyName)
     where T : struct
 {
     BindUtility.Clear(owner, propertyName);
 }
Beispiel #8
0
 /// <summary>
 /// Creates a two-way binding between this memory object and the given property.
 /// </summary>
 /// <param name="self">this.</param>
 /// <param name="offset">the offset to bind to.</param>
 /// <param name="owner">the object that owns the property.</param>
 /// <param name="propertyName">the property to bind.</param>
 public static void Bind <T>(this IBaseMemoryOffset self, IMemoryOffset <T> offset, object owner, string propertyName)
     where T : struct
 {
     self.GetMemory(offset).Bind(owner, propertyName);
 }
Beispiel #9
0
 public IMemory <T> GetMemory <T>(IMemoryOffset <T> offset)
 {
     return(injection.GetMemory <T>(this, offset));
 }
Beispiel #10
0
 public void SetValue <T>(IMemoryOffset <T> offset, T value)
 {
     using IMemory <T> mem = this.GetMemory(offset);
     mem.Value = value;
 }