Beispiel #1
0
 public DeepPointer(OffsetT base_, params OffsetT[] offsets)
 {
     _base    = base_;
     _offsets = new List <OffsetT>();
     _offsets.Add(0); // deref base first
     _offsets.AddRange(offsets);
 }
Beispiel #2
0
        public DeepPointer(DeepPointer deepPointer, params OffsetT[] offsets)
        {
            _base = deepPointer.GetBase();
            List <OffsetT> offsetLst = new List <OffsetT>(deepPointer.GetOffsets());

            offsetLst.AddRange(offsets);
            _offsets = offsetLst;
        }
Beispiel #3
0
        public bool DerefString(Process process, ReadStringType type, StringBuilder sb)
        {
            OffsetT offset = _offsets[_offsets.Count - 1];
            IntPtr  ptr;

            if (!this.DerefOffsets(process, out ptr) ||
                !process.ReadString(ptr + offset, type, sb))
            {
                return(false);
            }
            return(true);
        }
Beispiel #4
0
        internal DeepPointer ModifyOffset(int offsetIndex, OffsetT NewValue)
        {
            if (offsetIndex >= 0 && offsetIndex < _offsets.Count)
            {
                if (_offsets[0] == 0)
                {
                    offsetIndex++;
                }

                _offsets[offsetIndex] = NewValue;
            }
            return(this);
        }
Beispiel #5
0
        internal DeepPointer MultiplyOffset(int offsetIndex, OffsetT multiplayBy)
        {
            if (offsetIndex >= 0 && offsetIndex < _offsets.Count)
            {
                if (_offsets[0] == 0)
                {
                    offsetIndex++;
                }

                _offsets[offsetIndex] *= multiplayBy;
            }
            return(this);
        }
Beispiel #6
0
        public bool DerefBytes(Process process, int count, out byte[] value)
        {
            OffsetT offset = _offsets[_offsets.Count - 1];
            IntPtr  ptr;

            if (!this.DerefOffsets(process, out ptr) ||
                !process.ReadBytes(ptr + offset, count, out value))
            {
                value = null;
                return(false);
            }

            return(true);
        }
Beispiel #7
0
        public bool Deref <T>(Process process, out T value) where T : struct
        {
            OffsetT offset = _offsets[_offsets.Count - 1];
            IntPtr  ptr;

            if (!this.DerefOffsets(process, out ptr) ||
                !process.ReadValue(ptr + offset, out value))
            {
                value = default(T);
                return(false);
            }

            return(true);
        }
 public DeepPointer(OffsetT base_, params OffsetT[] offsets)
 {
     _base = base_;
     InitializeOffsets(offsets);
 }
 public DeepPointer(string module, OffsetT base_, params OffsetT[] offsets)
     : this(base_, offsets)
 {
     _module = module.ToLower();
 }
Beispiel #10
0
 public DeepPointer(OffsetT base_, DerefType derefType, params OffsetT[] offsets)
 {
     _base      = base_;
     _derefType = derefType;
     InitializeOffsets(offsets);
 }
Beispiel #11
0
 public DeepPointer(OffsetT base_, params OffsetT[] offsets)
     : this(base_, DerefType.Auto, offsets)
 {
 }
Beispiel #12
0
 public DeepPointer(string module, OffsetT base_, params OffsetT[] offsets)
     : this(module, base_, DerefType.Auto, offsets)
 {
 }
Beispiel #13
0
 public DeepPointer(OffsetT base_, bool baseIsAbsolute_, params OffsetT[] offsets)
     : this(base_, offsets)
 {
     _baseIsAbsolute = baseIsAbsolute_;
 }
Beispiel #14
0
 public DeepPointer(OffsetT base_, List <int> offsets)
 {
     _base    = base_;
     _offsets = offsets;
 }
Beispiel #15
0
 public GameVar(string id, OffsetT base_, params OffsetT[] offsets) : base(new DeepPointer(base_, offsets))
 {
     this.Name           = id;
     this.UpdateInterval = TimeSpan.FromMilliseconds(5);
 }