all repos — m12-patcher @ 95fbc6f39894be2461591d9423a3260fbec726b2

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    with open(filename, 'rb') as f:
 8        file_hash = md5()
 9        while chunk := f.read(8192):
10            file_hash.update(chunk)
11
12    return file_hash.hexdigest() == 'f41e36204356974c94fabf7d144dd32a'
13
14def show_warning(message):
15    showwarning(title=Constants.WARNING_TITLE, message=message)