Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 07 Nov 2011 00:23:20 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: auto-generated format names list

2011-11-06 22:53, Solar Designer wrote:
> Jim, all -
> 
> JFYI, I got this functionality (but not the exact same code and behavior)
> into the main tree:
> 
> http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/john/john/src/options.c.diff?r1=1.23;r2=1.24
> http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/john/john/src/john.c.diff?r1=1.26;r2=1.27
> 
> so we'll need to drop the corresponding changes from -jumbo when
> updating it to the next release (keep the main tree's code instead).

I wrote that. For Jumbo, we need to handle all dynamic (md5-gen) formats
so they just print as one. Something like this:


 static void print_usage(char *name)
 {
        int column;
        struct fmt_main *format;
+       int dynamics = 0;
 
        printf(JOHN_USAGE, name);
 
@@ -111,6 +202,12 @@ static void print_usage(char *name)
        format = fmt_list;
        do {
                char *label = format->params.label;
+               if (!strncmp(label, "dynamic", 7)) {
+                       if (dynamics++)
+                               continue;
+                       else
+                               label = "dynamic_n";
+               }
                int length = strlen(label) + (format->next != NULL);
                column += length;
                if (column > 80) {
@@ -119,6 +216,11 @@ static void print_usage(char *name)
                }
                printf("%s%c", label, format->next ? '/' : '\n');
        } while ((format = format->next));
+
+       printf("%s", JOHN_USAGE_TAIL);
+#ifdef HAVE_DL
+       printf("%s", JOHN_USAGE_PLUGIN);
+#endif
 
        exit(0);
 }


Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ