BattleNet.Bsha1.DoubleHash C# (CSharp) Method

DoubleHash() public static method

public static DoubleHash ( UInt32 client_token, UInt32 server_token, string password ) : List
client_token System.UInt32
server_token System.UInt32
password string
return List
        public static List<byte> DoubleHash(UInt32 client_token, UInt32 server_token, string password)
        {
            byte[] pv = System.Text.Encoding.UTF8.GetBytes(password);
            List<byte> password_hash = GetHash(new List<byte>(pv));

            List<byte> final_input = new List<byte>(BitConverter.GetBytes((UInt32)client_token));
            final_input.AddRange(BitConverter.GetBytes((UInt32)server_token));
            final_input.AddRange(password_hash);

            List<byte> output = GetHash(final_input);

            return output;
        }

Usage Example

Example #1
0
        protected void AccountLogin(byte type, List <byte> data)
        {
            if (ClientlessBot.debugging)
            {
                Console.WriteLine("{0}: [BNCS] Logging into the account", m_owner.Account);
            }
            UInt32      client_token = (uint)System.Environment.TickCount;
            List <byte> hash         = Bsha1.DoubleHash(client_token, m_owner.ServerToken, m_owner.Password);

            byte[] packet = BuildPacket((byte)0x3a, BitConverter.GetBytes(client_token), BitConverter.GetBytes(m_owner.ServerToken), hash, System.Text.Encoding.ASCII.GetBytes(m_owner.Account), zero);

            PrintPacket(packet);

            m_stream.Write(packet, 0, packet.Length);
        }
All Usage Examples Of BattleNet.Bsha1::DoubleHash