Ejemplo n.º 1
0
            private IList ReadList(IntPtr finalAddress, PropInfo propInfo)
            {
                if (finalAddress == IntPtr.Zero)
                {
                    return(null);
                }

                var classPointers = ObjectReader.ReadUIntList(finalAddress);
                var propListValue = (IList)propInfo.Getter();

                if (classPointers == null || classPointers.Count == 0 || classPointers.Count > propListValue.Count)
                {
                    return(propListValue);
                }

                var rootPath = $"{propInfo.Path}*{classPointers.Count}";

                for (int i = 0; i < classPointers.Count; i++)
                {
                    if (classPointers[i] > IntPtrExtensions.MaxValue)
                    {
                        return(propListValue);
                    }

                    TryInternalRead(propListValue[i], new IntPtr(classPointers[i]), $"{rootPath}[{i}]");
                }

                return(propListValue);
            }
Ejemplo n.º 2
0
            protected override object ReadObjectAt(IntPtr finalAddress, PropInfo propInfo)
            {
                if (finalAddress == IntPtr.Zero)
                {
                    return(null);
                }
                if (propInfo.PropType == typeof(List <MultiplayerPlayer>))
                {
                    var playerClassPointers = ObjectReader.ReadIntList(finalAddress);
                    var playerList          = (List <MultiplayerPlayer>)propInfo.Getter();
                    if (playerClassPointers == null || playerClassPointers.Count == 0 || playerClassPointers.Count > playerList.Count)
                    {
                        return(playerList);
                    }

                    var rootPath = $"{propInfo.Path}*{playerClassPointers.Count}";
                    for (int i = 0; i < playerClassPointers.Count; i++)
                    {
                        TryInternalRead(playerList[i], new IntPtr(playerClassPointers[i]), $"{rootPath}[{i}]");
                    }

                    return(playerList);
                }

                return(base.ReadObjectAt(finalAddress, propInfo));
            }