33 for (i = size; i != 0; pbSrcDst += 64, i -= 64) {
34 memcpy(buf, pbSrcDst, 64);
36 for (
int j = 0; j < 64; j++) {
40 memset(dst, 0,
sizeof(dst));
41 memcpy(pbSrcDst, buf, 64);
44 memset(buf, 0,
sizeof(buf));
51 if (sig->
checksum != *(DWORD *)dst) {
52 memset(dst, 0,
sizeof(dst));
67 std::uint32_t rand_state = 0x7058;
68 for (std::size_t i = 0; i <
sizeof(key); ++i) {
69 rand_state = rand_state * 214013 + 2531011;
70 key[i] = rand_state >> 16;
74 std::size_t password_i = 0;
75 for (std::size_t i = 0; i <
sizeof(pw); ++i, ++password_i) {
76 if (pszPassword[password_i] ==
'\0')
78 pw[i] = pszPassword[password_i];
85 for (std::size_t i = 0; i <
sizeof(key); ++i)
87 memset(pw, 0,
sizeof(pw));
88 memset(digest, 0,
sizeof(digest));
89 for (
int n = 0; n < 3; ++n) {
93 memset(key, 0,
sizeof(key));
98 if (dwSrcBytes % 64 != 0)
99 dwSrcBytes += 64 - (dwSrcBytes % 64);
100 return dwSrcBytes + 8;
103 void codec_encode(BYTE *pbSrcDst, DWORD size,
int size_64,
char *pszPassword)
118 chunk = size < 64 ? size : 64;
119 memcpy(buf, pbSrcDst, chunk);
121 memset(buf + chunk, 0, 64 - chunk);
124 for (
int j = 0; j < 64; j++) {
127 memset(dst, 0,
sizeof(dst));
128 memcpy(pbSrcDst, buf, 64);
133 memset(buf, 0,
sizeof(buf));