Skip to content

Commit cb86b60

Browse files
committed
不使用相对路径,允许从其他目录调用。
1 parent f21430d commit cb86b60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

r0capture.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import struct
6060
import time
6161
import sys
62+
from pathlib import Path
6263

6364
import frida
6465

@@ -284,7 +285,7 @@ def on_message(message, data):
284285
("=I", 228)): # Data link type (LINKTYPE_IPV4)
285286
pcap_file.write(struct.pack(writes[0], writes[1]))
286287

287-
with open("./script.js", encoding="utf-8") as f:
288+
with open(Path(__file__).resolve().parent.joinpath("./script.js"), encoding="utf-8") as f:
288289
_FRIDA_SCRIPT = f.read()
289290
# _FRIDA_SCRIPT = session.create_script(content)
290291
# print(_FRIDA_SCRIPT)

0 commit comments

Comments
 (0)