import frida, time, subprocess
ADB="/opt/android-sdk/platform-tools/adb"
subprocess.run([ADB,"shell","am","force-stop","se.foglo.svt"])
subprocess.run([ADB,"shell","monkey","-p","se.foglo.svt","-c","android.intent.category.LAUNCHER","1"],stdout=-3,stderr=-3)
time.sleep(6)
r=subprocess.run([ADB,"shell","pidof","se.foglo.svt"],capture_output=True,text=True).stdout.split()
if not r: print("no pid"); raise SystemExit
pid=int(r[0])
JS=r"""
function il2str(p){ try{ if(p.isNull())return null; var l=p.add(8).readS32(); if(l<0||l>300)return null; return p.add(0xc).readUtf16String(l);}catch(e){return "<e>";} }
var m=Process.findModuleByName("libil2cpp.so"); var b=m.base; var EBX=b.add(0x1df6b7c);
var disps=[0x675b8,0x675bc,0x675c0,0x675c4,0x675c8,0x675cc,0x675d0,0x675d4,0x675d8,0x675dc,0x4d5c8,0x68994,0x68998,0x6899c];
var out=[];
for(var i=0;i<disps.length;i++){ try{var p=EBX.add(disps[i]).readPointer(); out.push("0x"+disps[i].toString(16)+" = "+JSON.stringify(il2str(p)));}catch(e){out.push("0x"+disps[i].toString(16)+" ERR "+e);} }
send(out.join("\n"));
"""
dev=frida.get_usb_device(timeout=10)
s=dev.attach(pid); sc=s.create_script(JS)
buf=[]
sc.on("message",lambda msg,d: buf.append(msg.get("payload",str(msg))))
sc.load(); time.sleep(1.5)
open("/tmp/litr3.out","w").write("\n".join(buf))
print("\n".join(buf))
