>Hooks.cpp>// key is encoded with some sort of algorithm; decode it here
Here's what happens. A 64-bit key is present as two u32 values: key0 -> keyPtr and key1 -> uVar3. This encodes the real key which has four u32 values. For decoding the current position starts at 3 and cycles to 0 four times, this is keyDecoded[index & 3]. The value to the left of the current position with wrapping is uVar1. At each step a delta is computed from the left value, the step/index and the two key values, and this delta is used to update the current value:
current = current + delta
The delta in Hooks.cpp is:
(((((uVar1 + index + keyPtr & uVar1 * 16 + uVar3) * 2 + uVar1 * -17) - index) - uVar3) - keyPtr)
which can be reorganized as:
(((left + index + key0) & ((left << 4) + key1)) << 1) - (left + index + key0 + (left << 4) + key1)
TakingPost too long. Click here to view the full text.