Very nice. this is really helpful, thanks for this!
:thumbsup:
This is a discussion on IHabbo new Protocol within the Habbo Releases forums, part of the Habbo Hotel category; ServerMessage Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IHabbo.Messages.Traffic { struct ServerMessage { #region Fields private Int32 ...

ServerMessage
ClientMessageCode:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IHabbo.Messages.Traffic { struct ServerMessage { #region Fields private Int32 Header; private List Content; private Boolean Disposed; #endregion #region Constructors public ServerMessage(Int32 Header) { this.Header = Header; this.Content = new List(); this.Disposed = false; Append((Int16)Header); } #endregion #region Methods public void Append(Object Object) { Append(Object, true); } public void Append(Object Object, Boolean EnableChar) { if (Object.GetType().Equals(typeof(Int16))) { Append((Int16)Object); } if (Object.GetType().Equals(typeof(Int32))) { Append((Int32)Object); } else if (Object.GetType().Equals(typeof(Boolean))) { Append((Boolean)Object); } else if (Object.GetType().Equals(typeof(String))) { Append(Object.ToString(), EnableChar); } else if (Object.GetType().Equals(typeof(Char))) { Append((Char)Object); } } private void Append(Int16 Int16) { Append(BitConverter.GetBytes(Int16)); } private void Append(Int32 Int32) { Append(BitConverter.GetBytes(Int32)); } private void Append(string String, Boolean EnableChar) { Append((short)String.Length); Content.AddRange(Encoding.Default.GetBytes(String)); } private void Append(Boolean Bool) { Content.Add(BitConverter.GetBytes((Bool) ? 1 : 0)[0]); } private void Append(byte[] Bytes) { for (int i = (Bytes.Length - 1); i > -1; i--) { Content.Add(Bytes[i]); } } #endregion #region Quick Returns public int GetHeader() { return Header; } public string GetString() { return Encoding.Default.GetString(GetBytes()); } public byte[] GetBytes() { var Bytes = new List(); var LengthBits = BitConverter.GetBytes(Content.Count); Bytes.AddRange(LengthBits); Bytes.Reverse(); Bytes.AddRange(Content); return Bytes.ToArray(); } #endregion } }
:) 'waves'Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IHabbo.Messages.Traffic { struct ClientMessage { private readonly int HeaderId; private readonly byte[] Content; private int Pointer; public int Id { get { return HeaderId; } } public int Length { get { return Content.Length; } } public int RemainingLength { get { return (Content.Length - Pointer); } } public string Header { get { return Encoding.Default.GetString(Base64Encoding.EncodeInt32(HeaderId, 2)); } } public ClientMessage(int HeaderId, byte[] Content) { if (Content == null) { Content = new byte[0]; } this.HeaderId = HeaderId; this.Content = Content; var Builder = string.Empty; foreach (byte b in Content) { Builder += "{" + b + "}"; } IO.Compose(Builder); Pointer = 0; } public override string ToString() { return (Header + Encoding.Default.GetString(Content)); } public void ResetPointer() { Pointer = 0; } public void AdvancePointer(int i) { Pointer += i; } public string GetBody() { return Encoding.Default.GetString(Content); } public byte[] ReadBytes(int Length, Boolean Rebound) { if (Length > this.RemainingLength) { Length = this.RemainingLength; } var Bytes = new List(); for (int i = 0; i < Length; i++) { Bytes.Add(Content[Pointer++]); } if (Rebound) { Bytes.Reverse(); } return Bytes.ToArray(); } public byte[] PlainReadBytes(int Length) { if (Length > RemainingLength) { Length = RemainingLength; } byte[] Bytes = new byte[Length]; for (int x = 0, y = Pointer; x < Length; x++, y++) { Bytes[x] = Content[y]; } return Bytes; } public byte[] ReadFixedValue() { int len = BitConverter.ToInt16(ReadBytes(2, true), 0); IO.Compose(len + string.Empty); return ReadBytes(len, false); } public Boolean PopBase64Boolean() { if (RemainingLength > 0 && Content[Pointer++] == Base64Encoding.POSITIVE) { return true; } return false; } public Int32 PopInt32() { return BitConverter.ToInt32(ReadBytes(4, true), 0); } public UInt32 PopUInt32() { return (UInt32)PopInt32(); } public string PopFixedString() { return IOScript.InjectionString(PopFixedString(Encoding.Default)); } public string PopFixedString(Encoding Encoding) { try { return Encoding.GetString(ReadFixedValue()); } catch { return string.Empty; } } public Int32 PopFixedInt32() { Int32 i = 0; string s = PopFixedString(Encoding.ASCII); Int32.TryParse(s, out i); return i; } public UInt32 PopFixedUInt32() { return (uint)PopFixedInt32(); } public Boolean PopWiredBoolean() { if (this.RemainingLength > 0 && Content[Pointer++] == WireEncoding.POSITIVE) { return true; } return false; } public int PopWiredInt32() { try { var Bytes = BitConverter.ToInt32(ReadBytes(4, true), 0); return Bytes; } catch { return 0; } } public uint PopWiredUInt() { return (uint)PopWiredInt32(); } } }
Very nice. this is really helpful, thanks for this!
:thumbsup:
For what is this?
It´s new crypto?
This Does Look abit like Ion/Delta but anyways Nice!
For what is this?²
Nice job my friend.
This is the Code:
private List<byte> Content;
you forgot the <byte> :)
Ever heard of "is"?
PHP Code:if (Object.GetType().Equals(typeof(Int32)))
PHP Code:if (Object is Int32)
hmm possible to make this for uber too?
What is? :D