Skip to content

Commit

Permalink
file write fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SkelSec committed Nov 20, 2022
1 parent 84f2261 commit 5d5102d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pypykatz/lsadecryptor/cmdhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ def process_results(self, results, files_with_error, args):
json.dump(results, f, cls = UniversalEncoder, indent=4, sort_keys=True)

elif args.outfile and args.grep:
with open(args.outfile, 'w', newline = '') as f:
with open(args.outfile, 'w', newline = '', errors='replace') as f:
f.write(':'.join(LogonSession.grep_header) + '\r\n')
for result in results:
for luid in results[result].logon_sessions:
for row in results[result].logon_sessions[luid].to_grep_rows():
f.write(':'.join(row) + '\r\n')

elif args.outfile:
with open(args.outfile, 'w') as f:
with open(args.outfile, 'w', errors='replace') as f:
for result in results:
f.write('FILE: ======== %s =======\n' % result)

Expand Down

0 comments on commit 5d5102d

Please sign in to comment.