ekg2  GIT master
gg-keygen-gg32.h
Idź do dokumentacji tego pliku.
1 /* gg_login_hash() copied from libgadu copyrighted under LGPL-2.1 (C) libgadu developers */
2 /* cache created by me. */
3 static unsigned int gg_login_hash() {
4  static unsigned int saved_y;
5  static unsigned char *saved_pos;
6  static unsigned char saved_zn;
7 
8  unsigned int y;
9  unsigned char *password;
10 
11  if (saved_pos && *saved_pos == saved_zn) {
12  y = saved_y;
13  password = saved_pos + 1;
14  } else {
15  y = SEED;
16  password = realpass;
17  }
18 
19 /* I have no idea, how to crack/optimize this algo. Maybe someone? */
20  do {
21  register unsigned char zn = *password;
22  register unsigned char z;
23 
24  y ^= zn;
25  y += zn;
26 
27  y ^= (zn << 8);
28  y -= (zn << 16);
29  y ^= (zn << 24);
30 
31  z = y & 0x1F;
32  y = (y << z) | (y >> (32 - z));
33 
34  if (*(++password)) {
35  y ^= (zn << 24);
36  y += (zn << 24);
37 
38  if (password[1] == '\0') {
39  saved_y = y;
40  saved_zn = zn;
41  saved_pos = &password[-1];
42  }
43  }
44  } while (*password);
45 
46 #if ULTRA_DEBUG
47  printf("%s -> 0x%x\n", realpass, y);
48 #endif
49  return y;
50 }
51 
static unsigned char realpass[15+1]
Definition: gg-keygen.c:100
static unsigned int gg_login_hash()
Definition: gg-keygen-gg32.h:3