INNER CODE UNIT · C#
endOfStringPosition
OpenKH/OpenKh · Binarysharp.MSharp/MemorySharp.cs:391
return endOfStringPosition == -1 ? data : data.Substring(0, endOfStringPosition);
}
/// <summary>
/// Reads a string with a specified encoding in the remote process.
/// </summary>
/// <param name="address">The address where the string is read.</param>
/// <param name="encoding">The encoding used.</param>
/// <param name="isRelative">[Optional] State if the address is relative to the main module.</param>
/// <param name="maxLength">[Optional] The number of maximum bytes to read. The string is automatically cropped at this end ('\0' char).</param>
/// <returns>The string.</returns>
public string ReadString(Enum address, Encoding encoding, bool isRelative = true, int maxLength = 512)
{
return ReadString(new IntPtr(Convert.ToInt64(address)), encoding, isRelative, maxLength);
}
/// <summary>
/// Reads a string using the encoding UTF8 in the remote process.
/// </summary>
/// <param name="address">The address where the string is read.</param>