Jump to content

/dev/not/null

Members
  • Content Count

    3
  • Donations

    0.00 GBP 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About /dev/not/null

  • Rank
    Newbie

Core Infomation

  • Core
    Zero
  1. /dev/not/null

    Need help in fixing client connection

    If I understands it correctly - first 16 bytes are same to any hash and only last 4 uses ?
  2. /dev/not/null

    Need help in fixing client connection

    Well, as I can see from the mangos code, there are also some key generating exists: void AuthCrypt::Init(BigNumber* K) { uint8* key = new uint8[SHA_DIGEST_LENGTH]; uint8 recvSeed[SEED_KEY_SIZE] = { 0x38, 0xA7, 0x83, 0x15, 0xF8, 0x92, 0x25, 0x30, 0x71, 0x98, 0x67, 0xB1, 0x8C, 0x4, 0xE2, 0xAA }; HMACSHA1 recvHash(SEED_KEY_SIZE, (uint8*)recvSeed); recvHash.UpdateBigNumber(K); recvHash.Finalize(); memcpy(key, recvHash.GetDigest(), SHA_DIGEST_LENGTH); _key.resize(SHA_DIGEST_LENGTH); std::copy(key, key + SHA_DIGEST_LENGTH, _key.begin()); delete[] key; _send_i = _send_j = _recv_i = _recv_j = 0; _initialized = true; } I tried to implement this in Python, but had no success: def _generate_key(self, session_key): key = bytes(20) seed = b'8\xa7\x83\x15\xf8\x92%0q\x98g\xb1\x8c\x04\xe2\xaa' hashed = hmac.new(seed, None, sha1) return hashed.digest() Need help with hmac_sha1 python implementation.
  3. Hello, Mangos Community! I'm trying to developing python core from scratch and using your project as example. Currently my client stucks on 'Connected' and I think problem can be with packet encryption. Can anybody help me with debug or advice ? This is my project. And this is how packet encrypted: class HeaderCrypt(object): ENCRYPT_HEADER_SIZE = 4 DECRYPT_HEADER_SIZE = 6 def __init__(self, session_key): self.session_key = session_key self.send_i = 0 self.send_j = 0 self.recv_i = 0 self.recv_j = 0 def encrypt(self, data): assert len(data) >= HeaderCrypt.ENCRYPT_HEADER_SIZE encrypted_header = [0] * HeaderCrypt.ENCRYPT_HEADER_SIZE for index in range(HeaderCrypt.ENCRYPT_HEADER_SIZE): enc = (data[index] ^ self.session_key[self.send_i]) + self.send_j enc %= 0x100 encrypted_header[index] = self.send_j = enc self.send_i = (self.send_i + 1) % len(self.session_key) return bytes(encrypted_header) + data[HeaderCrypt.ENCRYPT_HEADER_SIZE:] def decrypt(self, data): assert len(data) >= HeaderCrypt.DECRYPT_HEADER_SIZE decrypted_header = [0] * HeaderCrypt.DECRYPT_HEADER_SIZE for index in range(self.DECRYPT_HEADER_SIZE): dec = (data[index] - self.recv_j) ^ self.session_key[self.recv_i] dec %= 0x100 decrypted_header[index] = dec self.recv_j = data[index] self.recv_i = (self.recv_i + 1) % len(self.session_key) return bytes(decrypted_header) + data[HeaderCrypt.DECRYPT_HEADER_SIZE:]

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×