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

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
"""Read-only paired source proof for the actual Activities centre extent."""
from pathlib import Path
import hashlib,importlib.util,json,struct

spec=importlib.util.spec_from_file_location('audit','research/Audit-GalaxyClientCompatibility.py')
audit=importlib.util.module_from_spec(spec);spec.loader.exec_module(audit)
prior=json.loads(Path('artifacts/galaxy-query-research/power-outer-sources/compatibility.json').read_text())
old=audit.Image(Path(prior['oldImage']['path']));new=audit.Image(Path(prior['newImage']['path']))
for image,prefix in [(old,'old'),(new,'new')]:
    if hashlib.sha256(image.raw).hexdigest()!=prior[prefix+'Image']['sha256']:raise ValueError('Original extent image changed')
functions=[];references=[]
for before in [0x3AF6C40,0x1418810]:
    row=next(row for row in prior['functions'] if row['oldRva']==hex(before));after=int(row['newRva'],16)
    bounds=old.function(before);length=bounds[1]-before
    raw,mask,*_=audit.signature(old,before,length);actual=new.data(after,length)
    if len(raw)!=length or any(a!=b for a,b,keep in zip(raw,actual,mask) if keep):raise ValueError('Original extent complete body changed')
    functions.append(dict(oldRva=hex(before),newRva=hex(after),length=length,status='unique',basis='previously unique bounded complete function',oldSha256=hashlib.sha256(raw).hexdigest(),newSha256=hashlib.sha256(actual).hexdigest()))
    references.extend(audit.references(old,new,before,after,length))
slots=[]
for slot,expected,length in [(0x50,0x1411FD0,24),(0x148,0x1415D30,24),(0x150,0x1414100,None)]:
    before=struct.unpack('<Q',old.data(0x51BB640+slot,8))[0]-old.base
    after=struct.unpack('<Q',new.data(0x51BB600+slot,8))[0]-new.base
    if before!=expected:raise ValueError('Actual extent service typed slot changed')
    if length is None:
        bounds=old.function(before);length=bounds[1]-before
    raw,mask,*_=audit.signature(old,before,length);actual=new.data(after,len(raw))
    if any(a!=b for a,b,keep in zip(raw,actual,mask) if keep):raise ValueError('Original extent service getter changed')
    if slot==0x150:
        functions.append(dict(oldRva=hex(before),newRva=hex(after),length=length,status='unique',basis='actual paired typed slot, full unwind body'))
        references.extend(audit.references(old,new,before,after,length))
    slots.append(dict(oldVtable='0x51BB640',newVtable='0x51BB600',slot=hex(slot),oldRva=hex(before),newRva=hex(after),bytes=len(raw),
        scope='valid-index definition prefix only; count/index checked before read' if slot==0x50 else 'actual ready/metadata getter binding; getter is not invoked'))
path=Path('artifacts/galaxy-query-research/power-outer-extent/compatibility.json');path.parent.mkdir(parents=True,exist_ok=True)
result=dict(runtimeNeutral=True,canInstallHooks=False,runtimeValidated=False,gameCalls=0,oldImageSha256=hashlib.sha256(old.raw).hexdigest(),newImageSha256=hashlib.sha256(new.raw).hexdigest(),
    functions=functions,slots=slots,vtables={},globals={},references=[list(map(hex,row)) for row in references],
    interpretation=dict(centre='same original cached centre address as PowerOuter',ready='existing original Power source ready gates',
        stateZero='extent=0',knownState='actual ownerIndex definition+1A0+rawState*16+8',missingMetadata='unknown in tool',
        getter150='writes original last-key cache; tool uses the proven read-only hash traversal',notPredicateRadius=True),
    geometry=dict(consumer='3B33690 ->3B064F0 -> callback551F838+8/3A1E730 ->64B FocusBillboard',
        material='viewport+38, config+100, FocusBillboard/GalaxyMapFocusBillboard',
        draw='5538210+20/3C16230 ->51BE30(type5,count2) ->4 vertices/TriangleStrip',
        allocation='2.222222328186035*extent*distance/sqrt(distance^2-extent^2)',onlyWhen='eyeDistance>extent>0'))
path.write_text(json.dumps(result,indent=2)+'\n');print(json.dumps(dict(path=str(path),functions=len(functions),slots=len(slots),gameAccess=False)))