-
-
Save hasherezade/ed8366cf0fd007a2a416f2531d5251e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void lockcrypt::level2_crypt(void *buf, size_t buf_size, void *key, size_t key_size) | |
{ | |
size_t dwsize = buf_size >> 2; | |
for (size_t i = 4, k = 0; i < buf_size - 6; i += 4, k +=4) { | |
if (k > KEY_SIZE) { | |
k = 0; | |
} | |
DWORD *dwlist = (DWORD *) ((ULONGLONG)buf + i); | |
DWORD *keydw = (DWORD *) ((ULONGLONG)key + k); | |
DWORD inp = *dwlist; | |
inp = rol32(inp, 5); | |
DWORD out = inp ^ (*keydw); | |
out = bswap32(out); | |
(*dwlist) = out; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment