示例#1
0
def dump_raw():
    try:
        mp = MPTable()
        s = "MP Table -- Raw bytes and structure decode.\n\n"
        if mp:
            s += str(mp.floating_pointer) + '\n'
            s += bits.dumpmem(mp._floating_pointer_memory) + '\n'

            s += str(mp.header) + '\n'
            s += bits.dumpmem(mp._base_header_memory) + '\n'

            for base_struct in mp.base_structures:
                s += str(base_struct) + '\n'
                s += bits.dumpmem(base_struct.raw_data) + '\n'

            if mp.header.extended_table_length:
                for extended_struct in mp.extended_structures:
                    s += str(extended_struct) + '\n'
                    s += bits.dumpmem(extended_struct.raw_data)  + '\n'
        else:
            s += "MP Table not found.\n"
        ttypager.ttypager_wrap(s, indent=False)
    except:
        print("Error parsing MP Table information:")
        import traceback
        traceback.print_exc()
示例#2
0
def dump_raw():
    try:
        mp = MPTable()
        s = "MP Table -- Raw bytes and structure decode.\n\n"
        if mp:
            s += str(mp.floating_pointer) + '\n'
            s += bits.dumpmem(mp._floating_pointer_memory) + '\n'

            s += str(mp.header) + '\n'
            s += bits.dumpmem(mp._base_header_memory) + '\n'

            for base_struct in mp.base_structures:
                s += str(base_struct) + '\n'
                s += bits.dumpmem(base_struct.raw_data) + '\n'

            if mp.header.extended_table_length:
                for extended_struct in mp.extended_structures:
                    s += str(extended_struct) + '\n'
                    s += bits.dumpmem(extended_struct.raw_data) + '\n'
        else:
            s += "MP Table not found.\n"
        ttypager.ttypager_wrap(s, indent=False)
    except:
        print("Error parsing MP Table information:")
        import traceback
        traceback.print_exc()
示例#3
0
文件: smbios.py 项目: kirkboy/bits
def dump_raw():
    try:
        sm = SMBIOS()
        if sm:
            s = "SMBIOS -- Raw bytes and structure decode.\n\n"

            s += str(sm.header) + '\n'
            s += bits.dumpmem(sm._header_memory) + '\n'

            s += "Raw bytes for the SMBIOS structures\n"
            s += bits.dumpmem(sm._structure_memory) + '\n'

            for sm_struct in sm.structures:
                s += str(sm_struct) + '\n'
                s += bits.dumpmem(sm_struct.raw_data)

                s += "Strings:\n"
                for n in range(1, len(getattr(sm_struct, "strings", [])) + 1):
                    s += str(sm_struct.fmtstr(n)) + '\n'
                s += bits.dumpmem(sm_struct.raw_strings) + '\n'
        else:
            s = "No SMBIOS structures found"
        ttypager.ttypager_wrap(s, indent=False)
    except:
        print "Error parsing SMBIOS information:"
        import traceback
        traceback.print_exc()
示例#4
0
文件: efi.py 项目: kirkboy/bits
def print_variables():
    name = ctypes.create_unicode_buffer("")
    size = ctypes.c_ulong(ctypes.sizeof(name))
    guid = GUID()
    while True:
        status = call(system_table.RuntimeServices.contents.GetNextVariableName, ctypes.addressof(size), ctypes.addressof(name), ctypes.addressof(guid))
        if status == EFI_NOT_FOUND:
            break
        if status == EFI_BUFFER_TOO_SMALL:
            ctypes.resize(name, size.value)
            continue
        check_status(status)
        print name.value, guid
        data, attributes, data_size = get_variable(name, guid)
        print "attributes={:#x} size={} data:".format(attributes, data_size)
        print bits.dumpmem(data.raw)
示例#5
0
def dump_raw():
    try:
        pir = PIRTable()
        s = "PCI Interrupt Routing (PIR) Table -- Raw bytes and structure decode.\n\n"
        if pir:
            s += str(pir.header) + '\n'
            s += bits.dumpmem(bits.cdata.to_bytes(pir.header)) + '\n'

            for slot_entry in pir.structures:
                s += str(slot_entry) + '\n'
                s += bits.dumpmem(bits.cdata.to_bytes(slot_entry)) + '\n'
        else:
            s += "PCI Interrupt Routing (PIR) Table not found.\n"
        ttypager.ttypager_wrap(s, indent=False)
    except:
        print("Error parsing PCI Interrupt Routing Table information:")
        import traceback
        traceback.print_exc()
示例#6
0
文件: pirtable.py 项目: kirkboy/bits
def dump_raw():
    try:
        pir = PIRTable()
        s = "PCI Interrupt Routing (PIR) Table -- Raw bytes and structure decode.\n\n"
        if pir:
            s += str(pir.header) + '\n'
            s += bits.dumpmem(pir._header_memory) + '\n'

            for slot_entry in pir.structures:
                s += str(slot_entry) + '\n'
                s += bits.dumpmem(slot_entry.raw_data) + '\n'
        else:
            s += "PCI Interrupt Routing (PIR) Table not found.\n"
        ttypager.ttypager_wrap(s, indent=False)
    except:
        print "Error parsing PCI Interrupt Routing Table information:"
        import traceback
        traceback.print_exc()