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

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
"""Bounded trace of our own plugin entry; no game entry is re-hooked and no flight commands are sent."""
import argparse,hashlib,json,time
from pathlib import Path
import frida
p=argparse.ArgumentParser(description=__doc__)
p.add_argument('--pid',type=int,required=True);p.add_argument('--output',type=Path,required=True)
a=p.parse_args()
installed=Path(r'D:/SteamLibrary/steamapps/common/Elite Dangerous/Products/elite-dangerous-odyssey-64/dinput8.dll')
expected='7de0facbad128cc11ce9fd9fdc71958863319bb4a5f85013ecd6a17b25c09ee8'
if hashlib.sha256(installed.read_bytes()).hexdigest()!=expected:raise ValueError('Expected the exact preserved 0.3.0 plugin')
source=r'''
const plugin=Process.getModuleByName('dinput8.dll');
const rows=new Map();
Interceptor.attach(plugin.base.add(0x51d50),{onEnter(args){
const object=args[0],key=object.toString()+':'+Process.getCurrentThreadId();
let row=rows.get(key)||{object:object.toString(),thread:Process.getCurrentThreadId(),calls:0};
row.calls++;row.state=object.add(0x758).readU8();row.clock=object.add(0x7a0).readFloat();rows.set(key,row);
}});
rpc.exports={summary(){return {calls:[...rows.values()],gameInputsSent:0,screenUse:false};}};
'''
with a.output.open('x',encoding='utf-8') as out:
    session=frida.attach(a.pid)
    try:
        script=session.create_script(source);script.load();time.sleep(10)
        result=script.exports_sync.summary();out.write(json.dumps(result));print(json.dumps(result),flush=True);script.unload()
    finally:session.detach()