Esempio n. 1
0
def main() -> None:
    try:
        parser = Parser()
        args = parser.parse()
        if args.batch:
            sender = BatchSender(args.batch, args)
            sender.broadcast()
        else:
            run(args)
    except KeyboardInterrupt:
        pass
Esempio n. 2
0
     "Shortcut equivalent to -w [RUN_ALL_BASEWORDS] -t [RUN_ALL_TECHNIQUES] -s -p [RUN_ALL_PERCENTILE] -l [RUN_ALL_FIRST_PATHWELL_MASK, RUN_ALL_LAST_PATHWELL_MASK] -m -u -c -r. See config.py for values used.",
     action='store_true')
 lArgParser.add_argument(
     '-j',
     '--pass-through',
     type=str,
     help=
     "Pass-through the raw parameter to John the Ripper. Example: --pass-through=\"--fork=2\"\n\n",
     action='store')
 lArgParser.add_argument(
     '-v',
     '--verbose',
     help='Enable verbose output such as current progress and duration',
     action='store_true')
 lArgParser.add_argument('-d',
                         '--debug',
                         help='Enable debug mode',
                         action='store_true')
 requiredAguments = lArgParser.add_mutually_exclusive_group(required=True)
 requiredAguments.add_argument('-e',
                               '--examples',
                               help='Show example usage',
                               action='store_true')
 requiredAguments.add_argument(
     '-i',
     '--input-file',
     type=str,
     help='Path to file containing password hashes to attempt to crack',
     action='store')
 run_main_program(pParser=Parser(lArgParser.parse_args(), Config))
Esempio n. 3
0
import cv2
import numpy as np 
from utils import halftoning, plot_histogram
from argparser import Parser

args = Parser()
img_path = args.get_arg('image')
output_filename = args.get_arg('output_path')
error_dist = args.get_arg('error_dist')
sweep_mode = args.get_arg('sweep_mode')
display_mode = args.get_arg('display_mode')

img_path = 'images/peppers.png' if img_path is None else img_path

img = cv2.imread(img_path, cv2.IMREAD_COLOR)
res_img = halftoning(np.array(img), edist_id=error_dist, sweep_mode=sweep_mode)

if output_filename is not None:
    cv2.imwrite(output_filename, res_img)

if display_mode == 'hist':
    plot_histogram(res_img)
elif display_mode is None or display_mode == 'images':
    cv2.imshow('source image', img)
    cv2.imshow('resulting image', res_img)

cv2.waitKey(0)
cv2.destroyAllWindows()
Esempio n. 4
0
import cv2
import numpy as np
import sys
from argparser import Parser
from masks import get_mask
from filter_utils import show_filtered_image, filter_image, add_filters, show_src_and_filtered_image

MASK_COUNT = 11

parser = Parser()
filename = parser.get_arg('image')
mask_id = parser.get_arg('mask')
output_filename = parser.get_arg('output_path')
output_combined_filename = parser.get_arg('output_combined_path')
hflip = parser.get_arg('hflip')
skip_image_show = parser.get_arg('skip_image_show')

img = cv2.imread(filename, cv2.IMREAD_GRAYSCALE)
flip_axis = 1 if hflip else None
(filtered_image, combined_filters_image) = show_filtered_image(
    img,\
    mask_id,\
    flip_axis=flip_axis,\
    show_images=not skip_image_show\
)

if (output_filename):
    cv2.imwrite(output_filename, filtered_image)
if (combined_filters_image is not None and output_combined_filename):
    cv2.imwrite(output_combined_filename, combined_filters_image)