mirror of
https://github.com/frida/frida-python.git
synced 2026-11-07 09:35:57 -10:00
Format with Black 26
This commit is contained in:
1 parent
2f2bb64f36
commit
7357b0b5b4
5 files changed
+14
-28
No files matched your search
@@ -42,8 +42,7 @@ class Application:
|
||||
print("✔ enable_child_gating()")
|
||||
session.enable_child_gating()
|
||||
print("✔ create_script()")
|
||||
script = session.create_script(
|
||||
"""\
|
||||
script = session.create_script("""\
|
||||
Interceptor.attach(Module.getGlobalExportByName('open'), {
|
||||
onEnter(args) {
|
||||
send({
|
||||
@@ -52,8 +51,7 @@ Interceptor.attach(Module.getGlobalExportByName('open'), {
|
||||
});
|
||||
}
|
||||
});
|
||||
"""
|
||||
)
|
||||
""")
|
||||
script.on("message", lambda message, data: self._reactor.schedule(lambda: self._on_message(pid, message)))
|
||||
print("✔ load()")
|
||||
script.load()
|
||||
|
||||
+2
-4
@@ -1,8 +1,7 @@
|
||||
import frida
|
||||
|
||||
session = frida.attach("Twitter")
|
||||
script = session.create_script(
|
||||
"""\
|
||||
script = session.create_script("""\
|
||||
rpc.exports = {
|
||||
hello: function () {
|
||||
return 'Hello';
|
||||
@@ -11,8 +10,7 @@ rpc.exports = {
|
||||
oops;
|
||||
}
|
||||
};
|
||||
"""
|
||||
)
|
||||
""")
|
||||
script.load()
|
||||
api = script.exports_sync
|
||||
print("api.hello() =>", api.hello())
|
||||
|
||||
@@ -22,8 +22,7 @@ class Application:
|
||||
self._session = session
|
||||
session.on("detached", lambda *args: self._reactor.schedule(lambda: self._on_detached(*args)))
|
||||
|
||||
script = session.create_script(
|
||||
"""
|
||||
script = session.create_script("""
|
||||
let _puts = null;
|
||||
|
||||
Interceptor.attach(DebugSymbol.getFunctionByName('f'), {
|
||||
@@ -48,8 +47,7 @@ function puts(s) {
|
||||
}
|
||||
_puts(Memory.allocUtf8String(s));
|
||||
}
|
||||
"""
|
||||
)
|
||||
""")
|
||||
self._script = script
|
||||
script.on("message", lambda *args: self._reactor.schedule(lambda: self._on_message(*args)))
|
||||
script.load()
|
||||
|
||||
@@ -29,8 +29,7 @@ class Application:
|
||||
session = self._device.attach(pid)
|
||||
session.on("detached", lambda reason: self._reactor.schedule(lambda: self._on_detached(pid, session, reason)))
|
||||
print("✔ create_script()")
|
||||
script = session.create_script(
|
||||
"""\
|
||||
script = session.create_script("""\
|
||||
const puts = new NativeFunction(Module.getGlobalExportByName('puts'), 'int', ['pointer']);
|
||||
puts(Memory.allocUtf8String('Hello from Frida agent'));
|
||||
Interceptor.attach(Module.getGlobalExportByName('open'), {
|
||||
@@ -41,8 +40,7 @@ Interceptor.attach(Module.getGlobalExportByName('open'), {
|
||||
});
|
||||
}
|
||||
});
|
||||
"""
|
||||
)
|
||||
""")
|
||||
script.on("message", lambda message, data: self._reactor.schedule(lambda: self._on_message(pid, message)))
|
||||
print("✔ load()")
|
||||
script.load()
|
||||
|
||||
Reference in new issue
Block a user