mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Move tracer console app and expose as console script also
This commit is contained in:
+2
-14
@@ -4,19 +4,7 @@ import sys
|
||||
sys.path.insert(1, '@pythondir@')
|
||||
|
||||
import frida
|
||||
from frida.tracer import TracerProfileBuilder, Tracer
|
||||
import frida.tracer
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
print "Usage: %s <process name>" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
tp = TracerProfileBuilder().include_modules("libSystem*").exclude("malloc", "calloc", "realloc", "free").build()
|
||||
t = Tracer(tp)
|
||||
try:
|
||||
target = int(sys.argv[1])
|
||||
except:
|
||||
target = sys.argv[1]
|
||||
p = frida.attach(target)
|
||||
t.start_trace(p, tracer.STDOUT_SINK)
|
||||
sys.stdin.read()
|
||||
sys.exit(0)
|
||||
frida.tracer.main()
|
||||
|
||||
@@ -147,3 +147,19 @@ class IOSink(object):
|
||||
|
||||
STDOUT_SINK = IOSink(sys.stdout)
|
||||
STDERR_SINK = IOSink(sys.stderr)
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print "Usage: %s <process name>" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
tp = TracerProfileBuilder().include_modules("libSystem*").exclude("malloc", "calloc", "realloc", "free").build()
|
||||
t = Tracer(tp)
|
||||
try:
|
||||
target = int(sys.argv[1])
|
||||
except:
|
||||
target = sys.argv[1]
|
||||
p = frida.attach(target)
|
||||
t.start_trace(p, tracer.STDOUT_SINK)
|
||||
sys.stdin.read()
|
||||
sys.exit(0)
|
||||
|
||||
@@ -30,6 +30,11 @@ setup(
|
||||
url="http://frida.github.io",
|
||||
author="Frida Developers",
|
||||
author_email="ole.andre.ravnas@tillitech.com",
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'frida-trace = frida.tracer:main'
|
||||
]
|
||||
},
|
||||
ext_modules=[Extension('_frida', [])],
|
||||
cmdclass={
|
||||
'build_ext': FridaPrebuiltExt
|
||||
|
||||
Reference in New Issue
Block a user