7 def create_output(args
):
8 in_st
= os
.stat(args
.input_file
)
9 in_size
= in_st
.st_size
11 in_f
= open(args
.input_file
, 'r+b')
12 in_bytes
= in_f
.read(in_size
)
15 sha256
= hashlib
.sha256()
16 sha256
.update(in_bytes
)
18 out_f
= open(args
.output_file
, 'w+b')
19 out_f
.write(bytes
.fromhex(args
.pid
))
20 out_f
.write(sha256
.digest())
27 parser
= argparse
.ArgumentParser(description
='')
29 parser
.add_argument('--input-file',
35 parser
.add_argument('--output-file',
41 parser
.add_argument('--pid',
47 args
= parser
.parse_args()
49 if ((not args
.input_file
) or
50 (not args
.output_file
) or