diff -urpN jumbo-bleed1/doc/OPTIONS jumbo-bleed0/doc/OPTIONS --- jumbo-bleed1/doc/OPTIONS 2012-07-02 20:46:54.703125000 +0000 +++ jumbo-bleed0/doc/OPTIONS 2012-07-02 21:07:26.343750000 +0000 @@ -320,7 +320,11 @@ The different variants of list externals --list=format-all-details list all the suported formats and their attributes in the same sequence as with --list=format-details, but in a more descriptive form readable by humans - +--list=format-methods[:WHICH] + list all methods which are NOT default for each + format. If 'WHICH' is set, then this listing + will ONLY be formats which have the 'WHICH' format + overridden. --regen-lost-salts=N Try to find password AND salt in a set of raw hashes. diff -urpN jumbo-bleed1/src/john.c jumbo-bleed0/src/john.c --- jumbo-bleed1/src/john.c 2012-07-02 20:46:56.296875000 +0000 +++ jumbo-bleed0/src/john.c 2012-07-02 21:24:53.484375000 +0000 @@ -528,7 +528,7 @@ static void john_init(char *name, int ar { puts("subformats, inc-modes, rules, externals, ext-filters, ext-filters-only,"); puts("ext-modes, build-info, hidden-options, encodings, formats, format-details,"); - printf("format-all-details, "); + printf("format-all-details, format-methods[:WHICH], "); #ifdef CL_VERSION_1_0 printf("opencl-devices, "); #endif @@ -799,6 +799,129 @@ static void john_init(char *name, int ar } while ((format = format->next)); exit(0); } + if (options.listconf && + !strncasecmp(options.listconf, "format-methods", 14)) { + struct fmt_main *format; + format = fmt_list; + do { + int ShowIt = 1, i; + if (options.listconf[14] == '=' || options.listconf[14] == ':') { + ShowIt = 0; + if (!strcasecmp(&options.listconf[15], "set_key") || + !strcasecmp(&options.listconf[15], "get_key") || + !strcasecmp(&options.listconf[15], "crypt_all") || + !strcasecmp(&options.listconf[15], "cmp_all") || + !strcasecmp(&options.listconf[15], "cmp_one") || + !strcasecmp(&options.listconf[15], "cmp_exact")) + ShowIt = 1; + else if (strcasecmp(&options.listconf[15], "init") && strcasecmp(&options.listconf[15], "prepare") && + strcasecmp(&options.listconf[15], "valid") && strcasecmp(&options.listconf[15], "split") && + strcasecmp(&options.listconf[15], "binary") && strcasecmp(&options.listconf[15], "clear_keys") && + strcasecmp(&options.listconf[15], "salt") && strcasecmp(&options.listconf[15], "get_hash") && + strcasecmp(&options.listconf[15], "get_hash[0]") && strcasecmp(&options.listconf[15], "get_hash[1]") && + strcasecmp(&options.listconf[15], "get_hash[2]") && strcasecmp(&options.listconf[15], "get_hash[3]") && + strcasecmp(&options.listconf[15], "get_hash[4]") && strcasecmp(&options.listconf[15], "get_hash[5]") && + strcasecmp(&options.listconf[15], "set_salt") && strcasecmp(&options.listconf[15], "binary_hash") && + strcasecmp(&options.listconf[15], "binary_hash[0]") && strcasecmp(&options.listconf[15], "binary_hash[1]") && + strcasecmp(&options.listconf[15], "binary_hash[2]") && strcasecmp(&options.listconf[15], "binary_hash[3]") && + strcasecmp(&options.listconf[15], "binary_hash[3]") && strcasecmp(&options.listconf[15], "binary_hash[5]") && + strcasecmp(&options.listconf[15], "salt_hash") && strcasecmp(&options.listconf[15], "get_source")) + { + fprintf(stderr, "Error, invalid option (invalid method name) %s\n", options.listconf); + exit(1); + } + if (format->methods.init != fmt_default_init && !strcasecmp(&options.listconf[15], "init")) + ShowIt = 1; + if (format->methods.prepare != fmt_default_prepare && !strcasecmp(&options.listconf[15], "prepare")) + ShowIt = 1; + if (format->methods.valid != fmt_default_valid && !strcasecmp(&options.listconf[15], "valid")) + ShowIt = 1; + if (format->methods.split != fmt_default_split && !strcasecmp(&options.listconf[15], "split")) + ShowIt = 1; + if (format->methods.binary != fmt_default_binary && !strcasecmp(&options.listconf[15], "binary")) + ShowIt = 1; + if (format->methods.salt != fmt_default_salt && !strcasecmp(&options.listconf[15], "salt")) + ShowIt = 1; + if (format->methods.clear_keys != fmt_default_clear_keys && !strcasecmp(&options.listconf[15], "clear_keys")) + ShowIt = 1; + for (i = 0; i < 6; ++i) { + char Buf[20]; + sprintf(Buf, "get_hash[%d]", i); + if (format->methods.get_hash[i] && format->methods.get_hash[i] != fmt_default_get_hash && !strcasecmp(&options.listconf[15], Buf)) + ShowIt = 1; + } + if (format->methods.get_hash[0] && format->methods.get_hash[0] != fmt_default_get_hash && !strcasecmp(&options.listconf[15], "get_hash")) + ShowIt = 1; + + for (i = 0; i < 6; ++i) { + char Buf[20]; + sprintf(Buf, "binary_hash[%d]", i); + if (format->methods.binary_hash[i] && format->methods.binary_hash[i] != fmt_default_binary_hash && !strcasecmp(&options.listconf[15], Buf)) + ShowIt = 1; + } + if (format->methods.binary_hash[0] && format->methods.binary_hash[0] != fmt_default_binary_hash && !strcasecmp(&options.listconf[15], "binary_hash")) + ShowIt = 1; + if (format->methods.salt_hash != fmt_default_salt_hash && !strcasecmp(&options.listconf[15], "salt_hash")) + ShowIt = 1; + if (format->methods.set_salt != fmt_default_set_salt && !strcasecmp(&options.listconf[15], "set_salt")) + ShowIt = 1; + if (format->methods.get_source != fmt_default_get_source && !strcasecmp(&options.listconf[15], "get_source")) + ShowIt = 1; + } + if (ShowIt) { + int i; + printf("Methods overridden for: %s [%s] %s\n", format->params.label, format->params.algorithm_name, format->params.format_name); + if (format->methods.init != fmt_default_init) + printf("\tinit()\n"); + if (format->methods.prepare != fmt_default_prepare) + printf("\tprepare()\n"); + if (format->methods.valid != fmt_default_valid) + printf("\tvalid()\n"); + if (format->methods.split != fmt_default_split) + printf("\tsplit()\n"); + if (format->methods.binary != fmt_default_binary) + printf("\tbinary()\n"); + if (format->methods.salt != fmt_default_salt) + printf("\tsalt()\n"); + for (i = 0; i < 6; ++i) + if (format->methods.binary_hash[i] != fmt_default_binary_hash) { + if (format->methods.binary_hash[i]) + printf("\t\tbinary_hash[%d]()\n", i); + else + printf("\t\tbinary_hash[%d]() (NULL pointer)\n", i); + } + if (format->methods.salt_hash != fmt_default_salt_hash) + printf("\tsalt_hash()\n"); + if (format->methods.set_salt != fmt_default_set_salt) + printf("\tset_salt()\n"); + // there is no default for set_key() it must be defined. + printf("\tset_key()\n"); + // there is no default for get_key() it must be defined. + printf("\tget_key()\n"); + if (format->methods.clear_keys != fmt_default_clear_keys) + printf("\tclear_keys()\n"); + for (i = 0; i < 6; ++i) + if (format->methods.get_hash[i] != fmt_default_get_hash) { + if (format->methods.get_hash[i]) + printf("\t\tget_hash[%d]()\n", i); + else + printf("\t\tget_hash[%d]() (NULL pointer)\n", i); + } + // there is no default for crypt_all() it must be defined. + printf("\tcrypt_all()\n"); + // there is no default for cmp_all() it must be defined. + printf("\tcmp_all()\n"); + // there is no default for cmp_one() it must be defined. + printf("\tcmp_one()\n"); + // there is no default for cmp_exact() it must be defined. + printf("\tcmp_exact()\n"); + if (format->methods.get_source != fmt_default_get_source) + printf("\tget_source()\n"); + printf("\n\n"); + } + } while ((format = format->next)); + exit(0); + } /* --list last resort: list subsections of any john.conf section name */ if (options.listconf) {