Have you even looked into functions I mentioned in other thread? Stop being lazy. This is exactly same code that I linked above:
Code:
void __thiscall WowConnection::SetEncryptionKey(WowConnection *this, BYTE *sessionKey, unsigned __int8 sessionKeySize, unsigned __int8 direction, BYTE *seedKeys, unsigned __int8 seedKeysSize)
{
WowConnection *_this; // ebx@1
BYTE *_seedKeys; // ecx@1
unsigned __int8 _seedKeysSize; // al@2
int __seedKeysSize; // eax@4
int v10; // eax@4
int v11; // ecx@4
int v12; // edx@4
int v13; // eax@4
int v14; // ST08_4@4
int v15; // eax@4
int v16; // ecx@4
int v17; // edi@4
int v18; // edx@4
int v19; // eax@4
const void *v20; // ebx@4
char hmacCtx[160]; // [sp+Ch] [bp-170h]@4
char v22[64]; // [sp+ACh] [bp-D0h]@4
char sha1ctx[96]; // [sp+ECh] [bp-90h]@4
char v24[20]; // [sp+14Ch] [bp-30h]@4
BYTE *__seedKeys; // [sp+160h] [bp-1Ch]@4
BYTE *v26; // [sp+164h] [bp-18h]@4
int hmacHash[5]; // [sp+168h] [bp-14h]@4
const void *v33; // [sp+188h] [bp+Ch]@4
int v34; // [sp+194h] [bp+18h]@4
_this = this;
_seedKeys = seedKeys;
if ( seedKeys )
{
_seedKeysSize = seedKeysSize;
}
else
{
_seedKeys = (BYTE *)&hmac_seeds_keys;
_seedKeysSize = 32;
}
__seedKeysSize = _seedKeysSize >> 1; // _seedKeysSize / 2 = 16 bytes
__seedKeys = _seedKeys;
v26 = &_seedKeys[__seedKeysSize];
v34 = __seedKeysSize;
HMAC::Prepare((int)hmacCtx, (int)(&__seedKeys)[4 * direction], __seedKeysSize);
SHA1::Process2(hmacCtx, (int)sessionKey, sessionKeySize);
SHA1::Finish(hmacCtx, (int)v24);
SHA1::Prepare((int)sha1ctx);
SHA1::Process2(sha1ctx, (int)v22, 64);
SHA1::Process2(sha1ctx, (int)v24, 20);
SHA1::Finish(sha1ctx, (int)hmacHash);
v10 = hmacHash[1];
v11 = hmacHash[2];
_this->key1[0] = hmacHash[0];
v12 = hmacHash[3];
_this->key1[1] = v10;
v13 = hmacHash[4];
_this->key1[2] = v11;
_this->key1[3] = v12;
v14 = (int)(&__seedKeys)[4 * (direction ^ 1)];
_this->key1[4] = v13;
HMAC::Prepare((int)hmacCtx, v14, v34);
SHA1::Process2(hmacCtx, (int)sessionKey, sessionKeySize);
SHA1::Finish(hmacCtx, (int)v24);
SHA1::Prepare((int)sha1ctx);
SHA1::Process2(sha1ctx, (int)v22, 64);
SHA1::Process2(sha1ctx, (int)v24, 20);
SHA1::Finish(sha1ctx, (int)hmacHash);
v15 = hmacHash[1];
v16 = hmacHash[2];
v17 = (int)_this->key2;
_this->key2[0] = hmacHash[0];
v18 = hmacHash[3];
_this->key2[1] = v15;
v19 = hmacHash[4];
_this->key2[2] = v16;
_this->key2[3] = v18;
_this->key2[4] = v19;
v33 = _this->rc4state1;
SARC4PrepareKey(_this->key1, 20, _this->rc4state1);
v20 = _this->rc4state2;
SARC4PrepareKey(v17, 20, v20);
SARC4ProcessBuffer((int)byte_D93B80, 0x400u, v33, (void *)v33);
SARC4ProcessBuffer((int)byte_D93B80, 0x400u, v20, (void *)v20);
}