stoneharry

Untitled

Jun 17th, 2012
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1.     static const unsigned short hash_constant (0x7a0b);
  2.     Sha1Hash newone;
  3.     newone.UpdateBigNumbers (&m_sessionkey, NULL);
  4.     newone.UpdateData ((uint8*)&hash_constant, sizeof (hash_constant));
  5.     newone.Finalize();
  6.     const unsigned char* hashed_session_key (newone.GetDigest());
  7.  
  8.     std::stringstream stream;  
  9.     for(int i = 0; i < 20; i++)
  10.     {
  11.         stream << std::hex << (unsigned int)hashed_session_key[i];
  12.     }
  13.     std::string printable(stream.str());
  14.  
  15.     // Let the DB know
  16.     //sLogonSQL->Execute("UPDATE `account_messages` SET `hash` = '%s' WHERE `account` = '%s';", printable, m_account->UsernamePtr);
Advertisement
Add Comment
Please, Sign In to add comment