import subprocess,lzma import struct,os from npk import NovaPackage,NpkPartID,NpkFileContainer def patch_bzimage(data:bytes,key_dict:dict): PE_TEXT_SECTION_OFFSET = 414 HEADER_PAYLOAD_OFFSET = 584 HEADER_PAYLOAD_LENGTH_OFFSET = HEADER_PAYLOAD_OFFSET + 4 text_section_raw_data = struct.unpack_from('