Skip to content

Commit

Permalink
Add prints for bulk scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebFenton committed Jan 14, 2017
1 parent 7e4d087 commit fd9c208
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apkid/apkid.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ def scan_singly(input, timeout, output_dir):
rules = get_rules()
for file_type, file_path in collect_files(input):
results = {}
filename = os.path.basename(file_path)
out_file = os.path.join(output_dir, filename)
if os.path.exists(out_file):
continue
print("Processing: {}".format(file_path))
try:
match_dict = do_yara(file_path, rules, timeout)
if len(match_dict) > 0:
Expand All @@ -203,9 +208,8 @@ def scan_singly(input, timeout, output_dir):
if len(results) > 0:
if not os.path.exists(output_dir):
os.makedirs(output_dir)
filename = os.path.basename(file_path)
with open(os.path.join(output_dir, filename), 'w') as f:
with open(out_file, 'w') as f:
f.write(json.dumps(results))
print("Finished {}".format(file_path))
print("Finished: {}".format(file_path))
except yara.Error as e:
logging.error("error scanning: {}".format(e))

0 comments on commit fd9c208

Please sign in to comment.