Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4DC59680.1010800@bredband.net>
Date: Sat, 07 May 2011 20:59:12 +0200
From: magnum <rawsmooth@...dband.net>
To: john-dev@...ts.openwall.com
Subject: Re: Plumbing changes   [moved from john-users]

On 2011-05-07 20:14, jfoug wrote:
> I wonder if this could be done:
>
> Add some code in Makefile (or build a script that is run by a rule in
> Makefile), using grep and sed or awk to pull the names of the format
> structures, and possibly even the names of the format 'signatures', out of
> the *_fmt.c files ?   In this way, there would be few, or no format
> structures in john.c (or the options.c), and would be a .h file 'built' by
> the maker, similar to how arch.h is made (but MUCH more complex than a
> simple cp command).

That's a cool idea. Just drop a new format file named *_fmt.c in the src 
directory and rebuild. It doesn't even sound too hard to accomplish.

For Makefile, listing object files is easy:
$ ls -1 *_fmt.c | sed 's/\.c$/.o/'
AFS_fmt.o
BFEgg_fmt.o
BF_fmt.o
BSDI_fmt.o
c3_fmt.o
DES_fmt.o
DMD5_fmt.o
DOMINOSEC_fmt.o
EPI_fmt.o
HDAA_fmt.o
...

For the "extern struct fmt_main" and "john_register_one()", this rough 
example line catches all 51 formats I had there:
$ grep struct *_fmt.c|grep =|grep fmt_main|grep -v pFmt|awk '{print $3}'
fmt_AFS
fmt_BFEgg
fmt_BF
fmt_BSDI
fmt_crypt
fmt_DES
fmt_DMD5
fmt_DOMINOSEC
fmt_EPI
fmt_HDAA
...


magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.