#!/usr/bin/env python3 import sys import base64 if len(sys.argv) < 4: print("USAGE: mkfirm.py ") sighax_sig=base64.a85decode(b'DZ:iLO%T*f"sal5!m5:QU$Gmm[dg)m,&2*-HJLBEU+9e;EeCligEb]Qpn^2!Gp5_g%-,]IDC-MMahK=@9T\\,0,4&6MDgNaP\'t06CY.qpSb;KMn)+PR1>e0IbaRdgDC5J-m3DLB2d$%DNZn-W7=ADNLl+s&Z2gs%A?=ZJ:91F?66n9DXZ.-lL+5$#ebaKH5IB)Y&DTGd%!,O4me2`$F["\\.$Tr)%\\,h,n.Q]LTQGQRH:#a?1l(T-i_m7b\\7Mg5Ga7LDUacTc`!af0V`"\'-*]I]3%SL)@)ll701ok)i') import struct import hashlib def get_elf_seg(f): #Return entry,section_beg,section_size,section f.seek(0) if f.read(4) != b"\x7FELF": raise Exception("Not an ELF file!") if f.read(1) != b"\x01": raise Exception("ELF64s are not supported!") if f.read(1) != b"\x01": raise Exception("Little Endian ELF required!") if f.read(1) != b"\x01": raise Exception("Unknown ELF version!") f.read(9) if struct.unpack("