import functools; # --- printers for stuff and yeah --- class EfiGuidPrinter(gdb.ValuePrinter): "Print an EfiGuid" def __init__(self, val): self.__val = val; def to_string(self): # it's really disappointing that you cant iterate these silly arrays d4 = self.__val["data4"]; last = functools.reduce(lambda s, bit: f'{s}{int(bit):0>2X}', [d4[0], d4[1], d4[2], d4[3], d4[4], d4[5], d4[6], d4[7]], ""); return f'{int(self.__val["data1"]):0>8X}-{int(self.__val["data2"]):0>4X}-{int(self.__val["data3"]):0>4X}-{last}'; def add_pretty_printer(name, printer, custom_lookup = None): def lookup(val): if val.type.tag == name: return printer(val); return None; gdb.current_objfile().pretty_printers.append(lookup if custom_lookup is None else custom_lookup); return; add_pretty_printer("_EfiGuid", EfiGuidPrinter, lambda val: EfiGuidPrinter(val) if val.type.strip_typedefs().tag == "_EfiGuid" else None); # --- code --- # def transition_cckernel():