INNER CODE UNIT · C#

offsetInArray

OpenKH/OpenKh · Binarysharp.MSharp/MemorySharp.cs:466

                var offsetInArray = MarshalType<T>.Size * i;
                Buffer.BlockCopy(MarshalType<T>.ObjectToByteArray(array[i]), 0, valuesInBytes, offsetInArray, MarshalType<T>.Size);
            }

            WriteBytes(address, valuesInBytes, isRelative);
        }
        /// <summary>
        /// Writes an array of a specified type in the remote process.
        /// </summary>
        /// <typeparam name="T">The type of the values.</typeparam>
        /// <param name="address">The address where the values is written.</param>
        /// <param name="array">The array to write.</param>
        /// <param name="isRelative">[Optional] State if the address is relative to the main module.</param>
        public void Write<T>(Enum address, T[] array, bool isRelative = true)
        {
            Write(new IntPtr(Convert.ToInt64(address)), array, isRelative);
        }
        #endregion

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…