Skip to content

Commit

Permalink
fixed detaching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeywave committed Oct 21, 2022
1 parent 3944dcb commit 82317c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion create_standalone_release/friTap_release_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def ssl_log(app, pcap_name=None, verbose=False, spawn=False, keylog=False, enabl
debug = debug_mode

def on_detach(reason):
if reason == "application-requested":
return
print(f"\n[*] Target process stopped: {reason}\n")
cleanup(live,socket_trace,full_capture,debug)

Expand Down Expand Up @@ -225,7 +227,6 @@ def instrument(process):
script.enable_debugger(debug_port)
script.on("message", on_message)
script.load()
script.on('detached', on_detach)

# Main code
global pcap_obj
Expand Down Expand Up @@ -308,6 +309,8 @@ def instrument(process):
if keylog:
print(f'[*] Logging keylog file to {keylog}')

process.on('detached', on_detach)


if spawn:
device.resume(pid)
Expand Down
2 changes: 1 addition & 1 deletion friTap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# -*- coding: utf-8 -*-

__author__ = "Daniel Baier, Francois Egner, Max Ufer"
__version__ = "1.0.7.0"
__version__ = "1.0.7.1"
debug = False # are we running in debug mode?
5 changes: 4 additions & 1 deletion friTap/friTap.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def ssl_log(app, pcap_name=None, verbose=False, spawn=False, keylog=False, enabl
debug = debug_mode

def on_detach(reason):
if reason == "application-requested":
return
print(f"\n[*] Target process stopped: {reason}\n")
cleanup(live,socket_trace,full_capture,debug)

Expand Down Expand Up @@ -216,7 +218,6 @@ def instrument(process):
script.enable_debugger(debug_port)
script.on("message", on_message)
script.load()
script.on('detached', on_detach)

# Main code
global pcap_obj
Expand Down Expand Up @@ -299,6 +300,8 @@ def instrument(process):
if keylog:
print(f'[*] Logging keylog file to {keylog}')

process.on('detached', on_detach)


if spawn:
device.resume(pid)
Expand Down

0 comments on commit 82317c2

Please sign in to comment.