[List.External:KnownWilliam1] int last; // Last character position, zero-based int lastofs; // Last character position offset into charset[] int lastid; // Current character index in the last position int id[0x7f]; // Current character indices for other positions int charset[0x7f00]; // Character sets, 0x100 elements for each position void init() { int length; int pos, ofs, c; length = 9; // Password length to try /* This defines the character sets for different character positions */ pos = 0; while (pos < 2) { ofs = pos++ << 8; c = 'A'; while (c <= 'Z') charset[ofs++] = c++; charset[ofs] = 0; } ofs = pos++ << 8; charset[ofs++] = '0'; charset[ofs] = 0; ofs = pos++ << 8; c = '2'; while (c <= '6') charset[ofs++] = c++; charset[ofs] = 0; ofs = pos++ << 8; charset[ofs++] = '*'; charset[ofs++] = '!'; charset[ofs] = 0; while (pos < 7) { ofs = pos++ << 8; c = 'a'; while (c <= 'z') charset[ofs++] = c++; charset[ofs] = 0; } ofs = pos++ << 8; charset[ofs++] = '0'; charset[ofs] = 0; ofs = pos++ << 8; c = '2'; while (c <= '6') charset[ofs++] = c++; charset[ofs] = 0; last = length - 1; pos = -1; while (++pos <= last) word[pos] = charset[id[pos] = pos << 8]; lastid = (lastofs = last << 8) - 1; word[pos] = 0; } void generate() { int pos; /* Handle the typical case specially */ if (word[last] = charset[++lastid]) return; word[pos = last] = charset[lastid = lastofs]; while (pos--) { // Have a preceding position? if (word[pos] = charset[++id[pos]]) return; word[pos] = charset[id[pos] = pos << 8]; } word = 0; // We're done } void restore() { int i, c; /* Calculate the current length and infer the character indices */ last = 0; while (c = word[last]) { i = lastofs = last << 8; while (charset[i] != c && charset[i]) i++; if (!charset[i]) i = lastofs; // Not found id[last++] = i; } lastid = id[--last]; } [List.External:KnownWilliam2] int last; // Last character position, zero-based int lastofs; // Last character position offset into charset[] int lastid; // Current character index in the last position int id[0x7f]; // Current character indices for other positions int charset[0x7f00]; // Character sets, 0x100 elements for each position void init() { int length; int pos, ofs, c; length = 9; // Password length to try /* This defines the character sets for different character positions */ pos = 0; while (pos < 2) { ofs = pos++ << 8; c = 'a'; while (c <= 'z') charset[ofs++] = c++; charset[ofs] = 0; } ofs = pos++ << 8; charset[ofs++] = '0'; charset[ofs] = 0; ofs = pos++ << 8; c = '2'; while (c <= '6') charset[ofs++] = c++; charset[ofs] = 0; ofs = pos++ << 8; charset[ofs++] = '*'; charset[ofs++] = '!'; charset[ofs] = 0; while (pos < 7) { ofs = pos++ << 8; c = 'A'; while (c <= 'Z') charset[ofs++] = c++; charset[ofs] = 0; } ofs = pos++ << 8; charset[ofs++] = '0'; charset[ofs] = 0; ofs = pos++ << 8; c = '2'; while (c <= '6') charset[ofs++] = c++; charset[ofs] = 0; last = length - 1; pos = -1; while (++pos <= last) word[pos] = charset[id[pos] = pos << 8]; lastid = (lastofs = last << 8) - 1; word[pos] = 0; } void generate() { int pos; /* Handle the typical case specially */ if (word[last] = charset[++lastid]) return; word[pos = last] = charset[lastid = lastofs]; while (pos--) { // Have a preceding position? if (word[pos] = charset[++id[pos]]) return; word[pos] = charset[id[pos] = pos << 8]; } word = 0; // We're done } void restore() { int i, c; /* Calculate the current length and infer the character indices */ last = 0; while (c = word[last]) { i = lastofs = last << 8; while (charset[i] != c && charset[i]) i++; if (!charset[i]) i = lastofs; // Not found id[last++] = i; } lastid = id[--last]; }