mirror of
https://github.com/cedricbonhomme/Stegano.git
synced 2025-05-13 09:28:31 +02:00
Add an exception when the reveal function is called with the bad generator.
This commit is contained in:
parent
94e3112189
commit
96749a168e
1 changed files with 6 additions and 3 deletions
|
@ -101,9 +101,8 @@ def reveal(input_image_file, generator_function):
|
|||
if bitab[-1] == ":" and limit == None:
|
||||
try:
|
||||
limit = int("".join(bitab[:-1]))
|
||||
print limit
|
||||
except:
|
||||
print bitab
|
||||
pass
|
||||
if len(bitab)-len(str(limit))-1 == limit :
|
||||
return "".join(bitab)[len(str(limit))+1:]
|
||||
|
||||
|
@ -171,7 +170,11 @@ if __name__ == '__main__':
|
|||
print e
|
||||
|
||||
elif options.reveal:
|
||||
secret = reveal(options.input_image_file, options.generator_function)
|
||||
try:
|
||||
secret = reveal(options.input_image_file, options.generator_function)
|
||||
except IndexError:
|
||||
print "Impossible to detect message."
|
||||
exit(0)
|
||||
if options.secret_binary != "":
|
||||
data = tools.base642binary(secret)
|
||||
with open(options.secret_binary, "w") as f:
|
||||
|
|
Loading…
Add table
Reference in a new issue