27 lines
513 B
Python
27 lines
513 B
Python
from collections import Counter
|
|
|
|
|
|
HEADER = bytes.fromhex("4769495E417C4370")
|
|
|
|
|
|
idx = []
|
|
|
|
with open("./digital-0.bin", "rb") as f:
|
|
data = f.read()
|
|
four_bytes = [data[i:i+4] for i in range(0, len(data), 4)]
|
|
eight_bytes = [data[i:i+8] for i in range(0, len(data), 8)]
|
|
|
|
counts_four = Counter(four_bytes)
|
|
counts_eight = Counter(eight_bytes)
|
|
|
|
print(counts_four)
|
|
print(counts_eight)
|
|
|
|
for i in range(len(idx)):
|
|
if i > 0:
|
|
print(idx[i] - idx[i-1])
|
|
else:
|
|
print(idx[i] )
|
|
|
|
|