Advertisement
Guest User

Untitled

a guest
May 27th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. uint64_t tsl_decrypt_gameinst(struct Tsl *tsl, uint64_t prop)
  2. {
  3.     struct uint128_t xmm;
  4.     if (!READ(prop, &xmm, 16))
  5.     {
  6.         return 0;
  7.     }
  8.  
  9.     uint32_t key = (uint32_t)xmm.low;
  10.     if (!IsValid(xmm.high))
  11.         return 0;
  12.     if (!mem->IsValid(xmm.high) || !mem->IsValid(key))
  13.         return 0;
  14.  
  15.     __int64 v8; // rdx
  16.     v8 = IDA_LOWORD(key) & 2 ? xmm.high ^ (unsigned int)key : xmm.high + (unsigned int)key;
  17.  
  18.     auto index = ((unsigned __int8)(((IDA_LOWORD(key) - 66) ^ (IDA_HIWORD(key) + 24)) - 82) ^ ((unsigned __int8)(((unsigned __int16)((IDA_LOWORD(key) - 66) ^ ((_WORD)key + 11032)) >> 8) + 114) + 68))
  19.         % 128;
  20.  
  21.     uint64_t func = READ64(GET_ADDR(TABLE) + 0x8 * index);
  22.  
  23.     if (auto encValue = decrypt(tsl, func, v8))
  24.         return ror8(encValue, 38);
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement