Welcome to the RaGEZONE - MMORPG development forums.

IHabbo new Protocol

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 ...

LyncusMU
Page 1 of 5 12345 LastLast
Results 1 to 15 of 67
  1. #1
    http://hardfuse.yours.tv/
    Rank
    Member +
    Join Date
    Oct 2011
    Location
    RaGEZONE
    Posts
    239
    Liked
    35

    IHabbo new Protocol

    Tabo Hotel
    ServerMessage

    Code:
    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
    }
    }
    ClientMessage

    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();
    }
    }
    }
    :) 'waves'

  2. HostKey.com: Unmetered Dedicated servers in the Netherlands
  3. #2
    Newbie
    Rank
    Newbie
    Join Date
    Aug 2011
    Posts
    15
    Liked
    0

    Re: IHabbo new Protocol

    Very nice. this is really helpful, thanks for this!
    :thumbsup:

  4. #3
    http://hardfuse.yours.tv/
    Rank
    Member +
    Join Date
    Oct 2011
    Location
    RaGEZONE
    Posts
    239
    Liked
    35

    Re: IHabbo new Protocol

    Quote Originally Posted by Someuser View Post
    *cough* ION/Deltar *cough* Nillus *cough*
    Just the ClientMessage has been edited.

  5. #4
    Working in private usage.
    Rank
    Member +
    Join Date
    Jul 2011
    Location
    On FrostEmu
    Posts
    902
    Liked
    133

    Re: IHabbo new Protocol

    For what is this?

  6. #5
    Ultimate Member
    Rank
    Member
    Join Date
    Apr 2008
    Location
    Finland
    Posts
    170
    Liked
    151

    Re: IHabbo new Protocol

    It´s new crypto?

  7. #6
    Zonehotel.org Join Now!!
    Rank
    Member +
    Join Date
    Oct 2009
    Location
    Mullins, South
    Posts
    406
    Liked
    18

    Re: IHabbo new Protocol

    This Does Look abit like Ion/Delta but anyways Nice!

  8. #7
    Average Member
    Rank
    Newbie
    Join Date
    Apr 2011
    Posts
    55
    Liked
    3

    Re: IHabbo new Protocol

    For what is this?²

  9. #8
    TopHabbo.com Best Topsite
    Rank
    Alpha Member
    Join Date
    Oct 2007
    Posts
    2,423
    Liked
    497

    Re: IHabbo new Protocol

    Nice job my friend.

  10. #9
    C# | C++
    Rank
    Member +
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    457
    Liked
    88

    Re: IHabbo new Protocol

    This is the Code:

    private List<byte> Content;

    you forgot the <byte> :)

  11. #10
    AWA
    asdfghjkløæ'
    Rank
    Member +
    Join Date
    Feb 2008
    Location
    Aperture Labs.
    Posts
    1,116
    Liked
    321

    Re: IHabbo new Protocol

    Ever heard of "is"?
    PHP Code:
    if (Object.GetType().Equals(typeof(Int32))) 
    PHP Code:
    if (Object is Int32

  12. #11
    Retired
    Rank
    Member +
    Join Date
    Mar 2007
    Location
    netherland
    Posts
    674
    Liked
    90

    Re: IHabbo new Protocol

    hmm possible to make this for uber too?

  13. #12
    C# | C++
    Rank
    Member +
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    457
    Liked
    88

    Re: IHabbo new Protocol

    Quote Originally Posted by vista4life View Post
    hmm possible to make this for uber too?
    Take the IO and IOScript Classes from iHabbo.
    Than it will work, I think

  14. #13
    Retired
    Rank
    Member +
    Join Date
    Mar 2007
    Location
    netherland
    Posts
    674
    Liked
    90

    Re: IHabbo new Protocol

    Quote Originally Posted by Emerica View Post
    Take the IO and IOScript Classes from iHabbo.
    Than it will work, I think
    those are filtering and writeline but i'm not sure this will work is this tested out already?

  15. #14
    RaGEZONER
    Rank
    Newbie
    Join Date
    Jan 2009
    Location
    Brazil
    Posts
    86
    Liked
    5

    Re: IHabbo new Protocol

    What is? :D

  16. #15
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jun 2009
    Location
    Netherlands
    Posts
    843
    Liked
    126

    Re: IHabbo new Protocol

    Quote Originally Posted by kiddoidao3d View Post
    What is? :D
    this is Wupz0r's proness

 

 
Page 1 of 5 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •