Move tracer console app and expose as console script also

This commit is contained in:
Ole André Vadla Ravnås
2013-12-29 19:31:52 +01:00
parent 5e3b56bbff
commit 11de04f56d
3 changed files with 23 additions and 14 deletions
+2 -14
View File
@@ -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()
+16
View File
@@ -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)
+5
View File
@@ -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