#!/home/geodd/.local/opt/rea-python/bin/python """Original engine-info instructions in isolated Unicorn with initialized fixture tables.""" import hashlib,json,struct,warnings from pathlib import Path warnings.filterwarnings('ignore',category=UserWarning,module='unicorn') from elftools.elf.elffile import ELFFile from unicorn import Uc,UC_ARCH_X86,UC_MODE_64,UC_HOOK_CODE from unicorn.x86_const import * R=Path(__file__).resolve().parents[1];P=Path('/home/geodd/nvidia-driver/analysis-580.178.04/extracted/kernel/nvidia/nv-kernel.o_binary') TEXT=0x10000000;RO=0x20000000;DATA=0x30000000;STACK=0x40000000;STUB=0x50000000;STOP=0x60000000 names=['_nv040255rm','_nv040256rm','_nv040300rm','_nv040329rm','_nv027812rm','_nv028098rm','_nv031279rm','_nv031280rm','_nv027765rm'];hooks={};max_subcontexts=8 with P.open('rb') as f: e=ELFFile(f);symbols=list(e.get_section_by_name('.symtab').iter_symbols());defined={s.name:s for s in symbols};text=bytearray(e.get_section_by_name('.text').data());ro=e.get_section_by_name('.rodata').data();ti=e.get_section_index('.text');ri=e.get_section_index('.rodata');functions={n:(defined[n]['st_value'],defined[n]['st_size']) for n in names};undef={} for r in e.get_section_by_name('.rela.text').iter_relocations(): off=r['r_offset'] if not any(a<=off