/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This program is copyright Alec Muffett 1993. The author disclaims all
* responsibility or liability with respect to it's usage or its effect
* upon hardware or computer systems, and maintains copyright as set out
* in the "LICENCE" document which accompanies distributions of Crack v4.0
* and upwards.
*/
#include "packer.h"
int
{
register int i;
register int j;
if (i > j) {
} else {
return (-1);
}
}
char *
{
register int i;
register int j;
while (*str) {
}
area[j] = '\0';
return (area);
}
char *
{
register char *ptr;
while (*str) {
str++;
}
*ptr = '\0';
return (area);
}
char *
{
register char *ptr;
while (*str) {
str++;
}
*ptr = '\0';
return (area);
}
char *
{
register char *ptr;
while (*str) {
str++;
}
*ptr = '\0';
return (area);
}
char *
{
register int length;
/* bench -> benches */
/* alloy -> alloys */
} else {
/* gully -> gullies */
}
/* bias -> biases */
} else {
/* catchall */
}
return (area);
}
char *
register char new) /* returns pointer to a swapped about copy */
{
register char *ptr;
while (*string) {
string++;
}
*ptr = '\0';
return (area);
}
/* returns pointer to a purged copy */
char *
{
register char *ptr;
while (*string) {
}
string++;
}
*ptr = '\0';
return (area);
}
/* -------- CHARACTER CLASSES START HERE -------- */
/*
* this function takes two inputs, a class identifier and a character, and
* returns non-null if the given character is a member of the class, based
* upon restrictions set out below
*/
int
{
register char c;
register int retval;
retval = 0;
switch (class) {
/* ESCAPE */
case '?': /* ?? -> ? */
if (input == '?') {
retval = 1;
}
break;
/* ILLOGICAL GROUPINGS (ie: not in ctype.h) */
case 'V':
case 'v': /* vowels */
c = CRACK_TOLOWER(input);
if (strchr("aeiou", c)) {
retval = 1;
}
break;
case 'C':
case 'c': /* consonants */
c = CRACK_TOLOWER(input);
if (strchr("bcdfghjklmnpqrstvwxyz", c)) {
retval = 1;
}
break;
case 'W':
case 'w': /* whitespace */
retval = 1;
}
break;
case 'P':
case 'p': /* punctuation */
retval = 1;
}
break;
case 'S':
case 's': /* symbols */
retval = 1;
}
break;
/* LOGICAL GROUPINGS */
case 'L':
case 'l': /* lowercase */
retval = 1;
}
break;
case 'U':
case 'u': /* uppercase */
retval = 1;
}
break;
case 'A':
case 'a': /* alphabetic */
retval = 1;
}
break;
case 'X':
case 'x': /* alphanumeric */
retval = 1;
}
break;
case 'D':
case 'd': /* digits */
retval = 1;
}
break;
}
return (!retval);
}
return (retval);
}
char *
{
while (*string) {
return (string);
}
string++;
}
return ((char *)0);
}
/* returns pointer to a swapped about copy */
char *
{
register char *ptr;
while (*string) {
string++;
}
*ptr = '\0';
return (area);
}
/* returns pointer to a purged copy */
char *
{
register char *ptr;
while (*string) {
}
string++;
}
*ptr = '\0';
return (area);
}
/* -------- BACK TO NORMALITY -------- */
int
{
return (character - '0');
}
return (-1);
}
/* returns a pointer to a controlled Mangle */
char *
{
int limit;
register char *ptr;
area[0] = '\0';
switch (*ptr) {
case RULE_NOOP:
break;
case RULE_REVERSE:
break;
case RULE_UPPERCASE:
break;
case RULE_LOWERCASE:
break;
case RULE_CAPITALISE:
PATH_MAX);
break;
case RULE_PLURALISE:
break;
case RULE_REFLECT:
break;
case RULE_DUPLICATE:
break;
case RULE_GT:
if (!ptr[1]) {
return ((char *)0);
} else {
if (limit < 0) {
return ((char *)0);
}
return ((char *)0);
}
}
break;
case RULE_LT:
if (!ptr[1]) {
return ((char *)0);
} else {
if (limit < 0) {
return ((char *)0);
}
return ((char *)0);
}
}
break;
case RULE_PREPEND:
if (!ptr[1]) {
return ((char *)0);
} else {
PATH_MAX);
}
break;
case RULE_APPEND:
if (!ptr[1]) {
return ((char *)0);
} else {
register char *string;
while (*(string++));
*string = '\0';
}
break;
case RULE_EXTRACT:
return ((char *)0);
} else {
register int i;
int start;
int length;
return ((char *)0);
}
for (i = 0; length-- &&
}
/* cant use strncpy()-no trailing NUL */
area[i] = '\0';
}
break;
case RULE_OVERSTRIKE:
return ((char *)0);
} else {
register int i;
if (i < 0) {
return ((char *)0);
} else {
++ptr;
if (area[i]) {
}
}
}
break;
case RULE_INSERT:
return ((char *)0);
} else {
register int i;
register char *p1;
register char *p2;
if (i < 0) {
return ((char *)0);
}
while (i && *p1) {
i--;
}
}
break;
/* THE FOLLOWING RULES REQUIRE CLASS MATCHING */
case RULE_PURGE: /* @x or @?c */
return ((char *)0);
} else {
ptr += 2;
}
break;
case RULE_SUBSTITUTE: /* sxy || s?cy */
return ((char *)0);
ptr += 2;
} else {
ptr += 3;
}
break;
case RULE_MATCH: /* /x || /?c */
if (!ptr[1] ||
return ((char *)0);
return ((char *)0);
}
} else {
return ((char *)0);
}
ptr += 2;
}
break;
case RULE_NOT: /* !x || !?c */
if (!ptr[1] ||
return ((char *)0);
return ((char *)0);
}
} else {
return ((char *)0);
}
ptr += 2;
}
break;
/*
* alternative use for a boomerang, number 1: a standard throwing
* boomerang is an ideal thing to use to tuck the sheets under
* the mattress when making your bed. The streamlined shape of
* the boomerang allows it to slip easily 'twixt mattress and
* bedframe, and it's curve makes it very easy to hook sheets
* into the gap.
*/
case RULE_EQUALS: /* =nx || =n?c */
return ((char *)0);
} else {
register int i;
return ((char *)0);
}
ptr += 2;
return ((char *)0);
}
} else {
ptr += 3;
if (!MatchClass(*ptr,
area[i])) {
return ((char *)0);
}
}
}
break;
case RULE_DFIRST:
if (area[0]) {
register int i;
for (i = 1; area[i]; i++) {
}
}
break;
case RULE_DLAST:
if (area[0]) {
register int i;
for (i = 1; area[i]; i++);
}
break;
case RULE_MFIRST:
if (!ptr[1] ||
return ((char *)0);
} else {
ptr++;
return ((char *)0);
}
} else {
ptr += 2;
if (!MatchClass(*ptr,
area[0])) {
return ((char *)0);
}
}
}
break;
case RULE_MLAST:
if (!ptr[1] ||
return ((char *)0);
} else {
register int i;
for (i = 0; area[i]; i++);
if (i > 0) {
i--;
} else {
return ((char *)0);
}
ptr++;
return ((char *)0);
}
} else {
ptr += 2;
if (!MatchClass(*ptr,
area[i])) {
return ((char *)0);
}
}
}
break;
}
}
if (!area[0]) { /* have we deweted de poor widdle fing away? */
return ((char *)0);
}
return (area);
}
/*
* int
* PMatch(register char *control, register char *string)
* {
* while (*string && *control) {
* if (!MatchClass(*control, *string)) {
* return (0);
* }
*
* string++;
* control++;
* }
*
* if (*string || *control) {
* return (0);
* }
*
* return (1);
* }
*/