Skip to content

Commit

Permalink
Fix: Handle default prompt when stdout is redirected (mandiant#938)
Browse files Browse the repository at this point in the history
* when stdout is redirected, use default prompt values
  • Loading branch information
Arker123 authored and c-urly committed Mar 14, 2024
1 parent 8d1ba2d commit 68bf62e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion floss/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,11 @@ def main(argv=None) -> int:

if results.metadata.language not in ("", "unknown"):
if args.enabled_types == [] and args.disabled_types == []:
prompt = input("Do you want to enable string deobfuscation? (this could take a long time) [y/N] ")
# when stdout is redirected, such as in 'floss foo.exe | less' use default prompt values
if sys.stdout.isatty():
prompt = input("Do you want to enable string deobfuscation? (this could take a long time) [y/N] ")
else:
prompt = "n"

if prompt.lower() == "y":
logger.info("enabled string deobfuscation")
Expand Down

0 comments on commit 68bf62e

Please sign in to comment.