From 744e8ef747bf1af84088f042b361a1ed2a9fd263 Mon Sep 17 00:00:00 2001 From: rev1si0n Date: Sun, 5 Jan 2025 21:04:07 +0800 Subject: [PATCH] 7.90 auto-commit --- CHANGELOG.txt | 6 ++++++ lamda/__init__.py | 2 +- lamda/client.py | 12 +++++++++++- lamda/rpc/application.proto | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 267a406..f3c3726 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,9 @@ +7.90 +* 持久化脚本支持 spawn 模式 +* 支持持久化脚本输出日志 +* 修复 dump_window_hierarchy +* 修复 frida 实例获取逻辑错误 + 7.85 * 支持 mDNS 广播服务 * 支持枚举选择器选中的所有元素 diff --git a/lamda/__init__.py b/lamda/__init__.py index d019103..cbf79fc 100644 --- a/lamda/__init__.py +++ b/lamda/__init__.py @@ -2,4 +2,4 @@ # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT -__version__ = "7.85" +__version__ = "7.90" diff --git a/lamda/client.py b/lamda/client.py index 03466be..b646608 100644 --- a/lamda/client.py +++ b/lamda/client.py @@ -408,7 +408,7 @@ def _child_sibling(self, name, **selector): s.setdefault("childOrSiblingSelector", []) s["childOrSiblingSelector"].append(selector) s["childOrSibling"].append(name) - return self.__class__(self.stub, s) + return self.__class__(self.caller, s) def child(self, **selector): """ 匹配选择器里面的子节点 @@ -1211,6 +1211,7 @@ def is_installed(self): def attach_script(self, script, runtime=ScriptRuntime.RUNTIME_QJS, emit="", encode=DataEncode.DATA_ENCODE_NONE, + spawn=False, standup=5): """ 向应用注入持久化 Hook 脚本 @@ -1222,6 +1223,7 @@ def attach_script(self, script, runtime=ScriptRuntime.RUNTIME_QJS, req.script = script req.runtime = runtime req.standup = standup + req.spawn = spawn req.destination = emit req.encode = encode r = self.stub.attachScript(req) @@ -2151,6 +2153,14 @@ def __init__(self, host, port=65000, def frida(self): if _frida_dma is None: raise ModuleNotFoundError("frida") + try: + device = _frida_dma.get_device_matching( + lambda d: d.name==self.server) + # make a call to check server connectivity + device.query_system_parameters() + return device + except: + """ No-op """ kwargs = {} if self.certificate is not None: kwargs["certificate"] = self.certificate diff --git a/lamda/rpc/application.proto b/lamda/rpc/application.proto index 168393a..2fce24d 100644 --- a/lamda/rpc/application.proto +++ b/lamda/rpc/application.proto @@ -101,6 +101,7 @@ message HookRequest { string destination = 4; DataEncode encode = 5; uint32 standup = 6; + bool spawn = 7; } message HookRpcRequest {