bintoByte.py

f = open('/users/user/Downloads/gsx64.bin', 'rb')
ba = bytearray(f.read())
s = ''
i = 0
for byte in ba:
	i = i + 1
	x = (r'\x%02x' % byte)
	s = s + x
	if i == 9:
		s = s +'"\n"'
		i = 0
print(s)

Last updated

Was this helpful?