Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def ltrace_attach(self, t, p, **kwargs):
b = archr.arsenal.LTraceAttachBow(t)
pid = p.pid if isinstance(t, archr.targets.LocalTarget) else t.get_proc_pid('socat')
with b.fire_context(pid=pid, trace_args=LTRACE_ARGS, **kwargs) as flight:
sleep(0.1)
nc = flight.get_channel('tcp:0') # misuse of flight
nc.send(b'ahoi!')
assert nc.readuntil(b'ahoi!', timeout=5) == b'ahoi!'
return flight.result