I am currently making a python hexdump program that writes the hex values of a disk image into a new text file. But for some reason the textfile created is always just full of white space. I dont think the text file is actually "empty" since its size is around 500+MB
I'd just like to know what I might be doing wrong and how I should fix it
Here is my code so far:
#!/usr/bin/python
from binascii import hexlify
filename = "diskimage.img"
hexstring = ""
with open(filename,'rb') as readfile:
txtfile = open("output.txt", 'wb')
for part in iter(lambda: readfile.read(1024), ''):
append = part.encode('hex')
txtfile.write(append)
txtfile.close()