XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
"""Pin original grid geometry/constants; no game process or generated stellar data."""
from pathlib import Path
import hashlib,json,struct
import pefile

image=Path('artifacts/ship-model-reference/client-copy/EliteDangerous64.exe').read_bytes()
if hashlib.sha256(image).hexdigest()!='6891f70a021fa9f3a0e00458c284f48d1226e68ae7fc02ad48081aed47857e93':
    raise ValueError('Pinned client changed')
pe=pefile.PE(data=image,fast_load=True)
values={0x515d500:6000,0x515d570:600,0x515d4a0:60,0x512a838:1000,0x5110c38:100,0x511aa7c:10,
        0x4de1678:5,0x4dec67c:100,0x4de1680:10,0x4e340fc:1000,0x4e3204c:10000,0x5529c18:-49,0x4de1690:50}
constants=[]
for rva,expected in values.items():
    raw=pe.get_data(rva,4);value=struct.unpack('<f',raw)[0]
    if value!=expected:raise ValueError('Original grid constant changed: '+hex(rva))
    constants.append(dict(rva=hex(rva),raw=raw.hex(),value=value))
if struct.unpack('<4I',pe.get_data(0x4e32830,16))!=(0xffffffff,0,0xffffffff,0) or struct.unpack('<4I',pe.get_data(0x4e327d0,16))!=(0,0xffffffff,0,0):
    raise ValueError('Original grid snap masks changed')
scope={}
exec(Path('research/Extract-OriginalGalaxyAppearance.py').read_text().split('tables={}')[0],scope)
configuration=(295,14000);style=scope['references'][(295,14000+0x1a0)];raw=scope['b'][scope['at'](style):scope['at'](style)+48]
rgba=struct.unpack_from('<4f',raw,4);base_width=struct.unpack_from('<f',raw,24)[0]
if rgba!=struct.unpack('<4f',struct.pack('<4f',.3,.9,.9,.15)) or base_width!=struct.unpack('<f',struct.pack('<f',.02))[0]:
    raise ValueError('Original grid style changed')
out=Path('artifacts/galaxy-query-research/power-outer-sources/original-grid.json')
result=dict(gameProcessAccess=False,gameCalls=0,imageSha256=hashlib.sha256(image).hexdigest(),generatorRva='0x3a1ede0',
    distanceGetter=dict(vtable='0x552b8e0',slot='0x50',function='0x1a404d0',meaning='actual orbit distance ly'),
    focusGetter=dict(slot='0x48',function='0xf847c0',meaning='actual focus ly'),constants=constants,
    configuration=dict(pool=295,offset=14000,styleField='0x1a0',stylePointer=style,raw=raw.hex(),rgba=rgba,baseWidth=base_width),
    geometry=dict(lines=198,indices='-49..49 on each axis',halfExtent='50*step',snap='XZ floor(relative/step+.5)*step; preserve actual focusY'),
    unclosed=['Original StarMapLine material/texture/fade','original world-width rasterization; current shared line path is one pixel'])
out.write_text(json.dumps(result,indent=2)+'\n');print(out)