new version of 88MZ100 7.4" tag firmware + patch_mac.py for easy mac change

No need for HxD anymore for this firmware. See https://github.com/jjwbruijn/OpenEPaperLink/wiki/88MZ100-Programming-and-interfacing
This commit is contained in:
Nic Limper
2023-08-31 02:44:34 +02:00
parent ab83cb03cc
commit e45693bfe0
2 changed files with 25 additions and 0 deletions

25
Tag_Flasher/patch_mac.py Normal file
View File

@@ -0,0 +1,25 @@
import argparse
def patch_mac(file_path, mac):
try:
with open(file_path, "r+b") as file:
offset = 0x0148
mac_bytes = bytearray.fromhex(mac)
mac_bytes.reverse() # Reverse the byte order
file.seek(offset)
file.write(mac_bytes)
print(f"MAC address patched successfully.")
except FileNotFoundError:
print("Error: File not found.")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Patch MAC address in a binary firmware file for the 88MZ100 7.4 inch esl")
parser.add_argument("-mac", required=True, help="MAC address (without colons)")
parser.add_argument("filename", help="Binary file to patch")
args = parser.parse_args()
patch_mac(args.filename, args.mac)