Пример #1
0
 public static void FakeManagedString(this RemoteMemoryStream stream, string str)
 {
     stream.Write <nuint>(0);                                        //sync block
     stream.Write(stream.Context.Runtime.Heap.StringType.ClrHandle); //handle
     stream.Write((nuint)str.Length);                                //length
     WriteWCHARArray(stream, str);
 }
Пример #2
0
 /// <summary>
 /// For ASCII string
 /// </summary>
 /// <param name="str"></param>
 public static void WriteCHARArray(this RemoteMemoryStream stream, string str)
 {
     byte[] data = Encoding.ASCII.GetBytes(str);
     stream.Write(data, (uint)data.Length);
     stream.Write <byte>(0);
 }
Пример #3
0
 /// <summary>
 /// For unicode string
 /// </summary>
 /// <param name="str"></param>
 public static void WriteWCHARArray(this RemoteMemoryStream stream, string str)
 {
     byte[] data = Encoding.Unicode.GetBytes(str);
     stream.Write(data, (uint)data.Length);
     stream.Write <short>(0);
 }