mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2024-12-15 07:22:33 +00:00
Merge pull request #140 from stasinopoulos/patch-1
IOError exception handling
This commit is contained in:
commit
f2e7bbd5d0
1 changed files with 15 additions and 13 deletions
|
@ -724,20 +724,22 @@ def windows_root():
|
||||||
# core log file routine for SET
|
# core log file routine for SET
|
||||||
#
|
#
|
||||||
def log(error):
|
def log(error):
|
||||||
|
try:
|
||||||
# open log file only if directory is present (may be out of directory for some reason)
|
# open log file only if directory is present (may be out of directory for some reason)
|
||||||
if not os.path.isfile("%s/src/logs/set_logfile.log" % (definepath())):
|
if not os.path.isfile("%s/src/logs/set_logfile.log" % (definepath())):
|
||||||
filewrite = file("%s/src/logs/set_logfile.log" % (definepath()), "w")
|
filewrite = file("%s/src/logs/set_logfile.log" % (definepath()), "w")
|
||||||
filewrite.write("")
|
filewrite.write("")
|
||||||
filewrite.close()
|
filewrite.close()
|
||||||
if os.path.isfile("%s/src/logs/set_logfile.log" % (definepath())):
|
if os.path.isfile("%s/src/logs/set_logfile.log" % (definepath())):
|
||||||
error = str(error)
|
error = str(error)
|
||||||
# open file for writing
|
# open file for writing
|
||||||
filewrite = file("%s/src/logs/set_logfile.log" % (definepath()), "a")
|
filewrite = file("%s/src/logs/set_logfile.log" % (definepath()), "a")
|
||||||
# write error message out
|
# write error message out
|
||||||
filewrite.write("ERROR: " + date_time() + ": " + error + "\n")
|
filewrite.write("ERROR: " + date_time() + ": " + error + "\n")
|
||||||
# close the file
|
# close the file
|
||||||
filewrite.close()
|
filewrite.close()
|
||||||
|
except IOError as err:
|
||||||
|
pass
|
||||||
#
|
#
|
||||||
# upx encoding and modify binary
|
# upx encoding and modify binary
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue