public uint Login(string acctName, ShaHash acctPW, int cliChal) { Auth_LoginRequest req = new Auth_LoginRequest(); req.fAccount = acctName; req.fChallenge = cliChal; req.fHash = acctPW; req.fOS = "MUd 2"; req.fTransID = IGetTransID(); ResetIdleTimer(); lock (fStream) { fStream.BufferWriter(); fStream.WriteUShort((ushort)AuthCli2Srv.AcctLoginRequest); req.Write(fStream); fStream.FlushWriter(); } return req.fTransID; }
public static ShaHash HashLoginInfo(string acct, string pw, int clientChallenge, uint serverChallenge) { ShaHash namepass = HashAcctPW(acct, pw); byte[] buf = new byte[namepass.CsHash.Length + 8]; Buffer.BlockCopy(BitConverter.GetBytes(clientChallenge), 0, buf, 0, 4); Buffer.BlockCopy(BitConverter.GetBytes(serverChallenge), 0, buf, 4, 4); Buffer.BlockCopy(namepass.CsHash, 0, buf, 8, namepass.CsHash.Length); ShaHash sha = new ShaHash(buf, false); return sha; }
public static ShaHash HashAcctPW(string acct, string pw) { byte[] acctData = Encoding.Unicode.GetBytes(acct.ToLower()); byte[] pwData = Encoding.Unicode.GetBytes(pw); //StrCopy FAIL acctData[acctData.Length - 1] = 0; acctData[acctData.Length - 2] = 0; pwData[pwData.Length - 1] = 0; pwData[pwData.Length - 2] = 0; byte[] data = new byte[acctData.Length + pwData.Length]; Buffer.BlockCopy(pwData, 0, data, 0, pwData.Length); Buffer.BlockCopy(acctData, 0, data, pwData.Length, acctData.Length); ShaHash sha = new ShaHash(data, false); return sha; }
public void Read(UruStream s) { fTransID = s.ReadUInt(); fChallenge = s.ReadInt(); fAccount = s.ReadUnicodeStringV16(64); uint[] hash = new uint[5]; for (int i = 0; i < hash.Length; i++) hash[i] = s.ReadUInt(); fHash = new ShaHash(hash); fAuthToken = s.ReadUnicodeStringV16(64); fOS = s.ReadUnicodeStringV16(8); }