#!/usr/bin/env python3 """Recover bounded selected original ACR packed bundle storage, CPU-only. Payloads are artifact evidence, not authenticated/ready firmware objects. """ from pathlib import Path import struct,json,hashlib,zlib from elftools.elf.elffile import ELFFile R=Path(__file__).resolve().parents[1];P=Path('/home/geodd/nvidia-driver/analysis-580.178.04/extracted/kernel/nvidia/nv-kernel.o_binary');OUT=R/'analysis/sec2-580';OUT.mkdir(parents=True,exist_ok=True) with P.open('rb')as f: e=ELFFile(f);ss=list(e.get_section_by_name('.symtab').iter_symbols());bases={e.get_section_index('.rodata'):0x0111d660,e.get_section_index('.data'):0x00f7e890,e.get_section_index('.bss'):0x05fd2180,e.get_section_index('.text'):0x0616f810};raw={i:e.get_section(i).data()for i in bases if e.get_section(i).name!='.bss'};rel={} for i in raw: section=e.get_section_by_name('.rela'+e.get_section(i).name) if section: for x in section.iter_relocations():rel[(i,x['r_offset'])]=x def where(address): for i,b in bases.items(): if i in raw and b<=address0:objects.setdefault(bases[s['st_shndx']]+s['st_value'],[]).append((s.name,s['st_size'])) records=[] for bundle in [0x011401d8]: count=int.from_bytes(data(bundle,4),'little');assert count<128 for index in range(count): tag=int.from_bytes(data(bundle+8+index*16,4),'little');address=ptr(bundle+16+index*16) header=data(address,24);size,unknown,_,flags,_=struct.unpack('