[Python] 纯文本查看 复制代码 import frida,time,pathlib,json
js=r'''
let id=-1;
Process.attachModuleObserver({onAdded(m){if(m.name!=='wd7e67f503d76025a.dll')return;
Interceptor.attach(m.base.add(0x1bc20),{onEnter(a){id=a[1].toUInt32();if(id>=558)send({e:'ins',id:id,a:this.context.rsp.add(40).readU32(),b:this.context.rsp.add(48).readU32()});}});
Interceptor.attach(m.base.add(0x1f440),{onEnter(a){this.p=a[1];this.i=id;},onLeave(v){if(this.i===561&&v.toUInt32())this.p.writeU32(0);if(this.i>=558&&v.toUInt32())send({e:'pop',id:this.i,v:this.p.readU32()});}});
Interceptor.attach(m.base.add(0x25890),{onLeave(v){if([561,565,569,571,575].includes(id))v.replace(0);}});
Interceptor.attach(m.base.add(0x1f720),{onEnter(a){if(id>=558)send({e:'push',id:id,v:a[1].toUInt32()});}});
}});
'''
d=frida.get_local_device();f=pathlib.Path(__file__).with_name('1.jsonl').open('w')
def msg(m,b):f.write(json.dumps(m.get('payload',m))+'\n');f.flush()
d.on('output',lambda p,fd,b:print(b.decode(errors='replace'),end='',flush=True))
p=d.spawn([r'C:\Program Files\Eclipse Adoptium\jdk-25.0.4.101-hotspot\bin\java.exe','--enable-native-access=ALL-UNNAMED','-jar',r'C:\Users\Administrator\Desktop\CrackMe\CrackMe01-obf.jar','KYT{AAAAAAAAAAAAAAA}'],stdio='pipe');s=d.attach(p);sc=s.create_script(js);sc.on('message',msg);sc.load();d.resume(p);time.sleep(4)
|