mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Get rid of abspath; Guard against --watch without user script
This commit is contained in:
+7
-9
@@ -39,7 +39,7 @@ def main():
|
||||
action='store_true', dest="watch", default=False)
|
||||
|
||||
def _initialize(self, parser, options, args):
|
||||
self._user_script = os.path.abspath(options.user_script)
|
||||
self._user_script = options.user_script
|
||||
self._watch = options.watch
|
||||
|
||||
def _usage(self):
|
||||
@@ -57,13 +57,11 @@ def main():
|
||||
self._exit(1)
|
||||
return
|
||||
|
||||
if self._watch:
|
||||
monitor = self._script_monitor
|
||||
if monitor is None:
|
||||
monitor = frida.FileMonitor(self._user_script)
|
||||
monitor.on('change', self._on_change)
|
||||
monitor.enable()
|
||||
self._script_monitor = monitor
|
||||
if self._user_script is not None and self._watch:
|
||||
monitor = frida.FileMonitor(self._user_script)
|
||||
monitor.on('change', self._on_change)
|
||||
monitor.enable()
|
||||
self._script_monitor = monitor
|
||||
|
||||
if self._spawned_argv is not None:
|
||||
self._update_status("Spawned `{command}`. Use %resume to let the main thread start executing!".format(command=" ".join(self._spawned_argv)))
|
||||
@@ -81,7 +79,7 @@ def main():
|
||||
pass
|
||||
|
||||
def _stop(self):
|
||||
if self._script_monitor != None:
|
||||
if self._script_monitor is not None:
|
||||
self._script_monitor.disable()
|
||||
self._unload_script()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user