示例#1
0
    def install_thundergate(self, efidrv="efi/dmarf.efi", cpufw="fw/fw.img"):
        start = self.eeprom_hdr.directory[0].nvram_start
        try:
            self.setpxe()
        except:
            pass
        try:
            self.setasf()
        except:
            pass

        data = ""
        with open(cpufw, "rb") as f:
            data = f.read()
        print "[+] installing thundergate bootcode"
        self.install_bc(data)
        bclen = len(data) + 0x204

        with open(efidrv, "rb") as f:
            data = f.read()
        oprom = build_efi_rom(data, self._dev.pci.vid, self._dev.pci.did, compress=1)
        print "[+] installing thundergate oprom"
        start += self.write_dir_image(0, oprom, nv_ofs=bclen)

        dev.reset()
示例#2
0
    def install_thundergate(self, efidrv="efi/dmarf.efi", cpufw="fw/fw.img"):
        start = self.eeprom_hdr.directory[0].nvram_start
        try:
            self.setpxe()
        except:
            pass
        try:
            self.setasf()
        except:
            pass

        data = ''
        with open(cpufw, "rb") as f:
            data = f.read()
        print "[+] installing thundergate bootcode"
        self.install_bc(data)
        bclen = len(data) + 0x204

        with open(efidrv, "rb") as f:
            data = f.read()
        oprom = build_efi_rom(data,
                              self._dev.pci.vid,
                              self._dev.pci.did,
                              compress=1)
        print "[+] installing thundergate oprom"
        start += self.write_dir_image(0, oprom, nv_ofs=bclen)

        dev.reset()
示例#3
0
    def load_efi_drv(self, fname, compress=0):
        data = ''
        with open(fname, "rb") as f:
            data = f.read()

        if len(data) == 0:
            raise Exception("failed to load driver image")

        oprom = build_efi_rom(data, self._dev.pci.vid, self._dev.pci.did, compress=compress)
        self.write_dir_image(0, oprom)

        if not self.getpxe():
            self.setpxe()
示例#4
0
    def install_thundergate(self, efidrv="efi/dmarf.efi", cpufw="fw/fw.img"):
        start = self.eeprom_hdr.directory[0].nvram_start

        data = ''
        with open(efidrv, "rb") as f:
            data = f.read()
        oprom = build_efi_rom(data,
                              self._dev.pci.vid,
                              self._dev.pci.did,
                              compress=1)
        print "[+] installing thundergate oprom"
        start += self.write_dir_image(0, oprom, nv_ofs=start)

        with open(cpufw, "rb") as f:
            data = f.read()
        print "[+] installing thundergate rxcpu firmware"
        self.write_dir_image(1, data, 1, 0x08008000, True, nv_ofs=start)

        if not self.getpxe():
            self.setpxe()
        if not self.getasf():
            self.setasf()