"Fossies" - the Fresh Open Source Software Archive

Member "john-1.9.0/src/rules.h" (13 May 2013, 1760 Bytes) of package /linux/privat/john-1.9.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "rules.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.8.0_vs_1.9.0.

    1 /*
    2  * This file is part of John the Ripper password cracker,
    3  * Copyright (c) 1996-98,2009 by Solar Designer
    4  */
    5 
    6 /*
    7  * Rules support routines.
    8  */
    9 
   10 #ifndef _JOHN_RULES_H
   11 #define _JOHN_RULES_H
   12 
   13 #include "loader.h"
   14 #include "rpp.h"
   15 
   16 /*
   17  * Initializes the rules support.
   18  */
   19 extern void rules_init(int max_length);
   20 
   21 /*
   22  * Processes rule reject flags, based on information from the database.
   23  * Returns a pointer to the first command in the rule if it's accepted,
   24  * or NULL if rejected or an error occurred. Also sets rules_errno on
   25  * error. If the database is NULL, almost all rules are accepted (to be
   26  * used for syntax checking).
   27  *
   28  * split == 0   "single crack" mode rules allowed
   29  * split < 0    "single crack" mode rules are invalid
   30  *
   31  * last may specify which internal buffer must not be touched.
   32  */
   33 extern char *rules_reject(char *rule, int split, char *last,
   34     struct db_main *db);
   35 
   36 /*
   37  * Applies rule to a word. Returns the updated word, or NULL if rejected or
   38  * an error occurred. Also sets rules_errno on error.
   39  *
   40  * split > 0    "single crack" mode, split is the second word's position
   41  * split == 0   "single crack" mode, only one word
   42  * split < 0    other cracking modes, "single crack" mode rules are invalid
   43  *
   44  * If last is non-NULL, it should be the previous mangled word and it is
   45  * assumed to be properly aligned for ARCH_WORD accesses (pointers returned by
   46  * rules_apply() are properly aligned).  If the new mangled word matches the
   47  * previous one, it will be rejected (rules_apply() will return NULL).
   48  */
   49 extern char *rules_apply(char *word, char *rule, int split, char *last);
   50 
   51 /*
   52  * Similar to rules_check(), but displays a message and does not return on
   53  * error.
   54  */
   55 extern int rules_count(struct rpp_context *start, int split);
   56 
   57 #endif