Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def hex_viewer(file_path, chunk_size=16):
- with open(file_path, "rb") as file:
- offset = 0
- while True:
- chunk = file.read(chunk_size)
- if not chunk:
- break
- hex_chunk = ' '.join(format(byte, '02X') for byte in chunk)
- ascii_chunk = ''.join(chr(byte) if 32 <= byte < 127 else '.' for byte in chunk)
- print(f"{offset:08X} | {hex_chunk:<48} | {ascii_chunk}")
- offset += chunk_size
- if __name__ == "__main__":
- rom_path = "rom.smc" #Add your rom to the directory and change filename
- hex_viewer(rom_path)
- """
- Copyright (c) 2023 Zeromega
- Drop a link or a Sub on one of my videos if this script help you, copy the link below
- https://www.youtube.com/channel/UCfqUJ4rmk6W-ZAjDtkBZ1CA?sub_confirmation=1
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement