internal string PopFixedString() { string data = PopFixedString(PiciEnvironment.GetDefaultEncoding()); CheckForExploits(data); return(data); }
public override string ToString() { string text = Header + PiciEnvironment.GetDefaultEncoding().GetString(Body); //CheckForExploits(text); return(text); }
internal void Append(object e) { if (e is int) { AppendInt32((int)e); } else if (e is bool) { AppendBoolean((bool)e); } else { AppendBytes(PiciEnvironment.GetDefaultEncoding().GetBytes((string)e)); AppendByte(2); } }
internal void HandleConnectionData(ref byte[] data) { if (data[0] == 64) { int pos = 0; while (pos < data.Length) { try { int MessageLength = Base64Encoding.DecodeInt32(new byte[] { data[pos++], data[pos++], data[pos++] }); int MessageId = Base64Encoding.DecodeInt32(new byte[] { data[pos++], data[pos++] }); byte[] Content = new byte[MessageLength - 2]; for (int i = 0; i < Content.Length; i++) { Content[i] = data[pos++]; } ClientMessage Message = new ClientMessage(MessageId, Content); Console.WriteLine("[Request] >> [" + MessageId + "] " + Message.ToString()); if (MessageHandler == null) { InitHandler(); } //DateTime PacketMsgStart = DateTime.Now; } catch (Exception e) { Logging.HandleException(e, "packet handling"); Disconnect(); } } } else { Connection.SendData(PiciEnvironment.GetDefaultEncoding().GetBytes(CrossdomainPolicy.GetXmlPolicy())); } }
void PolicyRequest() { Connection.SendData(PiciEnvironment.GetDefaultEncoding().GetBytes(CrossdomainPolicy.GetXmlPolicy())); }
public override string ToString() { return(Header + PiciEnvironment.GetDefaultEncoding().GetString(Body.ToArray())); }
internal void AppendString(string s) { AppendString(s, PiciEnvironment.GetDefaultEncoding()); }