PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import struct
import binascii
file = open("hh.txt", "w")
file.write("This has been written to a file")
file.close()
file=open("hh.txt","rb")
print(binascii.b2a_hex(struct.unpack('31s',file.read(31))[0]))
file.close()
file = open("hh.txt", "w")
file.write("This has been written to a file")
file.close()
file = open("hh.txt","rb")
data = file.read(31)
print(['01x%x' % x for x in data])
file.close()
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run