示例#1
0
def cs():
    global _chipset
    from chipsec.helper.oshelper import helper

    if _chipset is None:
        _chipset = Chipset(helper())
    return _chipset
示例#2
0
def parse_uefi_region_from_file(_uefi, filename, fwtype, outpath=None):

    if outpath is None:
        outpath = os.path.join(helper().getcwd(), filename + ".dir")
    if not os.path.exists(outpath): os.makedirs(outpath)
    rom = read_file(filename)
    traverse_uefi_region(_uefi, rom, fwtype, outpath, True, True)
示例#3
0
def parse_uefi_region_from_file( _uefi, filename, outpath = None):

    if outpath is None:
       outpath = os.path.join( helper().getcwd(), filename + ".dir" )
    if not os.path.exists( outpath ):
       os.makedirs( outpath )

    #uefi_region_path = os.path.join( os.getcwd(), filename + "_UEFI_region" )
    #if not os.path.exists( uefi_region_path ):
    #    os.makedirs( uefi_region_path )

    rom = read_file( filename )
    parse_uefi_region( _uefi, rom, outpath )
示例#4
0
def parse_uefi_region_from_file(_uefi, filename, outpath=None):

    if outpath is None:
        outpath = os.path.join(helper().getcwd(), filename + ".dir")
    if not os.path.exists(outpath):
        os.makedirs(outpath)

    #uefi_region_path = os.path.join( os.getcwd(), filename + "_UEFI_region" )
    #if not os.path.exists( uefi_region_path ):
    #    os.makedirs( uefi_region_path )

    rom = read_file(filename)
    parse_uefi_region(_uefi, rom, outpath)
示例#5
0
def parse_me_region_from_file(filename, outpath=None):
    rom = read_file(filename)

    if outpath is None:
        outpath = os.path.join(helper().getcwd(), filename + ".dir")
    if not os.path.exists(outpath):
        os.makedirs(outpath)

    partitions = parse_me_region(rom)
    if (partitions is None) or (0 == len(partitions)):
        return

    for pk in partitions.keys():
        p = partitions[pk]
        pd = p[0]
        off = p[2]
        if (off > 0):
            write_file(
                os.path.join(outpath, "%08X-%08X-%s.bin" % (off, len(pd), pk)),
                pd)
示例#6
0
def cs():
    global _chipset
    from chipsec.helper.oshelper import helper
    if _chipset is None:
        _chipset = Chipset(helper())
    return _chipset
示例#7
0
 def unload_driver(self):
     oshelper.helper().helper.close()
     subprocess.call(["rmmod", "chipsec"])
示例#8
0
    def get_chipset_id(self):
        return self.id

    def get_chipset_code(self):
        return self.code

    def get_chipset_name(self, id):
        return self.longname

    def print_chipset(self):
        logger().log("Platform: %s\n          VID: %04X\n          DID: %04X" %
                     (self.longname, self.vid, self.did))

    def add_available_module(self, module_name, platform_code):
        chipset_id = CHIPSET_ID_UNKNOWN
        if Chipset_Code.has_key(platform_code):
            chipset_id = Chipset_Dictionary[Chipset_Code[platform_code]]['id']
        elif platform_code == CHIPSET_CODE_COMMON:
            chipset_id = CHIPSET_ID_COMMON
        AVAILABLE_MODULES[chipset_id].append(module_name)
        #print AVAILABLE_MODULES


from chipsec.helper.oshelper import helper
_chipset = Chipset(helper())


def cs():
    return _chipset
示例#9
0
    def get_chipset_id(self):
        return self.id

    def get_chipset_code(self):
        return self.code

    def get_chipset_name(self, id):
        return self.longname

    def print_chipset(self):
        logger().log("Platform: %s\n          VID: %04X\n          DID: %04X" % (self.longname, self.vid, self.did))

    def add_available_module(self, module_name, platform_code):
        chipset_id = CHIPSET_ID_UNKNOWN
        if Chipset_Code.has_key(platform_code):
            chipset_id = Chipset_Dictionary[Chipset_Code[platform_code]]["id"]
        elif platform_code == CHIPSET_CODE_COMMON:
            chipset_id = CHIPSET_ID_COMMON
        AVAILABLE_MODULES[chipset_id].append(module_name)
        # print AVAILABLE_MODULES


from chipsec.helper.oshelper import helper

_chipset = Chipset(helper())


def cs():
    return _chipset
示例#10
0
def parse_uefi_region_from_file( _uefi, filename, fwtype, outpath = None):

    if outpath is None: outpath = os.path.join( helper().getcwd(), filename + ".dir" )
    if not os.path.exists( outpath ): os.makedirs( outpath )
    rom = read_file( filename )
    traverse_uefi_region( _uefi, rom, fwtype, outpath, True, True )
示例#11
0
 def unload_driver(self):
     oshelper.helper().helper.close()
     subprocess.call(["rmmod", "chipsec"])