all repos — m12-patcher @ 268b79594cfe9d4559134b38a2cbd9686440eaac

Functions.py (view raw)

 1#!/usr/bin/python3
 2from hashlib import md5
 3from tkinter.messagebox import showwarning
 4import Constants
 5
 6def check_rom(filename):
 7    if filename == '':
 8        return False
 9    with open(filename, 'rb') as f:
10        file_hash = md5()
11        while chunk := f.read(8192):
12            file_hash.update(chunk)
13
14    return file_hash.hexdigest() == 'f41e36204356974c94fabf7d144dd32a'
15
16def show_warning(message):
17    showwarning(title=Constants.WARNING_TITLE, message=message)