public ReadStringUnicode ( bool AddToImageAddress, int pOffset, int pSize ) : string | ||
AddToImageAddress | bool | |
pOffset | int | |
pSize | int | |
return | string |
public static string ReadValidString(this ProcessMemory pm, IntPtr pOffset, uint pSize, params long[] offsets) { string raw = pm.ReadStringUnicode(pOffset, pSize, offsets); string utf8 = Encoding.ASCII.GetString( Encoding.Convert( Encoding.UTF8, Encoding.GetEncoding( Encoding.ASCII.EncodingName, new EncoderReplacementFallback(string.Empty), new DecoderExceptionFallback()), Encoding.UTF8.GetBytes(raw) ) ); int escapeIndex = utf8.IndexOf("\u0000"); if (escapeIndex > -1) { utf8 = utf8.Remove(escapeIndex); } if (utf8.Length == 0) { return(raw); } return(utf8); }
public static string PlayerName(int index) => Game.ReadStringUnicode(new IntPtr(0x140598BD4 + index * 0x68), 0x20);