Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint64_t tsl_decrypt_2(struct Tsl *tsl, uint64_t prop)
- {
- struct uint128_t xmm;
- if (!READ(prop, &xmm, 16))
- {
- return 0;
- }
- uint32_t key = (uint32_t)xmm.low;
- if (!IsValid(xmm.high))
- return 0;
- if (!mem->IsValid(xmm.high) || !mem->IsValid(key))
- return 0;
- int v6; // ecx
- int v7; // edx
- int v8; // eax
- if (IDA_LOWORD(key) & 4)
- v6 = ~(~IDA_LOWORD(key) + 117);
- else
- LOWORD(v6) = IDA_LOWORD(key) - 78;
- v7 = (unsigned __int16)v6 ^ ((unsigned __int16)ror2(IDA_HIWORD(key), 8) + 54121);
- v8 = (unsigned __int8)(v6 ^ (ror2(IDA_HIWORD(key), 8) + 105));
- if (v8 & 4)
- v8 = ~(~v8 - 99);
- else
- LOBYTE(v8) = v8 + 66;
- auto index = ((unsigned __int8)v8 ^ ((unsigned __int8)(BYTE1(v7) + 49)
- + 238))
- % 128;
- uint64_t func = READ64(GET_ADDR(TABLE) + 0x8 * index);
- if (auto encValue = decrypt(tsl, func, (rol8(xmm.high, 8 * (IDA_LOWORD(key) & 7u)) - (unsigned int)IDA_LOWORD(key))))
- return ror8(encValue, -59);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement