mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-25 07:06:52 +01:00
22 lines
484 B
Python
22 lines
484 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sys
|
||
|
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
if (len(sys.argv) != 3):
|
||
|
print(f'Usage: python {sys.argv[0]} in_file out_file')
|
||
|
sys.exit(1)
|
||
|
|
||
|
with open(sys.argv[1], 'rb') as f:
|
||
|
output = ''
|
||
|
while True:
|
||
|
file_bytes = f.read(4)
|
||
|
if len(file_bytes) != 4:
|
||
|
break
|
||
|
output += f"{int.from_bytes(file_bytes, 'little'):08X}\n"
|
||
|
|
||
|
with open(sys.argv[2], 'w') as f:
|
||
|
f.write(output)
|