1 #!/usr/bin/env python 2 3 from UEFfile import UEFfile 4 from subprocess import call 5 from os import remove 6 7 def readfile(filename): 8 f = open(filename, "rb") 9 try: 10 return f.read() 11 finally: 12 f.close() 13 14 call(["ophis", "-o", "switcher.bin", "switcher.oph"]) 15 16 uef = UEFfile() 17 uef.import_files(0, [ 18 ("SWITCHER", 0x2000, 0x2000, readfile("switcher.bin")) 19 ]) 20 uef.write("switcher.uef", write_emulator_info=False) 21 22 remove("switcher.bin") 23 24 # vim: tabstop=4 expandtab shiftwidth=4