Hook the byte and text validators for the supported game build while retaining original validation for unknown paths and non-project records. Pin executable and UE4SS hashes, provide an MIT-licensed source package, and verify native adapters, supported prologues, import symbols and unsupported-build refusal. In-game startup and gameplay verification remain pending.
26 lines
998 B
Python
26 lines
998 B
Python
import argparse
|
|
from pathlib import Path
|
|
import struct
|
|
import sys
|
|
sys.path.insert(0, str(Path(__file__).parent / 'python'))
|
|
import pefile
|
|
from capstone import Cs, CS_ARCH_X86, CS_MODE_64
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('image', type=Path)
|
|
parser.add_argument('rvas', nargs='+', type=lambda v: int(v, 0))
|
|
args = parser.parse_args()
|
|
pe = pefile.PE(str(args.image), fast_load=True)
|
|
directory = pe.OPTIONAL_HEADER.DATA_DIRECTORY[3]
|
|
entries = list(struct.iter_unpack('<III', pe.get_data(directory.VirtualAddress, directory.Size)))
|
|
md = Cs(CS_ARCH_X86, CS_MODE_64)
|
|
base = pe.OPTIONAL_HEADER.ImageBase
|
|
for rva in args.rvas:
|
|
found = next(((s,e) for s,e,u in entries if s <= rva < e), None)
|
|
if not found:
|
|
raise ValueError(hex(rva))
|
|
start, end = found
|
|
print(f'\nFUNCTION RVA=0x{start:x}..0x{end:x}')
|
|
for ins in md.disasm(pe.get_data(start,end-start),base+start):
|
|
print(f'{ins.address-base:08x} {ins.bytes.hex():24} {ins.mnemonic:8} {ins.op_str}')
|