How to use the archr.arsenal.LTraceAttachBow function in archr

To help you get started, we’ve selected a few archr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angr / archr / tests / test_bow_ltrace.py View on Github external
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