mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-12 17:18:30 +02:00
First draft
This commit is contained in:
parent
47f70cc820
commit
316d3eea08
1 changed files with 13 additions and 8 deletions
|
@ -52,9 +52,9 @@ parser_hide.add_argument("-e", "--encoding", dest="encoding",
|
||||||
|
|
||||||
# Generator
|
# Generator
|
||||||
parser_hide.add_argument("-g", "--generator", dest="generator_function",
|
parser_hide.add_argument("-g", "--generator", dest="generator_function",
|
||||||
choices=[generator[0] for generator in \
|
# choices=[generator[0] for generator in \
|
||||||
inspect.getmembers(generators, inspect.isfunction)],
|
# inspect.getmembers(generators, inspect.isfunction)],
|
||||||
required=True, help="Generator")
|
nargs='*', required=True, help="Generator")
|
||||||
parser_hide.add_argument("-s", "--shift", dest="shift",
|
parser_hide.add_argument("-s", "--shift", dest="shift",
|
||||||
default=0, help="Shift for the generator")
|
default=0, help="Shift for the generator")
|
||||||
|
|
||||||
|
@ -80,9 +80,9 @@ parser_reveal.add_argument("-e", "--encoding", dest="encoding",
|
||||||
help="Specify the encoding of the message to reveal." +
|
help="Specify the encoding of the message to reveal." +
|
||||||
" UTF-8 (default) or UTF-32LE.")
|
" UTF-8 (default) or UTF-32LE.")
|
||||||
parser_reveal.add_argument("-g", "--generator", dest="generator_function",
|
parser_reveal.add_argument("-g", "--generator", dest="generator_function",
|
||||||
choices=[generator[0] for generator in \
|
# choices=[generator[0] for generator in \
|
||||||
inspect.getmembers(generators, inspect.isfunction)],
|
# inspect.getmembers(generators, inspect.isfunction)],
|
||||||
required=True, help="Generator")
|
nargs='*', required=True, help="Generator")
|
||||||
parser_reveal.add_argument("-s", "--shift", dest="shift",
|
parser_reveal.add_argument("-s", "--shift", dest="shift",
|
||||||
default=0, help="Shift for the generator")
|
default=0, help="Shift for the generator")
|
||||||
parser_reveal.add_argument("-o", dest="secret_binary",
|
parser_reveal.add_argument("-o", dest="secret_binary",
|
||||||
|
@ -97,14 +97,19 @@ arguments = parser.parse_args()
|
||||||
|
|
||||||
if arguments.command != 'list-generators':
|
if arguments.command != 'list-generators':
|
||||||
try:
|
try:
|
||||||
arguments.generator_function
|
arguments.generator_function[0]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print('You must specify the name of a generator.')
|
print('You must specify the name of a generator.')
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
generator = getattr(generators, arguments.generator_function)()
|
if (len(arguments.generator_function) > 1):
|
||||||
|
generator = getattr(generators, arguments.generator_function[0])\
|
||||||
|
(*[int(e) for e in arguments.generator_function[1:]])
|
||||||
|
else:
|
||||||
|
generator = getattr(generators, arguments.generator_function[0])()
|
||||||
|
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
print("Unknown generator: {}".format(arguments.generator_function))
|
print("Unknown generator: {}".format(arguments.generator_function))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue